Checking Available PDF/A Formats

Before you select a PDF/A format, you must check whether the installed ADS version supports the respective functionality.

Context

To check the availability of the PDF/A output function in your ADS version, you can use the ABAP class CL_FP_FEATURE_TEST.

You need two different attributes to do this, regardless of the PDF/A format you want to check:

  • gc_render_pdfa: Only checks the availability of the format PDF/A-1 (supported as of ADS Release SAP NetWeaver AS for Java 7.20).
  • gc_pdfa_ext: Checks the availability of the formats PDF/A-1b, PDF/A-2b, PDF/A-3b (supported as of ADS Release SAP NetWeaver AS for Java 7.5 SP05).

For more information, see the SDN blog https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14106Information published on SAP site.

Procedure

  1. Call the test for the format PDF/A-1 before the function module FP_JOB_OPEN is called, as follows:

    TRY.
          IF cl_fp_feature_test=>is_available(
               iv_feature = cl_fp_feature_test=>gc_render_pdfa1 )
               = abap_true.
               *   PDF/A-1 can be generated
          ELSE.
               *   PDF/A-1 can not be generated
          ENDIF.
          CATCH cx_fp_runtime.
               * Add error handling
        ENDTRY.           

    or:

  2. Use the following test for PDF/A-1b, PDF/A-2b, and PDF/A-3b:

    TRY.
          IF cl_fp_feature_test=>is_available(
               iv_connection = p_conn
               iv_feature    = cl_fp_feature_test=>gc_pdfa_ext )
               = abap_true.
               *   PDF/A-1b, 2b, 3b can be generated
    	 ELSE.
               *   PDF/A-1b, 2b, 3b can not be generated
    	 ENDIF.
    	 CATCH cx_fp_runtime.
    	      * Add error handling
        ENDTRY.