Step1:
Create an adobe form to which pdf have to be generated.
The preview of our adobe form:
Give the ID and Select TextView from dropdown.
Click on create icon of 'onAction' property and give the name and description for action method.
METHOD onactionon_link_click .
DATA: lv_fmname TYPE fpname.
DATA: fp_docparams TYPE sfpdocparams.
DATA: fp_formoutput TYPE fpformoutput.
DATA : function TYPE funcname,
ftype TYPE fpinterfacetype,
fname TYPE funcname.
DATA : outputparams TYPE sfpoutputparams.
DATA: filename TYPE string,
path TYPE string,
fullpath TYPE string,
default_extension TYPE string VALUE 'PDF'.
**--OPEN JOB FOR ADOBE
outputparams-nodialog = 'X'.
outputparams-preview = 'X'.
outputparams-dest = 'LP01'.
outputparams-getpdf = 'X'.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = outputparams
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.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = 'ZADOBE_TEST'
IMPORTING
e_funcname = lv_fmname.
fp_docparams-langu = 'E'.
fp_docparams-country = 'IN'.
fp_docparams-fillable = 'X'.
fp_docparams-dynamic = 'X'.
CALL FUNCTION '/1BCDWB/SM00000135'
EXPORTING
/1BCDWB/DOCPARAMS = fp_docparams
IMPORTING
/1BCDWB/FORMOUTPUT = fp_formoutput
EXCEPTIONS
USAGE_ERROR = 1
SYSTEM_ERROR = 2
INTERNAL_ERROR = 3
OTHERS = 4
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
CALL FUNCTION 'FP_JOB_CLOSE' .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
cl_wd_runtime_services=>attach_file_to_response( i_filename = 'Adobeformgen.pdf'
i_content = fp_formoutput-pdf
i_mime_type = 'application/pdf' ).
ENDMETHOD.
Step 6:
Click on the hyperlink.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
4 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 |