Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
1K views

Adding Rows Dynamically in A Table Using Interactive Adobe Forms

This document discusses how to dynamically add rows to a table in an interactive Adobe Form using an offline scenario in SAP. It involves 7 steps: 1) Creating an interface and import parameter, 2) Creating a form and linking the parameter, 3) Adding the table and button to the form layout, 4) Setting the minimum row count to 3, 5) Writing a script to add new rows on button click, 6) Calling the form function module, 7) Closing the job. The key is passing 'X' to the DYNAMIC parameter to enable dynamic rows.

Uploaded by

bharath_sajja
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Adding Rows Dynamically in A Table Using Interactive Adobe Forms

This document discusses how to dynamically add rows to a table in an interactive Adobe Form using an offline scenario in SAP. It involves 7 steps: 1) Creating an interface and import parameter, 2) Creating a form and linking the parameter, 3) Adding the table and button to the form layout, 4) Setting the minimum row count to 3, 5) Writing a script to add new rows on button click, 6) Calling the form function module, 7) Closing the job. The key is passing 'X' to the DYNAMIC parameter to enable dynamic rows.

Uploaded by

bharath_sajja
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Adding rows dynamically in a table using interactive Adobe Forms

By Phani Diwakar M, YASH Technologies

The requirement is to add the table rows dynamically in the table. This document is dealt with how to create dynamic table in interactive form using offline scenario. Step1: Go to SFP transaction and provide interface name.

Click on Create button and provide the meaningful description for the interface. Step2: Now create import parameter ZMAT as shown below.

Save and activate the interface. Step3: Now again go to transaction SFP to create form. Provide the form name.

Click on Create button. A popup will appear where provide the interface name and meaningful description of the form.

Step4: Now drag the import parameter ZMAT to context as shown.

Step5: Now go to layout. Drag the table ZMAT to body page. Drag the button from library on to body page below the table as shown.

Step6: Now go to Hierarchy tab, Go to OBJECT palette of DATA and provide the min count is 3 (when we execute the form initially it shows 3 default rows) as shown below.

Step7: Now click on Insert Button.

In the script editor, write the following code which generates the rows dynamically at run time.

In script editor: var anInstanceManager = data.Bodypage.ZMAT.DATA.instanceManager; var newInstance = anInstanceManager.addInstance(1); var aToIndex = data.Bodypage.ZMAT.DATA.index + 3; (Adds the rows from 4th postion) var aFromIndex = newInstance.index; anInstanceManager.moveInstance(aFromIndex, aToIndex); Save and activate the form. Adding rows dynamically in a table using interactive Adobe Forms
...Previous

REPORT ZOFFLINE_MAT_01. data: fs_venbank type zwd_mat, it_mat type zwd_t_mat, l_fm_name TYPE rs38l_fnam, l_formname TYPE fpname VALUE 'ZOFFLINE_MAT_FORM', fp_docparams TYPE sfpdocparams, FP_FORMOUTPUT TYPE FPFORMOUTPUT, fp_outputparams TYPE sfpoutputparams. START-OF-SELECTION. PERFORM get_function_module. *&---------------------------------------------------------------------* *& Form GET_FUNCTION_MODULE *&---------------------------------------------------------------------* form GET_FUNCTION_MODULE . CALL FUNCTION 'FP_FUNCTION_MODULE_NAME' EXPORTING i_name = l_formname IMPORTING e_funcname = l_fm_name. * E_INTERFACE_TYPE =

* fp_outputparams-nodialog = 'X'. * fp_outputparams-getpdf = 'X'. CALL FUNCTION 'FP_JOB_OPEN' CHANGING ie_outputparams = fp_outputparams EXCEPTIONS cancel =1 usage_error = 2 system_error = 3 internal_error = 4 OTHERS = 5. IF sy-subrc <> 0. CASE sy-subrc. WHEN OTHERS. ENDCASE. " CASE sy-subrc ENDIF. fp_docparams-langu = 'X'. fp_docparams-country = 'US'. fp_docparams-fillable = 'X'. fp_docparams-dynamic = 'X'. CALL FUNCTION l_fm_name EXPORTING /1bcdwb/docparams = fp_docparams zmat = it_mat IMPORTING /1BCDWB/FORMOUTPUT = FP_FORMOUTPUT EXCEPTIONS usage_error =1 system_error =2 internal_error = 3 OTHERS = 4. IF sy-subrc <> 0. CASE sy-subrc. WHEN OTHERS. ENDCASE. ENDIF.

" CASE sy-subrc " IF sy-subrc <> 0

CALL FUNCTION 'FP_JOB_CLOSE' * IMPORTING * E_RESULT = result EXCEPTIONS usage_error =1 system_error =2 internal_error =3 OTHERS =4 . IF sy-subrc <> 0. CASE sy-subrc. WHEN OTHERS. ENDCASE. " CASE sy-subrc ENDIF. " IF sy-subrc <> 0. endform. " GET_FUNCTION_MODULE

Note: To add the rows dynamically in the form, we have to pass the value X to parameterDYNAMIC of the structure /1BCDWB/DOCPARAMS. Output: execute the program

Now when you click on button Insert, a new row will be added after 3 rows.

You might also like