Program For Adobe Form in Detail
Program For Adobe Form in Detail
Program FP_TEST_00
*----------------------------------------------------------------------*
PROGRAM fp_test_00.
INCLUDE fp_utilities.
DEFAULT 'DE',
DEFAULT 1.
OBLIGATORY.
DATA: fm_name
TYPE rs38l_fnam,
fp_docparams
TYPE sfpdocparams,
TYPE tsftext,
TYPE tline,
TYPE string,
line_nr
TYPE string,
result
TYPE sfpjoboutput,
l_spoolid
TYPE rspoid.
INITIALIZATION.
MOVE cl_fp=>get_ads_connection( ) TO p_conn.
START-OF-SELECTION.
* print data
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name
= p_form
IMPORTING
e_funcname = fm_name.
=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.
DO p_loop TIMES.
fp_docparams-langu = p_langu.
fp_docparams-country = p_countr.
CALL FUNCTION fm_name
EXPORTING
/1bcdwb/docparams = fp_docparams
textlines
= itf.
ENDDO.
= result
EXCEPTIONS
usage_error
=1
system_error = 2
internal_error = 3
OTHERS
= 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
PROGRAM fp_pdf_test_00.
* Get and display version information of the ADS.
* This program can be used for a simple connection test.
INCLUDE fp_utilities.
"#EC INCL_OK
INITIALIZATION.
p_dest = cl_fp=>get_ads_connection( ).
START-OF-SELECTION.
TRY.
*
Output result.
IF gv_version IS INITIAL.
MESSAGE 'Keine Versioninformationen verfgbar'(002) TYPE 'W'.
ELSE.
MESSAGE ID 'AD' TYPE 'I' NUMBER '010'
WITH 'Versionsinformationen:'(001) gv_version.
ENDIF.
ENDTRY.
*----------------------------------------------------------------------*
*
Report FP_TEST_03
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
PROGRAM fp_test_03.
INCLUDE fp_utilities.
"#EC INCL_OK
*--------------------------------------------------------------------------------*
* SELECTION SCREEN
*--------------------------------------------------------------------------------*
DEFAULT 'D',
p_ia
TYPE fpinteractive,
OBLIGATORY.
TYPE scustom,
TYPE ty_bookings,
connections
TYPE ty_connections,
fm_name
TYPE rs38l_fnam,
fp_docparams
TYPE sfpdocparams,
TYPE string.
*--------------------------------------------------------------------------------*
INITIALIZATION.
MOVE cl_fp=>get_ads_connection( ) TO p_conn.
*--------------------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'JPR'.
TRY.
IF cl_fp_feature_test=>is_available(
iv_connection = p_conn
iv_feature
= cl_fp_feature_test=>gc_job_profiles )
= abap_true.
CONTINUE.
ENDIF.
CATCH cx_fp_runtime_internal
cx_fp_runtime_system
cx_fp_runtime_usage.
"#EC NO_HANDLER
ENDTRY.
screen-active = 0.
MODIFY SCREEN.
CLEAR p_jobp.
ENDIF.
IF screen-group1 = 'NRM'.
TRY.
IF cl_fp_feature_test=>is_available(
iv_connection = p_conn
iv_feature
= cl_fp_feature_test=>gc_render_pdfa1 )
= abap_true.
CONTINUE.
ENDIF.
CATCH cx_fp_runtime_internal
cx_fp_runtime_system
cx_fp_runtime_usage.
ENDTRY.
screen-active = 0.
MODIFY SCREEN.
CLEAR p_norm.
"#EC NO_HANDLER
ENDIF.
ENDLOOP.
*--------------------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_jobp.
TRY.
IF cl_fp_feature_test=>is_available(
iv_connection = p_conn
iv_feature
= cl_fp_feature_test=>gc_job_profiles )
= abap_true.
*
= 'NAME'
= sy-cprog
= sy-dynnr
dynprofield = 'P_JOBP'
value_org = 'S'
TABLES
value_tab = gt_profiles.
ENDIF.
CATCH cx_fp_runtime_internal
cx_fp_runtime_system
cx_fp_runtime_usage.
"#EC NO_HANDLER
ENDTRY.
*--------------------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_conn.
*--------------------------------------------------------------------------------*
START-OF-SELECTION.
* Get data.
SELECT SINGLE * FROM scustom INTO customer WHERE id = p_custid.
IF customer IS INITIAL.
MESSAGE ID 'AD' TYPE 'E' NUMBER '718' WITH 'SCUSTOM'.
ENDIF.
SELECT * FROM sbook INTO TABLE bookings
WHERE customid = p_custid
AND carrid IN s_carrid
ORDER BY PRIMARY KEY.
IF bookings[] IS NOT INITIAL.
SELECT * FROM spfli INTO TABLE connections FOR ALL ENTRIES IN bookings
WHERE carrid = bookings-carrid
AND connid = bookings-connid
ORDER BY PRIMARY KEY.
ENDIF.
* Print data:
= p_form
IMPORTING
e_funcname = fm_name.
CATCH cx_fp_api_repository cx_fp_api_usage cx_fp_api_internal.
= abap_true.
fp_outputparams-connection = p_conn.
fp_outputparams-pdfnorm
= p_norm.
= cl_fp_feature_test=>gc_job_profiles )
= abap_true.
fp_outputparams-job_profile = p_jobp.
ENDIF.
CATCH cx_fp_runtime_internal
cx_fp_runtime_system
cx_fp_runtime_usage INTO gx_fpex.
PERFORM error USING gx_fpex.
ENDTRY.
ENDIF.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = fp_outputparams
EXCEPTIONS
cancel
=1
usage_error
=2
system_error
=3
internal_error = 4
OTHERS
= 5.
= p_langu.
fp_docparams-country = p_countr.
fp_docparams-fillable = p_ia.
= customer
bookings
= bookings
connections
**
**
= connections
IMPORTING
/1bcdwb/formoutput =
EXCEPTIONS
usage_error
=1
system_error
=2
internal_error
=3
OTHERS
= 4.
IMPORTING
**
e_result
EXCEPTIONS
usage_error
=1
system_error = 2
internal_error = 3
OTHERS
= 4.
Use
This class is called by inbound processing and cannot communicate with the front end.
The PDF form and the form data (in XML form) are passed to the methodHANDLE_PDF.
Dependencies
This class must implement the interface IF_FP_OFFLINE.