It is a common requirement to provide multiple submit buttons on an interactive adobe form for different operations.
An adobe form can be integrated in ABAP and WebDynpro ABAP,WebDynpro Java applications.
It is very easy to achieve this requirement in ABAP.
When we want to integrate this adobe form in a webdynpro ABAP component, we need to use the InteractiveForm UI element. But handling the action of multiple submit buttons is tricky because the InteractiveForm UI element has only one event called “OnSubmit”. We have to handle the action of multiple buttons in this single event. To distinguish the action, we need to know the id or name of button on which action is taken which is tricky.

Requirement:

I am taking a simple requirement to accept input from the interactive adobe form which is integrated in a webdynpro application and to post that data into a Ztable. Here I have different operations like adding single/multiple record(s) into the table, updating single/multiple existing record(s) and deleting single/multiple record(s) from the table.

Adobeform

Note: Submit buttons (Create, Update, Delete) are created from WebDynproActiveX section.

Solution:
1. Create an attribute of type ‘char’ in the controller context node bonded with the data source of InteractiveForm UI element.

af

Ex: Button_name type char10.

2. Create a text field in the adobe form and make invisible. Bind the hidden field with ‘Button_name’ (additional attribute created earlier).

3. In the script editor for the buttons, write java script for storing button name in the hidden input field(before actual action, set the rawValue for hidden field(in the click event),before the standard code as shown in the below image).

af1

Do similar for the Update(rawValue -> ‘UPDATE’) and Delete(rawValue -> ‘DELETE’) buttons.

4. Create an event handler method in the view controller and assign to the OnSubmit event of InteractiveForm.

5. In the event handler method, maintain your logic to distinguish the action of buttons as shown below.
Read the context attribute Button_name.
Based on the value in the attribute ‘Button_name’, code your operations as shown in the image below.

af2

So, for achieving this requirement (having multiple submit buttons on the adobe form which is integrated in webdynpro application) there may be different ways but this is a better way to follow as explained above.

 

Need Help:

In case you need assistance on SAP Support Services, please contact us. Please send us your questions, comments or assistance request and our team would be glad to assist you.

By Sreedhar Babu (on behalf of SAP Consulting Team)


Apprisia
SAP :: Streamlined

We offer variety of services including SAP ECC ,SAP HR,SAP BW,SAP CRM, SAP SCM,SAP BPM, Business Objects, SAP ABAP DevelopmentSAP BASIS and SAP NetWeaver consulting. We have expertise in providing implementation,development, SAP Migration and SAP support services to SAP customers across diverse industries at a global level.

Have a question on SAP? Write to our SAP Architect : AskTheArchitect@Apprisia.com

(We promise a no-obligation consulting reply)