VinceCoder
5/16/2019 - 2:20 PM

ADOBE FORMS: Uso nei report

  • Chiamata Adobe Form in report
  • Gestione errori

Guida creazione adobe form : https://wiki.scn.sap.com/wiki/display/ABAP/Adobe+Forms+from+Scratch

Integration into ABAP Programs.

 The 5 basic steps involved are -

 1.Data retrieval in the report programme.
 2.Call Function 'FP_FUNCTION _MODULE_NAME( to get the  generated
    function module name).
 3.Call Function 'FP_JOB_OPEN '.
 4.Call Function <generated function module name>.
 5.Call Function 'FP_JOB_CLOSE'.

 If you need to have copies of the same form to be generated, you may call
 the function module by using (do ('n' times) - enddo) loops.

 There are standard test forms for training provided by SAP. Search "FP*"
 in the SFP transaction.

Demo of Print Program for executing PDF Forms.

DATA: CUSTOMER          TYPE SCUSTOM,
      BOOKINGS          TYPE TY_BOOKINGS,
      CONNECTIONS       TYPE TY_CONNECTIONS,
      FM_NAME           TYPE RS38L_FNAM,
      FP_DOCPARAMS      TYPE SFPDOCPARAMS,
      FP_OUTPUTPARAMS   TYPE SFPOUTPUTPARAMS.
 
 
* GETTING THE DATA
  <data selection>
 
 
* PRINT:
 
* Sets the output parameters and opens the spool job
    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.
  <error handling>
    ENDIF.
 
* Get the name of the generated function module
   CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
    EXPORTING
    I_NAME                     = '<form name>'
    IMPORTING
    E_FUNCNAME                 = FM_NAME.
   IF SY-SUBRC <> 0.
  <error handling>
   ENDIF.
 
* Call the generated function module
   CALL FUNCTION FM_NAME
     EXPORTING
     /1BCDWB/DOCPARAMS        = FP_DOCPARAMS
     CUSTOMER                 = CUSTOMER
     BOOKINGS                 = BOOKINGS
     CONNECTIONS              = CONNECTIONS
*   IMPORTING
*     /1BCDWB/FORMOUTPUT       =
    EXCEPTIONS
      USAGE_ERROR           = 1
      SYSTEM_ERROR          = 2
      INTERNAL_ERROR           = 3.
   IF SY-SUBRC <> 0.
  <error handling>
   ENDIF.
 
* Close the spool job
  CALL FUNCTION 'FP_JOB_CLOSE'
*   IMPORTING
*    E_RESULT             =
    EXCEPTIONS
      USAGE_ERROR           = 1
      SYSTEM_ERROR          = 2
      INTERNAL_ERROR        = 3
      OTHERS                = 4.
  IF SY-SUBRC <> 0.
  <error handling>
  ENDIF.

Troubleshooting 
 Features
  You are provided with various function modules for troubleshooting purposes.
  You can use these function modules to extract the following information:
  Texts about the cause of the error (with the FP_GET_LAST_ADS_ERRSTR FM)
  A trace of the Adobe document services (with the FP_GET_LAST_ADS_TRACE FM)