*======================================================================* * Selection Screen *======================================================================* PARAMETERS : P_ATYPE TYPE CHAR1, "Address Type P_ADRNR TYPE AD_ADDRNUM, "Address Number P_PERNR TYPE AD_PERSNUM, "Personnel Number P_LAND1 TYPE LAND1. "Country
*======================================================================* * Data Objects *======================================================================*
DATA: GV_FM_NAME TYPE RS38L_FNAM, " FM Name GS_FP_DOCPARAMS TYPE SFPDOCPARAMS, GS_FP_OUTPUTPARAMS TYPE SFPOUTPUTPARAMS.
*======================================================================* * Constants *======================================================================* CONSTANTS : GV_FORM_NAME TYPE FPNAME VALUE 'YADOBE_FORM_DEMO6'.
*======================================================================* * 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 executing 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/SM00000204' EXPORTING /1BCDWB/DOCPARAMS = GS_FP_DOCPARAMS IV_ADDRESS_TYPE = P_atype IV_ADDRNUMBER = P_ADRNR IV_PERSNUMBER = P_PERNR IV_LAND1 = P_LAND1 * IMPORTING * /1BCDWB/FORMOUTPUT = EXCEPTIONS USAGE_ERROR = 1 SYSTEM_ERROR = 2 INTERNAL_ERROR = 3 OTHERS = 4. IF SY-SUBRC <> 0. * Implement suitable error handling here ENDIF.