55407283 offline adobe interactive forms integration using sap netweaver pi abap mapping v1 0
DESCRIPTION
Adobe IFTRANSCRIPT
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 1/15
Offline Adobe
Interactive Forms
Integration usingSAP NetWeaver PI
ABAP Mapping
Released only for SAP internal
Document Version 1.0, July 2008
MDM SDS
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 2/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 2
History
Date Author Version Comment
11/07/2008 Matthias Allgaier 1.0 Document created
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 3/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 3
Table of content
1 Overview..................................................................................................................................41.1 Business Example .....................................................................................................................................4
1.2 Arch itecture................................................................................................................................................5
1.2.1 Adobe Document Services (ADS)........................................................................................................5
1.2.2 PI Solution..........................................................................................................................................5
2 PI Configuration ......................................................................................................................72.1 Form Builder ..............................................................................................................................................7
2.2 Design: Integration Reposi tory .................................................................................................................8
2.2.1 Message Type: MT_PDF_BINARY......................................................................................................8
2.2.2 Adobe XSD-Structure: External definition............................................................................................9
2.2.3 IDoc structure: ORDERS.ORDERS04.................................................................................................9
2.2.4 Message Mapping: MM_PDF_2_IDOC_ORDERS04.........................................................................10
2.2.5 Interface Mapping: IM_PDF_2_IDOC_ORDERS04............................................................................10
2.3 Integration Directory ................................................................................................................................112.3.1 Mail Sender Communication Channel: IMAP4...................................................................................11
2.3.2 Mail Sender Communication Channel: PayloadSwapBean................................................................12
2.3.3 IDoc Receiver Channel .....................................................................................................................12
2.3.4 Receiver Determination.....................................................................................................................13
3 ABAP Mapping: ZCL_PDF2XML .......................................................................................... 14
4 Runt ime: PI Message Moni tor..............................................................................................15
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 4/15
Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping
1 Overview
1.1 Business Example
Through a combination of Adobe and SAP technologies, Interactive Forms based on Adobe softwareallows enterprises to eliminate redundant and inaccurate data and improve the speed with which theycan respond to customer needs and changing business requirements.
This document describes a business example where interactive PDF forms are generated and sent outto end users via E-Mail. The forms can be pre-populated with information stored in the SAP applicationbased on the user’s role in the business process. End users can then add supplementary information orupdate existing information directly in the interactive form – in our case offline.
After the end user enters data into the form, the data can be validated for appropriate format, usingclient- or server-side validation. Also, calculations - such as current interest rate or overtime premium -can be made. After completing the interactive form offline within its mail client software (e.g. Microsoft
Outlook) the end user can submit the form to be sent back again to the SAP Backend System (in ourcase to create sales orders):
ORDERS.ORDERS05
Mail Server
SAP NetWeaver PI/XI
SAP ERP 4.7
Mail-Adapter
IDoc Adapter
Mail Account
Sales Order
Mail Client e.g. Outlook
Internet/Intranet/Extranet
ORDERS.ORDERS05
Mail Server
SAP NetWeaver PI/XI
SAP ERP 4.7
Mail-Adapter
IDoc Adapter
Mail Account
PDFPDF
Sales Order
Mail Client e.g. Outlook
PDFPDF
Internet/Intranet/Extranet
In domain of Master Data Management (MDM) this solution approach could e.g. be used in order tomaintain master data offline and replicate it to a central backend system (e.g. Master Data Server).
The crucial part of such an interface is the conversion of the binary PDF document to a structured XMLdocument that can further be used to interface with the backend systems (e.g. via IDoc/ALE).
In this document we describe a solution for this transformation using a generic SAP NetWeaver PI ABAPMapping based on Adobe Document Services (ADS) technology.
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 5/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 5
1.2 Architecture
1.2.1 Adobe Document Services (ADS)
Since SAP NetWeaver (Web) Application Server 6.40 (SAP NetWeaver 04), Adobe document services(ADS) have been available. This is a set of runtime services deployed on the Application Server that
provide a range of form and document creation and manipulation functions. The key capabilities of theADS are the creation of documents in PDF and various print formats from XML form templates andcurrent system data, and the extraction of user-entered data from interactive PDF forms for renderingand generating Adobe Forms. SAP has also provided a single programmatic interface called PDFDocument Object (or PDF Object) that enables developers to communicate with ADS. PDF Object isavailable both in ABAP as well as J ava.
1.2.2 PI Solut ion
This document outlines a solution on how an interactive PDF form submitted by the end user can be sentto NetWeaver PI via E-Mail, transformed into an IDoc structure and finally be posted to a SAP backendsystem using IDoc/ALE technology:
SAP ERPMail
Server SAP NetWeaver PI/XI
IDoc Adapter
Accoun t
PDFMail
Adapter
GraphicalMapping
ABAP
Mapping
ADS API (ABAP)
Adobe Document Serv ices (ADS)
ALE
Inbound
Sales
Order
IMAP4 RFCPDF
XML
XML
IDoc XML
1
2 3
4 5
6
SAP ERPMail
Server SAP NetWeaver PI/XI
IDoc Adapter
Accoun t
PDFPDFMail
Adapter
GraphicalMapping
ABAP
Mapping
ADS API (ABAP)
Adobe Document Serv ices (ADS)
ALE
Inbound
Sales
Order
IMAP4 RFCPDF
XML
XML
IDoc XML
1
2 3
4 5
6
Solution in detail:
1. The end user completes the interactive PDF form and sends it via E-Mail back to the backendsystems. The mail address is defined during form design. It is recommended to create a maildedicated mail account that is linked to a Mail-Sender-Adapter within PI (e.g. using IMAP4protocol). Since the PDF form is sent as an attachment to PI the PDF the PayloadSwapBean
(delivered by SAP) is used within the Mail Sender Adapter in order to bring the PDF attachmentto the main message payload within PI for further processing.
2. First an ABAP Mapping is used in order to convert the binary PDF form into a Adobe specificXML representation. For this purpose the ADS Services are used – this services run on the PIServer. In general this ABAP mapping is generic so it could be used for different PDF forms.
3. The ADS API returns an Adobe specific XML document containing the information from the PDFdocument.
4. Afterwards a graphical mapping is used to map the Adobe specific XML structure to the actualtarget format, in this case to a standard ORDERS05 IDoc structure.
5. The IDoc is sent to the IDoc Receiver Adapter and posted to the SAP ERP Backend System.
6. Within SAP ERP a Sales Order is created by ALE inbound processing.
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 6/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 6
Notes:
This paper does not describe in detail how a PDF form designed, generated and sent out to end users.(Please refer to the Adobe/SAP documentation for further details).
Within the next chapter we concentrate on the essential development and configuration steps (no
complete step-by-step description). For additional information please refer to the SAP/Adobedocumentation.
We assume that ADS is installed on SAP NetWeaver PI.
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 7/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 7
2 PI Configuration
2.1 Form Builder
The first step for an offline scenario is to design a form using transaction SFP. This topic has been
covered in detail in other How-To documents and is also explained in details in SAP documentation.
It includes following steps: Create an interface Create a form object Finally create the layout of the form and activate the form
Form Interface
Form Context
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 8/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 8
Form Layout
2.2 Design: Integration Repository
2.2.1 Message Type: MT_PDF_BINARY
This message type represents the binary PDF document that will be received via Mail-Sender-Adapter.
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 9/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 9
2.2.2 Adobe XSD-Structure: External defini tion
The Adobe specific XML structure representing the PDF Form is imported as an external definition:
2.2.3 IDoc structure: ORDERS.ORDERS04
This IDoc structure is imported from the SAP ERP backend system and is used in order to create thesales order.
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 10/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 10
2.2.4 Message Mapping: MM_PDF_2_IDOC_ORDERS04
Graphical Mapping that transforms the Adobe specific XML structure to an IDoc structure:
2.2.5 Interface Mapping: IM_PDF_2_IDOC_ORDERS04
As described in the first chapter the actual transformation of the binary PDF document is done using twoPI mappings:
A) ABAP Mapping that transforms the binary PDF document to an Adobe specific XML structure (will bedescribed in detail in chapter 3)B) Graphical Mapping that transforms the Adobe specific XML structure to an IDoc structure
Both mappings are encapsulated within following interface mapping:
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 11/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 11
2.3 Integration Directory
For the configuration we assume that two business services/business systems have been set up – onerepresenting the Mail-Server that is used for receiving incoming Mails from the end users and onerepresenting the SAP ERP System to receive Purchase Orders via IDoc/ALE technology.
2.3.1 Mail Sender Communication Channel: IMAP4Configuration of the Mail-Sender Adapter to retrieve incoming mails from the connected Mail-Server,using IMAP4 protocol:
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 12/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 12
2.3.2 Mail Sender Communication Channel: PayloadSwapBean
Since the PDF form is sent as an attachment to PI the PayloadSwapBean (delivered by SAP) is usedwithin the Mail-Sender-Adapter in order to bring the PDF attachment to the message payload within PIfor further processing:
2.3.3 IDoc Receiver Channel
The IDoc adapter is used to post IDoc to SAP ERP Backend.
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 13/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 13
2.3.4 Receiver Determination
Following Screenshots captures the relevant receiver determination:
Note: In the above scenario an additional receiver has been set up in order place the binary PDFdocument to an archive server using the File-Adapter (not mandatory).
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 14/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 14
3 ABAP Mapping: ZCL_PDF2XML
Following ABAP Mapping is used to convert the binary PDF form to an Adobe specific XML documentthat could be used for further processing (ABAP class ZCL_PDF2XML). The mapping is generic so it isnot form specific and could be used for multiple use cases. For the actual conversion it uses ADS APIprovided by Adobe.
Within Integration Repository it is referenced in the Interface Mapping (see chapter 2.2.5 -IM_PDF_2_IDOC_ORDERS04).
met hod i f _mappi ng~execut e.
* Declarations
cl ass cl _f p def i ni t i on l oad.
* ADS API
data: l r _f p t ype r ef t o i f _f p,l r _pdf obj t ype r ef t o i f _f p_pdf _obj ect,l r_ f pex t ype r ef t o cx_f p_r unt i me.
* Binary PDF document (Input) and XML document (Output)
data: l v_pdf t ype xstr i ng,l v_xml _dat a t ype xstr i ng.
l v_pdf = sour ce.
* get FP reference
l r _f p = cl _f p=>get _r ef er ence( ) .
* Call ADS API for conversion (5 steps)
t r y.* 1) create PDF Object
l r _pdf obj = l r _f p- >creat e_pdf _obj ect ( connect i on = ' ADS' ) .
* 2) set document
cal l met hod l r _pdf obj - >set _documentexport i ng
pdfdat a = l v_pdf .
* 3) tell PDF object to extract data
cal l met hod l r _pdf obj - >set _t ask_extr actdat a( ) .
* 4) execute, call ADS
cal l met hod l r _pdf obj - >execut e( ) .
* 5) get the data-context in XML format
cal l met hod l r _pdf obj - >get _dat a
i mport i ngf ormdata = l v_xml _data.
catch cx_f p_r unt i me_i nt ernal i nto l r _f pex.* PERFORM error USING lr_fpex 'INTERNAL ERROR'.
catch cx_f p_r unt i me_syst em i nto l r _f pex.* PERFORM error USING lr_fpex 'SYSTEM ERROR'.
catch cx_f p_r unt i me_usage i nto l r_f pex.* PERFORM error USING lr_fpex 'USAGE ERROR'.
endt r y.
r esul t = l v_xml _dat a.
endmet hod.
7/16/2019 55407283 Offline Adobe Interactive Forms Integration Using SAP NetWeaver PI ABAP Mapping V1 0
http://slidepdf.com/reader/full/55407283-offline-adobe-interactive-forms-integration-using-sap-netweaver-pi 15/15
Offline Adobe Interactive Forms Integration using SAP NetWeaver PI ABAP Mapping
Page 15
4 Runtime: PI Message Monitor
Following screenshot shows the PI Message Monitor (SXMB_MONI):
Window 1: Received binary PDF formWindow 2: Generated IDoc in IDoc-XML format containing the PDF content within XML tags