Create Adobe form with fragments as a copy of the standard.

The Adobe form with fragments are part of the New Output Management for S/4 HANA Systems. In this blog post, I will explain, step by step, how to create a copy of this standard form with Fragments. Next, I will briefly compare the use of this form against the “standalone form” by giving advantages of its use.

You must have Adobe live Cycle Designer installed on your PC.

The ODATA service is a data provider. It gets data from the backend it generates an XML file.

It is responsible for calling the ODATA service to get the data, in XML format, which will be used in the call to the form interface to print it.

For the Adobe forms with context, the operation is simple. To print the form, we retrieve the data in a program and using this data, we call the function module of the form to print it.

But, for the Adobe form with fragments, in a callback class, we call an ODATA service to get the XML file that will be sent to the form to print it using the concept of binding available at Adobe layer (the XDP file of the form).

1

  • Reuse of the ODATA service: the ODATA service created in this form is a shared and reusable resource (whether in other forms or other programs). Whereas, the other types of forms are completely isolated and autonomous.
  • Speed and ease of development and maintenance: It is faster and easier to use ODATA services or methods, than to copy or recreate the contents of a new one.
  • Reusability of fragments: this type of form is based on fragments (.XDP file). These files can be reusable in several forms as indicated in this blog post.

In this scenario, we will take the purchase order as an example.

Copy the standard form and OData :

  1. Create a ZSF_MM_PURCHASE_ORDER form as a copy of the standard (interface + form) MM_PUR_PURCHASE_ORDER via the SFP transaction.

2

The standard form uses the FDP_EF_PURCHASE_ORDER_SRV service as data provider.

In order to add our own fields to the service, we need to create a custom service.

3

     2. Create an empty project “ZFDP_PURCHASE_ORDER_AB” using the transaction SEGW.

4

    3. Use a data model by reference to create the entities types.

5

In this custom service, the reference is the standard service “FDP_EF_PURCHASE_ORDER_SRV”.

6

Select All the entity in the popup to get all the entity in the standard service imported to the custom service.

7

Save the service in the transport order.

8

4. Gene.rate the OData service.

9

Copy the “Technical service name”, in our example it is “ZFDP_PURCHASE_ORDER_AB_SRV”. We will use it when adding it to the services catalog.

The service is generated successfully.

10

5. Enable the service Z in /IWFND/MAINT_SERVICE (service catalog).

Click the Add Service button.

11

Enter the service name “ZFDP_ PURCHASE_ORDER_AB_SRV” copied in “step4” and the system alias “LOCAL” and Click in “get services” button.

12

By clicking on the Technical Service Name, the corresponding service will be displayed in the final output.

Select the service and click on the “Add selected service” button.

13

The service is successfully added in the caltalog.

14

Copy the standard callback class:

  1. Find the callback class of the standard form.

In our case we will create a callback class as a copy of the standard.

In order to get the standard callback class, we must follow the following path:

SPRO -> SAP Reference IMG -> Cross Application Components -> Output Control.

15

Double-click on PURCHASE_ORDER.

16

The “CL_MM_PUR_PO_OUTPUT_CALLBACK“ is a callback class that invokes the ODATA service.

17

2. Copy the standard callback class “CL_MM_PUR_PO_OUTPUT_CALLBACK” to a Z class “ZCL_MM_PUR_PO_OUTPUT_CALLBACK” using the transaction se24.

18

    3. Update the “GET_PDF_PARAMETER” method in the Z callback class “ZCL_MM_PUR_PO_OUTPUT_CALLBACK”.

19

In line “12”, the standard service name is assigned.

20

4. Change the standard service assigned in line 12 by the service we already created in Z (in our example “ZFDP_ PURCHASE_ORDER_AB_SRV”).

21

    5. After activating the custom class, assign the Z class created in SPRO instead of the standard callback class.

22

6. Next, configure the Z form created at the beginning by the new service.

23

Add custom fields in our service:

1. Create a custom entity “Header” to get the email to display it in the first part of the purchase order.

24

2. Add the “Entity Type Name” and Check the option “create Related Entity Set”.

25

    3. Add the “Email” property to the created entity.

26

NB: The field “Name “will be user in the form and the “ABAP Field Name” in our ODATA service.

4. Save the project.

5. Generate the project, in order to generate the runtime artifacts of the “Header” entity.

we must, now, add the association between the entity created and the entity of the main ODATA service, so it can be called automatically.

Adding this association (Cardinality), will decide the use of the “GET_ENTITY” method or “GET_ENTITYSET”.

6. Create an association for the new entity.

27

Add the association name, primary entity, dependent entity, and cardinality.

28

The association and the association Set are created.

29

7. Generating the project, will automatically generate the models of the new entity created in the “MPC” class (the properties, the entity sets and the associations).

30

31

8. Add manually the method to get the data (in our example we will retrieve the Email) in the “DPC_EXT” class.

32

   9. Implement the code to get the “email” ( the field “ad_smtpadr”).

33

Our new entity and its method are created, now we have to call the new method.

NB: In a standard service, the call of methods is done at “/IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITY” method, as indicated in the screenshot below.

34

10. Redefine the “/IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITY” method in our custom project, so we can add the call to the new method created (Header_get_entity).

35

Add the custom field (the Email) created in the Adobe layer.

To modify the form, you can use the LiveCycle Designer locally.

36

  1. Download the “.XDP” file of the form using the transaction: FB_XDP_DOWN

37

Choose the location.

38

2. Create the field (in our example, we created a text field) and do the binding.

At the level of the link tab, we make the binding for the created field.The binding is done in this way: $.structure name.property name

39

3. Load the processing done in the form, locally in SAP, using the transaction: FB_XDP_UP.

40

4. Print the form after upload of the form.

41