Step by step of PDF form programming in GUI
https://wiki.scn.sap.com/wiki/display/ABAP/Step+by+step+of+PDF+form+programming+in+GUI
PDF form is geting popular in ABAP programming. Especially for those forms will be combined in the SAP GUI together with webdynpros.
This article described the steps to creat a PDF form.
1. Install 'SAP Adobe LiveCycle Designer'
2. execute tcode 'SFP'
Here, you can create the interface and form for the PDF form, different with SMARTFORMS, PDF form defined a separated interface for the program call.
In the interface, like SMARTFORMS, you can design the input and output parmeters, global definitions and do initializations.
In the FORM, you should annance the interface to be used by the form. And then the parameters of the interface can be linked to the context of the form.
In the form layout designed, you can combine the output field with the parameters to show the word in the form as your needed.
3. program the driver program of the PDF form.
First, get all the data for the interface parameters.
Second, CALL FUNCTION 'FP_FUNCTION_MODULE_NAME' to get the function name of the PDF form
Third, CALL FUNCTION 'FP_JOB_OPEN' to open a PDF form output job.
Forth, call the PDF function name, parameters are refer to the interface parameters.
Fifth, CALL FUNCTION 'FP_JOB_CLOSE' to close the PDF output job.
Sample codes as:
Error rendering macro 'code': Invalid value specified for parameter 'lang'
* GET THE FUNCTION MUDULE NAME OF THE PDF FORM CALL FUNCTION 'FP_FUNCTION_MODULE_NAME' EXPORTING I_NAME = LF_FORMNAME IMPORTING E_FUNCNAME = LF_FM_NAME. IF SY-SUBRC <> 0. * error handling RETCODE = SY-SUBRC. IF SY-SUBRC = 1. MESSAGE E001(SSFCOMPOSER). ENDIF. IF SY-SUBRC = 2. MESSAGE E002(SSFCOMPOSER) WITH LF_FORMNAME. ENDIF. ENDIF. * set the job parameters LV_OUTPUPARAMS-DEST = NAST-LDEST. LV_OUTPUPARAMS-REQIMM = NAST-DIMME. LV_OUTPUPARAMS-REQDEL = NAST-DELET. CALL FUNCTION 'FP_JOB_OPEN' CHANGING IE_OUTPUTPARAMS = LV_OUTPUPARAMS EXCEPTIONS CANCEL = 1 USAGE_ERROR = 2 SYSTEM_ERROR = 3 INTERNAL_ERROR = 4 OTHERS = 5. IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. LV_DOCPARAMS-LANGU = SY-LANGU. LV_DOCPARAMS-COUNTRY = 'US'. LV_DOCPARAMS-FILLABLE = ''. CALL FUNCTION LF_FM_NAME EXPORTING /1BCDWB/DOCPARAMS = LV_DOCPARAMS ADDRESS = LS_HEADER ITEM_TABLE = LT_ITEM ITEM_FINAL = LT_ITEM_FINAL ITEM_PAYMENT = LT_PAYMENT IMPORTING /1BCDWB/FORMOUTPUT = LV_FPFORMOUTPUT EXCEPTIONS USAGE_ERROR = 1 SYSTEM_ERROR = 2 INTERNAL_ERROR = 3 OTHERS = 4. CALL FUNCTION 'FP_JOB_CLOSE' EXCEPTIONS USAGE_ERROR = 1 SYSTEM_ERROR = 2 INTERNAL_ERROR = 3 OTHERS = 4.
具体范例
https://wiki.scn.sap.com/wiki/display/ABAP/Call+Adobe+Form+through+ABAP+Program?original_fqdn=wiki.sdn.sap.com