Introduction
SAP Interactive Forms by Adobe is the successor to SAP script and Smart Forms. With Adobe Forms for SAP, there is a clear separation between design and programming. The interface, along with global data and logic, is developed separately from the form itself, unlike in Smart Forms. In addition, it offers various suitable functions and tools to make forms easy to design. Transaction code for adobe forms is SFP.
This blog explains the concepts involved in printing multiple pages dynamically with SAP Adobe forms. The dynamic aspect concerns expanding the printing to additional pages if the content doesn't fit in one page.
Prerequisite:
In order to use Adobe Forms for SAP, a Java stack must first be installed and the Adobe Document Service (ADS) must also be configured by SAP Basis. Adobe LiveCycle Designer (LCD) - the graphical user interface for Adobe Forms - must also be installed separately. It is available for download from the SAP Support portal.
we can verify the setup by executing the program FP_TEST_00 in SE38, that will display a adobe form if configuration is successful.
We will consider the example of a picklist printing to understand how multiple pages with expandable table contents are printed using adobe forms. I have configured the PPF action already for printing the pick list immediately on Warehouse Order creation.
Maintain the condition record to print picking warehouse order in /SCWM/PRWO6, it should have the form name and the form type as PDF-based form. Here, we are using standard Adobe form /SCWM/WO_MULTIPLE.
1) Go to SFP, and open the form
The interface for the form is /SCWM/WO_PRINT, which is also common to other standard WO adobe forms like /SCWM/WO_SINGLE, /SCWM/WO_UNLOAD. This is another advantage with adobe forms where the interface and its global data can be reused in multiple adobe forms.
We can drag and drop only the required fields from the interface into the context of a particular form. Here, Only ORDIM_O is enabled in the context of /SCWM/WO_MULTIPLE form.
2) Switch to the Layout tab, Design View is used for designing the layout elements and you can find them displayed in an hierarchical manner in the hierarchy tab of the layout, and we can see how the data is mapped in the data view.
3) Master Page – Every adobe form contains at least one master page that the designer creates automatically. It decides the page size and orientation and headers, footers, all static or boiler plate objects like company logo are placed in the master Page. Here, the form /SCWM/WO_MULTIPLE has a header, content and footer areas that will get repeated in each body page.
4) Body Page - It represent the pages of a form. Each body page derives its page size and orientation from a master page. You can also have more than one master page and body page, and you can choose which master page to assign to a body page. Here, the f form /SCWM/WO_MULTIPLE contains a single master page and body page. All dynamic data is enclosed within the content area and designed in the design view of the body page.
5) Below are the over all settings that enables the table data to overflow in body pages.
A. Body Page:
Subform
· Content : Flowed
· Flow Direction: Top to Bottom
· Allow Page Breaks within Content
Pagination – Default, no changes
B. Main Table
Under body page, the contents of ORDIM_O table are designed to fit in the content area(that was created in master page).
Subform
· Content : Flowed
· Flow Direction: Top to Bottom
· Allow Page Breaks within Content
Pagination – Default, no changes
Binding – ORDIM_O
C. Table Header
This includes only text elements without any data binding, the subform setup would be Positioned instead of flowing as the text is fixed.
Since the header need not be repeated for each data item, that is unchecked in the binding.
D. Table Item Data
The required field elements are created and mapped to the table data here.
Subform
· Content : Flowed
· Flow Direction: Western text (The layout elements under the data item hierarchy is arranged Left to right)
· Allow Page Breaks within Content
Pagination – Default, no changes
Binding – Repeat subform for each data item - CHECKED
Test Results:
When executed the outbound process (Sale Order created, Outbound deliveries in ERP distributed to EWM and when wave is released, a warehouse order with multiple pick tasks was created).
We can find the created PDF output in SP01/SP02.
Printing multiple pages with custom adobe form for Warehouse Order or HU
We can also use a custom form to print, by following the below steps.
1) SFP – I have copied /SCWM/WO_MULTIPLE to form ZWO_MULTIPLE and included a new text field at the bottom of master page.
2) Any of these other layout elements can also be inserted from the insert menu and mapped(Binding) to data available in the context.
3) Once the necessary changes are made, the form name has to be maintained in the condition record in /SCWM/PRWO6.
If we now follow the same steps as previously to test, we will end up with error “No BAdI Implementation found for form &&”.
This error will not occur when using a custom smart form. The reason is the custom smart form can carry the processing specific to each form in the global initialization but adobe form only has the layout and data.
The FM /SCWM/EXECUTE_PPF_WO executing WO printing via PPF, checks the type of form (smart form or adobe form), and prints smart form directly, but for adobe forms, prepopulates the data based on name of the adobe form and has a BAdI to be implemented when the form is custom.
Below is the function module /SCWM/EXECUTE_PPF_WO_PDF used to print the adobe forms checking the form name.
In the BAdI, the name of the form is passed, so we could have different logic defined for each custom form and also if we had included more fields into the context and used in the custom form, we could directly print the adobe form within the BAdI implementation and set the flag lv_printed to true, so the standard logic doesn’t create duplicate prints.
4) Only after implementing the BAdI /SCWM/EX_PRNT_PDF_WO to populate the context parameters data, our custom adobe form will be printed.
5) Similarly if we want to use custom adobe form for printing HU, follow all the steps as in standard PPF setup, and then maintain the custom form name in the condition record in /SCWM/PRHU6, implement the BAdI /SCWM/EX_PRNT_PDF_HU to populate the interface parameters.
Test Results of custom Pick list print:
After executing standard outbound process, the generated picklist with a multiple Warehouse tasks has our custom text field Completion time in all the pages as it was added in master page.