[ABAP] Adobe Forms Formular aufrufen und als xstring weiterverarbeiten

* https://www.berater-wiki.de/Aufruf_des_Adobe_Formulars_im_Rahmenprogramm
* https://wiki.scn.sap.com/wiki/display/ABAP/Adobe+Forms+from+Scratch
* Formularname
DATA(lv_form) = CONV fpname( 'ZADOBE_FORM_NAME' ).
* Name generierter Funktionsbaustein
DATA: lv_funcname TYPE funcname.
DATA: lv_interface_type TYPE fpinterfacetype.

* Namen des Funktionsbausteins für ein Formular bestimmen
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
  EXPORTING
    i_name           = lv_form
  IMPORTING
    e_funcname       = lv_funcname
    e_interface_type = lv_interface_type.

IF sy-subrc = 0.

  DATA: lv_outputparams TYPE sfpoutputparams.

* Formularprozessierung: Job beginnen
  CALL FUNCTION 'FP_JOB_OPEN'
    CHANGING
      ie_outputparams = lv_outputparams
    EXCEPTIONS
      cancel          = 1
      usage_error     = 2
      system_error    = 3
      internal_error  = 4
      OTHERS          = 5.

  IF sy-subrc = 0.

    DATA(lv_docparams) = VALUE sfpdocparams( langu = 'D' country  = 'DE' ).
    DATA: lv_formout TYPE fpformoutput.

    CALL FUNCTION lv_funcname
      EXPORTING
        /1bcdwb/docparams  = lv_docparams
* ggf. spez. Parameter für Funktionsaufruf hier aufführen
* siehe Transaktion SFP (Form Builder)
      IMPORTING
        /1bcdwb/formoutput = lv_formout
      EXCEPTIONS
        usage_error        = 1
        system_error       = 2
        internal_error     = 3
        OTHERS             = 4.

    IF sy-subrc = 0.
* xstring mit PDF-Daten
      DATA(lv_pdf_raw) = lv_formout-pdf.
    ENDIF.

    DATA: lv_result TYPE sfpjoboutput.

* Formularprozessierung: Job beenden
    CALL FUNCTION 'FP_JOB_CLOSE'
      IMPORTING
        e_result       = lv_result
      EXCEPTIONS
        usage_error    = 1
        system_error   = 2
        internal_error = 3
        OTHERS         = 4.

    IF sy-subrc = 0.

    ENDIF.
  ENDIF.
ENDIF.