*======================================================================* * Selection Screen *======================================================================* PARAMETERS: P_VALUE TYPE CHAR40, P_FLAG TYPE CHAR1.
**&&~~ Data Objects DATA: GV_FM_NAME TYPE RS38L_FNAM, " FM Name GS_FP_DOCPARAMS TYPE SFPDOCPARAMS, GS_FP_OUTPUTPARAMS TYPE SFPOUTPUTPARAMS.
CONSTANTS : GV_FORM_NAME TYPE FPNAME VALUE 'YADOBE_FORM_DEMO4'.
*======================================================================* * START of Calling the Form *======================================================================* *&---------------------------------------------------------------------* **&&~~ 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 EXPORTING /1BCDWB/DOCPARAMS = GS_FP_DOCPARAMS IV_VALUE = P_VALUE IV_FLAG = P_FLAG EXCEPTIONS USAGE_ERROR = 1 SYSTEM_ERROR = 2 INTERNAL_ERROR = 3 OTHERS = 4. 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.