Solution for Adobe Webdynpro Integration Issue
Requirement:
We had to integrate the Copy of Standard Adobe form with a Custom Webdynpro.
Issues Faced:
This error is due to long Node names.
Proposed Solution:
Creation of Adobe Form:
Go to Transaction SFP.
Enter the Name of Standard Adobe form – PTRV_EXPENSE_FORM.
Click on ‘COPY’ . Enter the New Form Name.
Assign a suitable Package and Transport Request. Here I have saved as a local Object.
The below message would be displayed after successfully copied.
Enter the Name of Standard Interface and Click on ‘COPY’.
Enter the New Interface Name.
Assign a suitable Package and Transport Request. Here I have saved as a local Object.
The below message would be displayed after successfully copied.
Enter the Interface Name and click on ‘Change’. Then click on activate and the interface is activated.
As the form is copied from Standard one, the interface attached to it would be a standard one.
So it is changed to the new interface created. Enter the Form Name and Click on ‘Change’.
The form is then activated.
Creation of Webdynpro Component:
Go to Transaction SE80.
Enter the webdynpro component name. Click on ‘YES’ to create.
Enter the Description. If required the Window Name can be changed.
Assign a suitable Package and Transport Request. Here I have saved as a local Object.
Go to MAIN View; create an interactive element – ADOBE_FORM under rootuielementcontainer.
In the properties of adobe_form, give the template source as form name – ZTEST_PTRV_EXPENSE_FORM.
We can see the below screen.
Click on ‘Yes’. The context is created.
When we do a syntax check, we get the below error:
This error is due to long Node names.
E.g. IT_FORM_ADDRESS_EMPLOYEE, IT_FORM_ADDRESS_EMPLOYER.
It is trying to create WDCIX_IT_FORM_ADDRESS_EMPLO in Component Controller for both IT_FORM_ADDRESS_EMPLOYEE, IT_FORM_ADDRESS_EMPLOYER.
So the above error is generated.
This error is resolved by removing one of the nodes IT_FORM_ADDRESS_EMPLOYEE/ IT_FORM_ADDRESS_EMPLOYER and creating it using Dynamic Node Creation.
Similarly, other nodes which give the above error are also removed and recreated using Dynamic Node.
The below nodes are created dynamically:
- I_FORM_HEADER_DATA_EMPLOYEE
- I_FORM_HEADER_DATA_EMPLOYEE
- IT_RECEIPTS_VS_MAX_AMT_TOTALS
- IT_RES_REC_VS_MAX_AMT_TLS
Here the required values for the adobe form are fetched using the standard function module – PTRA_WEB_EXPENSE_FORM_DATA_GET by passing the Personnel number, Trip Number, Number of Trip Period = 000, Sequential Number of Period = 00, Plan/Request/Expense Report (Indicator) = E, Sequential Version Number of Table PTRV_VERSION = 0000.
The output of the function module is mapped to corresponding nodes of the context to pass data to the adobe form.
Sample Code for Binding Output of Function Module to the Node:
** Passing Itinerary Details IT_ITINERARY:
* Navigate from <CONTEXT> to <IT_ITINERARY> via lead selection
lo_nd_tripdetails = wd_context->path_get_node( path = ‘ZTEST_PTRV_EXPENSE_F.IT_ITINERARY` ).
IF lo_nd_tripdetails IS BOUND.
* Bind the values
CALL METHOD lo_nd_tripdetails->bind_table
EXPORTING
new_items = lt_itinerary.
CLEAR: lo_nd_tripdetails, lo_el_tripdetails.
ENDIF.
Code for Dynamic Node Creation:
All the new nodes are created under the Sub node ‘ZTEST_PTRV_EXPENSE_F’.
**** Data Declaration for Dynamic Node Creation:
DATA: lr_root_info TYPE REF TO if_wd_context_node_info,
lr_child_node_info TYPE REF TO if_wd_context_node_info,
ld_nd_info_summarize TYPE REF TO if_wd_context_node_info,
ld_nd_info_hdr_emp TYPE REF TO if_wd_context_node_info.
*Get the Child Node:
lr_root_info = wd_context->get_node_info( ).
ld_nd_info_summarize = lr_root_info->get_child_node( name = ‘ZTEST_PTRV_EXPENSE_F’ ).
*Dynamic Node Generation for Nodes that has longer names in Adobe forms:
ld_nd_info_hdr_emp = ld_nd_info_summarize->add_new_child_node(
static_element_type = ‘PTRV_WEB_FORM_HEADER_EMPLOYEE’
name = ‘I_FORM_HEADER_DATA_EMPLOYEE’
is_mandatory = abap_true
is_mandatory_selection = abap_false
is_multiple = abap_false
is_multiple_selection = abap_false
is_singleton = abap_true
is_initialize_lead_selection = abap_true
is_static = abap_true ).
CLEAR: ld_nd_info_hdr_emp.
ld_nd_info_hdr_emp = ld_nd_info_summarize->add_new_child_node(
static_element_type = ‘PTRV_WEB_FORM_EDITOR_ADDRESS’
name = ‘IT_FORM_ADDRESS_EMPLOYEE’
is_mandatory = abap_false
is_mandatory_selection = abap_false
is_multiple = abap_true
is_multiple_selection = abap_true
is_singleton = abap_true
is_initialize_lead_selection = abap_true
is_static = abap_true ).
CLEAR: ld_nd_info_hdr_emp.
ld_nd_info_hdr_emp = ld_nd_info_summarize->add_new_child_node(
static_element_type = ‘PTRV_WEB_RECEIPTS_FORM_TLS’
name = ‘IT_RECEIPTS_VS_MAX_AMT_TOTALS’
is_mandatory = abap_false
is_mandatory_selection = abap_false
is_multiple = abap_true
is_multiple_selection = abap_true
is_singleton = abap_true
is_initialize_lead_selection = abap_true
is_static = abap_true ).
CLEAR: ld_nd_info_hdr_emp.
ld_nd_info_hdr_emp = ld_nd_info_summarize->add_new_child_node(
static_element_type = ‘PTRV_WEB_RES_RECS_MAX_AMT_TLS’
name = ‘IT_RES_REC_VS_MAX_AMT_TLS’
is_mandatory = abap_false
is_mandatory_selection = abap_false
is_multiple = abap_true
is_multiple_selection = abap_true
is_singleton = abap_true
is_initialize_lead_selection = abap_true
is_static = abap_true ).
CLEAR: ld_nd_info_hdr_emp.
All the four nodes are created dynamically.
The Webdynpro component is activated after completing the changes.
Webdynpro application is created for the webdynpro component with Personnel Number and Trip Number as parameters.
Personnel number and Trip Number are retrieved from the other webdynpro component where this Custom Webdynpro is called.
In the Component Controller, Trip_details node is created with two attributes PERNR & TRIP. The values of Personnel number and Trip Number are retrieved using get_parameter method in WDDOINIT Method and mapped to component controller context node Trip_details.
In the Main View, the Component Controller Context node Trip_details is mapped to pass the values of Personnel Number and Trip Number.
Advantages of New Solution:
1. No changes involved in Adobe form Interface for parameter names.
2. As no change in the parameter names in Interface, no Binding changes required in Adobe form Layout.
3. Testing Effort for Adobe form is considerably reduced.
Output:
When we execute the webdynpro application, the ZTEST_PTRV_EXPENSE_FORM is displayed.
Good and smart appraoch while facing integration issue with both Web DynPRo and Adobe forms.
Thanks for the Good Document!