
Introduction:
Adobe Form Development Process for SAP Systems.
The Adobe form development process in SAP typically involves three main steps:
While the overall process remains consistent, the interface creation can vary depending on the data retrieval method. The three primary approaches are:
Let's focus on enhancing a gateway-based form using a Purchase Order example:
Approach:
Enhancing a Gateway-Based Purchase Order Form.
In this scenario, we'll add two additional fields to the standard form:
which is discussed in detail in the later steps below:
A. Search for Form in Maintain Form Template App:
Step 1: Locate the standard Purchase Order form.
Step 2: Create a copy of the standard form.
Step 3: Verify the new custom form
Step 4: Examine form template details
Step 5: Identify the OData service.
Now, as we have created the custom form template “ZZ1_HM_TEST”, we will go for creation of custom OData service to provide the data source to the adobe form which is explained in the next step.
B. Custom OData Service Creation (SEGW):
Step 1: Create OData Service Project
Step 2: Redefine Data Model
Step 3: Generate Runtime Artifacts
Step 4 : Identify and Add the Custom Fields.
In this requirement, “Bill To Address” and “Amount In Words” are needed to be add, as addition fields in the form apart from the standard details. So, for that we need to check which details are available in the OData Service.
Since, Bill to Address is not there in any of the entity in OData service, we will add this, in the structure of Purchase Order Node, i.e., TDS_ME_PO_HEADER.
Since, we have the standard field for fetching the Total Amount and now, we just need to convert it in Words. For that we will add the custom field in the structure of Purchase Order Node, i.e., TDS_ME_PO_HEADER.
Step 5: Create Append Structure
Step 6: Add and Activate Custom Fields
Step 7: Import New Properties to Entity
Step 8: Update Runtime Artifacts
Step 9: Code for fetching Bill to Address and Amount in Words.
METHOD purchaseorders_get_entity.
TRY.
CALL METHOD super->purchaseorders_get_entity
EXPORTING
iv_entity_name = iv_entity_name
iv_entity_set_name = iv_entity_set_name
iv_source_name = iv_source_name
it_key_tab = it_key_tab
io_request_object = io_request_object
io_tech_request_context = io_tech_request_context
it_navigation_path = it_navigation_path
IMPORTING
er_entity = er_entity
es_response_context = es_response_context.
CATCH /iwbep/cx_mgw_busi_exception.
CATCH /iwbep/cx_mgw_tech_exception.
ENDTRY.
DATA : lv_spell TYPE spell,
lv_amount TYPE p DECIMALS 2,
lv_amt_spell(255) TYPE c.
"Bill To Address
SELECT SINGLE
FROM i_purchaseorder
FIELDS purchaseorder, \_purchaseorderitem-plant,
\_purchaseorderitem\_plant-addressid AS addressid,
\_supplier\_supplierpurchasingorg-supplierrespsalespersonname AS salesperson
WHERE purchaseorder = @er_entity-ebeln
INTO (ls_data).
IF sy-subrc = 0.
ENDIF.
SELECT SINGLE a~country
FROM i_address
WITH PRIVILEGED ACCESS AS a
JOIN i_supplier
WITH PRIVILEGED ACCESS AS s
ON a~addressid = s~addressid
WHERE s~supplier = @er_entity-lifnr
INTO (lv_country).
IF sy-subrc = 0.
ENDIF.
IF ls_data IS NOT INITIAL AND lv_country IS NOT INITIAL.
cl_fdp_ef_pur_ord_form_utility=>get_address_in_printform(
EXPORTING
iv_language = er_entity-spras
iv_sender_country = lv_country
iv_adrnr = ls_data-addressid
iv_street_has_priority = abap_true
IMPORTING
ev_address_line1 = er_entity-bill_add_line_1
ev_address_line2 = er_entity-bill_add_line_2
ev_address_line3 = er_entity-bill_add_line_3
ev_address_line4 = er_entity-bill_add_line_4
ev_address_line5 = er_entity-bill_add_line_5
ev_address_line6 = er_entity-bill_add_line_6
ev_address_line7 = er_entity-bill_add_line_7
ev_address_line8 = er_entity-bill_add_line_8
).
ENDIF.
"Sales person
er_entity-salesperson = ls_data-salesperson.
"Amount in Words
lv_amount = er_entity-purchaseordernetamount.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = lv_amount
currency = er_entity-waers
filler = ' '
language = sy-langu
IMPORTING
in_words = lv_spell
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
IF lv_spell IS NOT INITIAL.
er_entity-zword_amount = lv_spell-word.
ENDIF.
ENDMETHOD.
Code Explanation:
Step 10: Activate the class and service.
C. Register the service in GW (T-code - /IWFND/MAINT_SERVICE)
Post creation of OData service, registration of the service will be done by following below steps:
Step 1 : Adding the service in GW.
Now your service is successfully registered.
D. Assign “ZHM_PO_TEST_SRV” service to Adobe form.
Step 1 : Check the Odata service for form.
Step 2 : Changing OData Service.
E. Download the bindings for the form
There are two ways to download the bindings for the forms.
Bindings can be downloaded from:
1) SFP Tcode -> Form -> Utlilites -> Uploading/Downloading -> Downloading Layout (XDP), Downloading Data Schema (XSD).
2) Maintain Form Template App -> Custom Form Name -> Download (it will download both XDP and XSD file in the folder).
Since, from “Maintain Form Template” App both the files will be getting downloaded at same time, will opt for this way to download the files. Let’s follow this approach with the detail steps explained as below:
Step 1 : Download the form.
Step 2: Check for XDP and XSD files.
F. Form Adjustments and New Connection Creation:
There are 2 ways to do form designing and adjustments:
Since ADLC way is more convenient, will use that way only for form adjustments.
Step 1 : Layout adjustments.
Step 2 : Review Existing Data Connection/ Create New Data Connection.
a) Create New Data Connection: Right click on “Data View” and click on “New Data Connection”. Assign name “ZHM_PO_TEST” and select “XML Schema” and click Next.
b) On the next page -> select the “ZZ1_HM_TEST_E” XSD file which we downloaded in the prior step (E : Step - 2) and then on next page click on “Embed XML Schema” option and finish.
The new connection will appear like this as below:
Save the form.
G. Data Bindings in form:
Once we have the data connection established in the form, it will have all the data fields in it, which we need to map to the respective fields as explained below:
Step 1 : Data Binding for Custom Fields
All standard fields will have the bindings automatically mapped. So, bindings will be added to additional fields “Bill to Address, Amount in words”.
For example : For Bill to Address, follow the below step to do the data binding.
So, finally we are done with all the steps – creation of form, creation of GW based interface and Data Bindings to the forms. Now, let’s test to check the output.
H. Testing the form:
Here, we will go with standard configuration process i.e OPD based (Output Parameter Determination Fiori App) and triggering the form from T-code – ME23N.
Step 1 : Assign Form Template Configuration.
Step 2 : Output Parameter Determination Configuration.
Step 3 : Testing the form using ME23N.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
8 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |