Monday, 4 May 2020

Understanding Fragments based Adobe form building using LiveCycle version 10+ with OData as back-end.

Adobe has come up with new Fragments based approach for building Adobe Forms using LiveCycle designer from version 10 and above. And these Forms are part of New Output Management for S/4 HANA Systems. In this blog post I would like to explain briefly about Fragments based Forms and also would cover regular Forms (which is categorized as of type “Standalone Form”) with OData as backend. I would like to say that even though traditional Form building provisions precisely speaking SAP Scripts, SMARTFORMS and Adobe Forms with ABAP based Interfaces are still available as an alternative for this but still I would like to ask all of you to give this a try at least for learning purposes if your client is not insisting on this. If not now definitely going ahead, we might be bound to use this option (Adobe Form with OData backend) only.

And as highlighted in one of the blogs above I would like to give below SAP Notes references as well. Again, it’s not mandatory to go through them in order to continue ahead with this blog post, but for those who want to get into detail they can definitely go through them.

SAP Note 2228611 – Output Management in S/4 HANA

SAP Note 2292571 – SAP S/4 HANA output control -technical setup

SAP Note 2292539 – SAP S/4 HANA output control -configuration

SAP Note 2292646 – SAP S/4 HANA output control -form templates with fragments

SAP Note 2292681 – SAP S/4 HANA output control –master form templates

SAP Note 2294198 – SAP S/4 HANA output control -customized forms

SAP Note 2367080 – SAP S/4 HANA output control -customized master forms

Before going to start with Fragments based Form building I would like to go through basics of our traditional regular AdobeForms which is also referred or rather say categorized as “Standalone Forms” in S/4 HANA systems.

Basics of regular AdobeForms/Standalone Forms.

Those who have already worked on Adobe Forms before would be aware of how the initial page of Layout looks like when you open the Layout editor from SFP transaction’s Layout option.

You would see mainly there are two Objects by default:

◉ A Page Set called (Master Pages)
◉ A default Subform/Page. Let’s name it as “Content_Subform” considering below example case.

Now the concept of Master Pages is to define the Static contents/properties related to Form Layout. Such as Logo, Header/Footer, Page orientation etc. which would be common for all the pages where we would be displaying the Layout specific contents. Inside a Master Page there would be also a space reserved called Content Area ( in our case we have named it as “Content_area1”) and in this area of a Master Page only the contents of all other remaining Subform Objects(“Content_Subform” in our example case) would be displayed.

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

Above picture shows a Master Page named “Page1” and you can see in the Layout I have created a Subform inside “Page1” inside this Subform we can place static contents like Logo, a static Header text etc. Below that you can see a Content Area (colored with violet outline)  named “Content_area1”, now this is the area where content of all the remaining( non-Master Page) Subforms/Pages (e.g. Content_Subform in this case) would be displayed.

So, the Content of “Content_Subform” would be superimposed inside the Content Area of referred Master Page.

When you click on a non-Master Page say “Content_Subform” in our example it opens the Design View in the Layout editor, see below.

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

While designing inside Design View you can explicitly specify which Master Page to be used in case you have more than one Master Pages defined. Here we have only one i.e. “Page1”.

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

Summary: So now you got to understand that in an Adobe Form Layout there are mainly two things one is Master Pages and other is the Content Pages/Subforms.

Master Pages are used to define static contents of a Layout like Logo, fixed Texts, orientation etc. And it has got a Content Area where the Content Pages/Subforms would be superimposed.

Content Pages/Subforms are the places where we would be doing the designing of contents like EKKO, EKPO, EKET details say if we are designing a PO Output Layout.

What is Fragment based Adobe forms.

Now the concept of this new Fragment-based Form designing in Adobe LiveCycle Designer version 10 and above is nothing but the introduction of reusable Master Form Layouts which would be having a collection of Fragments and Fragments are indeed collection of many Master Pages. The same Master Pages which we discussed in previous section. And these reusable Master Form Adobe layouts could be referred inside a Content Form Layout. Such that inside these Content Form Layouts, Master Pages present inside a Master Form Layout could be utilized. This covers the concept of Master Form Layout Template.

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

Now Content Form Layouts are the Form Layouts where we would be actually displaying the Context or say Content for example PO Layout. And inside the Content Form Layout we can refer the above Master Form Layout for inheriting the Master Pages present in it to the Content Form Layout.

Now apart from this we have the Old regular Adobe Form also which is called Standalone Form as per S/4 HANA naming conventions. So, it’s very clear that Standalone Form is nothing but a Form layout which would be independent and hence there would be no reference of any Master Form Layout for inheriting Master Pages in fact we would be utilizing the Local Master Pages defined in the Master Page set. (This we already covered before this topic)

So, in the nutshell as part of new Output Management in S/4 HANA systems (OData backed), we have below three Form Types:

◉ Master Form Layout. (Would be having Fragments.)

◉ Content Form Layout. (Utilizes a Master Form to inherit Master Pages present inside the Fragments of a Master Form Layout)

◉ Standalone Form Layout. (Would be having its own set of local Master Pages just as regular Adobe forms)

Creating a Master Form, Content Form and Standalone Form.

First let me show you how a Fragments based Form looks like in  SFP Transaction.

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

What I observed the above two options (Gateway Service and Fragment Usage) you won’t get while trying to create a fresh Form using SFP Transaction. Even though we have an option for providing XML based Interface option.

So the best option is search for a suitable Form template from the Standard ( “Maintain Form Template” Fiori app) which almost matches with our requirement and copy the same to a Zversion and make your changes.

So I copied Standard Form “MM_PUR_PURCHASE_ORDER” to a Zversion and Customized it. Please note Form “MM_PUR_PURCHASE_ORDER” is a Form of Form Type “Content” so it’s a Content Form inside which we would be having a Master Form Template referenced for inheriting Master Pages.( I hope you are getting the whole sequences. )

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

Now the value set in “Fragment Usage” field in SFP transaction determines whether a Form is a Master Form or a Content Form or a Standalone Form.

If you select “Form with fragment” then it’s a Content Form.

If you select “Fragment” then it’s a Master Form which would be having Fragments inside it.

If you select “Form without fragment” then it’s a Standalone Form.

As simple as that.

Examples:

Content Forms: MM_PUR_PURCHASE_ORDER, MM_PUR_RFQ_EXTERNAL, MM_PUR_SCHD_AGRMT etc.

Master Forms: APOC_DEMO_FORM_MASTER_AU, etc.

Standalone Forms: EDO_AR_PRINT

Master Form Explained with an example:

Let’s take example of “APOC_DEMO_FORM_MASTER_AU” only.

If you go through the above link you would observe that SAP recommends to edit a Form Layout by opening the corresponding “.xdp” file in Adobe Live Cycle designer explicitly i.e. not from SFP and then edit and once the edit is done you can upload the changes done to the Layout by uploading this edited “.xdp” file to the corresponding Form using SFP transaction’s “Upload Layout” option.

So first copy this standard Master Form template “APOC_DEMO_FORM_MASTER_AU” into a Zversion using SFP Transaction and later download the “.xdp” file either using SFP tcode itself or using the “Form Template Maintenance” Fiori  app.

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

Now open this “.xdp” say ZDEMO_FORM_MASTER_AU.xdp using Adobe Live Cycle designer.

You can see the below components

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

You can see in the above Master Form we have five Fragments defined and each would be having its own sets of Mater Pages. You can make changes into these and these could be reused into many Content Forms by referring it there.

Content Form explained with an Example:

Let’s take example of “MM_PUR_PURCHASE_ORDER” only.

Just like we did before, copy this standard Content Form into a Zversion using SFP Transaction and later download the “.xdp” file either using SFP tcode itself or using the “Form Template Maintenance” Fiori  app. Here there is a difference, whenever you download a Content Form system will also prompt(even though it’s optional) you to download corresponding Master Form Layout.

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

Remember while downloading the Master Form Layout corresponding to a Content Form, always download the Master Form which you have attached to Content Form Layout in SPRO Configuration. This SPRO Configuration I would be explaining later in this section. NOTE, Master Form for a Content Form would be picked in runtime using this SPRO Configuration only so its very necessary you download the right one when you want to edit it using Adobe Live Cycle designer.

Now open the “.xdp” file of Content Form say ZMM_PUR_PURCHASE_ORDER.xdp using Adobe Live Cycle designer.

You can see the below components,

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

Now once you have selected (as shown above) which Fragment of the Master Form needs to be used in this Content Form you can use the Master Pages of Fragments in the Design View.

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

Hope this clears “How a Master Form is linked inside a Content Form”. This was the main reason for which I penned this blog.

Standalone Form explained:

Now Standalone Form is like a Content Form only except it would be using its own local sets of Master Pages only and hence it won’t be referring any Master Form inside it.

Note: Would like to highlight the below issue which I encountered while using Master Form Layout. SAP might come out with a proper solution for this going ahead.

SPRO Configuration:

Please Note this would be only the partial Output Configuration meant for defining the Master Form determination and Content Form/Standalone Form determination for a output type. BRF+ config for determining the rules for Output type picking is out of scope of this document.

SPRO> Cross-Application Components> Output Control

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

Now apart from this I would like to give some suggestions while tweaking the standard Odata for Form building purposes.

Let’s take the example of “FDP_EF_PURCHASE_ORDER_SRV” the one which is used in Standard Content Form MM_PUR_PURCHASE_ORDER.

◉ I would recommend to copy a Standard Odata to Zodata because by doing this writing code for Custom added won’t need to enhance standard DPC_EXT classes instead we could redefine ZDPC_EXT methods. Its just like we used to copy Standard Driver Program for PO Script MEDRUCK i.e. SAPFM06P into a ZCOPY.

◉ While copying a Standard Odata Service Project to a ZProject use the redefining option only.

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

And while Generating Runtime Objects, don’t forget to press the below checkbox.

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

◉ Definitely go through the below SAP Help link for knowing how to add custom EntitySet operation, GET_ENTITY is not mentioned there but it’s like GET_ENTITYSET only.

◉ Suppose while binding the Internal Table you are facing issues, say for e.g. instead of showing multiple line items the output shows only 1 line then I would like to suggest drag the EntitySet which you want to Display from the “Data View” to the Form Layout. After that you can make necessary changes with the Cells.

SAP S/4HANA, NW ABAP Gateway (OData), ABAP Development, SAP ABAP Certification, SAP ABAP Exam Prep

So in the nutshell AdobeForms with Fragments would be very useful in scenarios where we have multiple Content Forms sharing similar Master Pages. You make changes in Master Pages of a Master Form Layout and it would reflect into all the Content Forms where and all its used. This reusability is what we can achieve using Fragments based AdobeForms.

By this I would like to conclude my blog post and would request all to give this new Form Output management a try. Do comment out your observations I would definitely like to help out if I could. I would definitely suggest referring the standard Content Forms like “MM_PUR_PURCHASE_ORDER” to understand the binding in case of Odata backend AdobeForm Layout.

No comments:

Post a Comment