Code: Alles auswählen.
START-OF-SELECTION.
DATA: form TYPE tdsfname VALUE 'ZAF_ADOBE_FORM_2',
cntry TYPE c LENGTH 2,
lx_fp_api TYPE REF TO cx_fp_api,
fm_name TYPE c LENGTH 30,
fp_docparams TYPE sfpdocparams,
fp_outputparams TYPE sfpoutputparams.
fp_outputparams-preview = 'X'.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = fp_outputparams
EXCEPTIONS
CANCEL = 1
USAGE_ERROR = 2
SYSTEM_ERROR = 3
INTERNAL_ERROR = 4
OTHERS = 5
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
TRY.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = form
IMPORTING
E_FUNCNAME = fm_name.
CATCH cx_fp_api INTO lx_fp_api.
* MESSAGE ID lx_fp_api->msgid TYPE lx_fp_api->msgty
* NUMBER lx_fp_api->msgno
* WITH lx_fp_api->msgv1 lx_fp_api->msgv2
* lx_fp_api->msgv3 lx_fp_api->msgv4
EXIT.
ENDTRY.
fp_docparams-langu = sy-langu.
SELECT SINGLE laiso
FROM t002
INTO cntry
WHERE spras EQ sy-langu.
fp_docparams-country = cntry.
CALL FUNCTION fm_name
EXPORTING
/1bcdwb/docparams = fp_docparams
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3.
if sy-subrc <> 0.
endif.
CALL FUNCTION 'FP_JOB_CLOSE'
* IMPORTING
* E_RESULT =
EXCEPTIONS
USAGE_ERROR = 1
SYSTEM_ERROR = 2
INTERNAL_ERROR = 3
OTHERS = 4
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.