**&&~~ Data Objects DATA: GV_FM_NAME TYPE RS38L_FNAM, " FM Name GS_FP_DOCPARAMS TYPE SFPDOCPARAMS, GS_FP_OUTPUTPARAMS TYPE SFPOUTPUTPARAMS, GT_KNA1 TYPE STANDARD TABLE OF KNA1.
* Selection Screen PARAMETERS: P_VALUE TYPE CHAR40. PARAMETERS: P_VALUE1 TYPE CHAR40.
"Your Adobe Form Name CONSTANTS : GV_FORM_NAME TYPE FPNAME VALUE 'YADOBE_FORM_DEMO3'.
*======================================================================* * START of TREATMENT * *======================================================================* START-OF-SELECTION. *&---------------------------------------------------------------------* **&&~~ Form Processing: Call Form - Open * CALL FUNCTION 'FP_JOB_OPEN' CHANGING IE_OUTPUTPARAMS = GS_FP_OUTPUTPARAMS EXCEPTIONS CANCEL = 1 USAGE_ERROR = 2 SYSTEM_ERROR = 3 INTERNAL_ERROR = 4 OTHERS = 5. IF SY-SUBRC <> 0. " Suitable Error Handling ENDIF. *&---------------------------------------------------------------------* **&&~~ Get the Function module name based on Form Name * CALL FUNCTION 'FP_FUNCTION_MODULE_NAME' EXPORTING I_NAME = GV_FORM_NAME IMPORTING E_FUNCNAME = GV_FM_NAME. IF SY-SUBRC <> 0. " Suitable Error Handling ENDIF. *&---------------------------------------------------------------------* **&&~~ Take the FM name by execuing the form - by using Pattern- **&&~~ call that FM and replace the FM Name by gv_fm_name * **&&~~ Call the Generated FM CALL FUNCTION GV_FM_NAME "'/1BCDWB/SM00000176' EXPORTING /1BCDWB/DOCPARAMS = GS_FP_DOCPARAMS VALUE1 = P_VALUE1 VALUE = P_VALUE EXCEPTIONS USAGE_ERROR = 1 SYSTEM_ERROR = 2 INTERNAL_ERROR = 3 OTHERS = 4. IF SY-SUBRC <> 0. * Implement suitable error handling here ENDIF. *&---------------------------------------------------------------------* **&&~~ Form Processing: Call Form - Open * CALL FUNCTION 'FP_JOB_CLOSE'. IF SY-SUBRC <> 0. * Implement suitable error handling here ENDIF. *&---------------------------------------------------------------------* *&---- Close the spool job CALL FUNCTION 'FP_JOB_CLOSE' EXCEPTIONS USAGE_ERROR = 1 SYSTEM_ERROR = 2 INTERNAL_ERROR = 3 OTHERS = 4. IF SY-SUBRC <> 0. * <error handling> ENDIF. *&---------------------------------------------------------------------*