cancel
Showing results for 
Search instead for 
Did you mean: 

Getting a Print Preview of Adobe Forms through a Webdynpro Application

0 Kudos
  WA_DOCPARAMS-LANGU   = 'E'.
  WA_DOCPARAMS-COUNTRY = 'US'.
  WA_OUTPUTPARAMS-NODIALOG = 'X'.
  WA_OUTPUTPARAMS-GETPDF = 'X'.
*
  CALL FUNCTION 'FP_JOB_OPEN'
    CHANGING
      IE_OUTPUTPARAMS = WA_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     = 'ZHF_EMPLOYEE_SERVICE_BOOK'
    IMPORTING
      E_FUNCNAME = GV_FM_NAME.
  IF SY-SUBRC <> 0.
    "<error handling>
  ENDIF.

  CALL FUNCTION GV_FM_NAME
    EXPORTING
      IT_PERNR       = LT_P0001
    EXCEPTIONS
      USAGE_ERROR    = 1
      SYSTEM_ERROR   = 2
      INTERNAL_ERROR = 3.

*   Close the spool job
  CALL FUNCTION 'FP_JOB_CLOSE'
    EXCEPTIONS
      USAGE_ERROR    = 1
      SYSTEM_ERROR   = 2
      INTERNAL_ERROR = 3
      OTHERS         = 4.
  IF SY-SUBRC <> 0.
    " <error handling>
  ENDIF.

  CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE( I_FILENAME  = 'SAP_ADOBE_FORM.pdf'
    I_CONTENT   = FORMOUTPUT-PDF
    I_MIME_TYPE = 'application/pdf' ).

Hi,

I am trying to get a print preview of an Adobe form using the code above. I have written the code in the `ONACTIONSEARCH` method in WebDynpro. My business requirement is as below;

1) The user should see a select-option for selecting the PERNR;

2) After entering the PERNR, the user will click on the "Get Details" button for which the attached code has been written;

3) After clicking on the button, the user should see a PDF output file based on the PERNRs entered in step 1.

I have done till step 2 but I am not able to figure out how to call the form or at least view it.

I have used this method to call an Adobe Form in a report program but I am unaware of how to do that in WebDynpro.

Accepted Solutions (0)

Answers (0)