Display Adobe Form in SAP Web Dynpro
To display Adobe Form in an SAP Web Dynpro component, the steps for an ABAP developer is the focus of this Web Dynpro tutorial. Web Dynpro programmer can use InteractiveForm layout element on a Web Dynpro component View to display Adobe Forms document. ABAP developer should set pdfSource property of the InteractiveForm element in WDDOMODIFYVIEW method of the related View.
In the following section of this SAP Web Dynpro tutorial, I will show how to store Adobe Form pdf data in Web Dynpro component context with ABAP codes and bind Adobe Form pdf context to InteractiveForm element pdfSource property.
If you do not prefer to display Adobe Form output embedded in a Web Dynpro popup screen, you can use the alternative method illustrated in Web Dynpro tutorial Display and Download Adobe Form as PDF File in SAP Web Dynpro
I assume the ABAP programmer create Adobe Forms using SAP transaction code SFP and the Adobe Form is ready. I will not also describe the steps to create a Web Dynpro component. I skip these two steps.
First create the required context to store Adobe Forms output pdf source data. As you can see in below screenshot, in Context tab of the Web Dynpro View I create a node named PDF. Then I added attribute ADOBE_FORM under PDF node. The Adobe_Form attribute has type XSTRING
Now on the Web Dynpro View, switch to Layout node. Under RootUIElementContainer, add a new InteractiveForm element.
Now, we need to bind PDF binary data to InteractiveForm element pdfSource property. Click on Binding column next to pdfSource attribute. Choose the ~.PDF.ADOBE_FORM context attribute as the data source of the Adobe Form element on Web Dynpro View layout.
In WDDOMODIFYVIEW method ABAP code block, we can create ABAP codes to get required parameter values for the Adobe Forms document. Query and store those parameter values on context node and context attribute values. I'll not illustrate these since all Adobe Forms outputs will require different input parameters.
If you want to display Adobe Form in pop up screen like I did in this case, control the first time of the View. Otherwise, when you click OK, or CANCEL, etc buttons on the pop up screen ABAP codes will run unnecessarily.
Within WDDOMODIFYVIEW method, be sure that you execute Adobe Forms code for the view is loaded for the first time.
Use the following ABAP CHECK statement to control condition FIRST_TIME if it is equal to 'X' or ABAP_TRUE value.
If you are displaying Adobe Forms output on a Web Dynpro view other than pop up screens, ommit the above control.
Here are the summarized main steps verbally in below ABAP codes:
1) Open spool job,
2) Get Adobe Form function module name,
3) Call Adobe Form function module,
4) Store PDF binary data in Context,
5) Close spool job
This SAP Web Dynpro tutorial is showing how to display Adobe Forms output on a Web Dynpro popup screen. I hope this tutorial to be useful for ABAP developers on their Web Dynpro components where they consume and display Adobe Forms outputs.