Skip to Content

Display pdf in modal pop up window in Webdynpro

Hello Experts,

I have a requirement to display PDF/Transactions in a modal pop up window.

The PDF is generated using FM PTRM_WEB_FORM_PDF_GET.

Below is the code inside my click_button method.

Data: lwa_pdf_form        TYPE fpcontent,
      l_mimetype          TYPE string VALUE 'application/pdf',
      lt_return           TYPE bapirettab,
      l_filename          TYPE string VALUE  'title.pdf'.

CALL FUNCTION 'PTRM_WEB_FORM_PDF_GET'
      EXPORTING
        i_employeenumber = '00005001'
        i_tripnumber     = '0100000332'
*       I_PERIODNUMBER   = '000'
*       IV_VERSION_TRIP_COMPONENT       =
*       IV_VERSION_NUMBER               =
*       I_TRIP_COMPONENT = ' '
*       I_TRIP_DATA_SOURCE              = 'DB'
*       I_DISPLAY_FORM   = ' '
        i_language       = sy-langu
      IMPORTING
        e_pdf_form       = lwa_pdf_form
      TABLES
        et_return        = lt_return.

CALL METHOD cl_wd_runtime_services=>attach_file_to_response
        EXPORTING
          i_filename      = l_filename
          i_content       = lwa_pdf_form  "lv_buffer
          i_mime_type     = l_mimetype
          i_in_new_window = 'X'
          i_inplace       = 'X'.

Then called pop up window from my component controller.

      IF wd_comp_controller->w_popup IS INITIAL.
        wd_comp_controller->w_popup = lref_window_manager->create_window(
*                                  modal                = ABAP_TRUE
                                          window_name          = 'W_POPUP'
*                                  title                =
*                                  close_button         = ABAP_TRUE
                                  button_kind          = if_wd_window=>co_buttons_yesno
*                                  message_type         =
*                                  close_in_any_case    = ABAP_TRUE
*                                  message_display_mode =
*                                  default_button       =
*                                  is_resizable         = ABAP_TRUE
                                      ).
      ENDIF.


      wd_comp_controller->w_popup->open( ).

But no success )-:

Is not it possible to display PDF in current component with controls like scroll and close the window ?

Same modal window will be used for displaying call transaction screens like shopping cart, ME23N etc.

Thanks in advance,

Manoj

Add comment
10|10000 characters needed characters exceeded

  • Hello Experts,

    Still awaiting Expert comments. please help me on this.

    Also have a requirement to call transaction ME23N from my Web dynpro apllication.

    Taken help from below thread.

    https://archive.sap.com/discussions/thread/3599140

    but its not opening. If i am copying the generated URL and pasting it in browser, Tcode is opening.

    CONCATENATE lv_protocol  '://' lv_host  ':' lv_port
                    '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=' 'ME23N' INTO ex_url.

    How to open a specific purchase order number instead of default last used document.

    Thanks in advance,

    Manoj

  • If you have follow-up questions please post them separately.

    What you have not explained is what you have tried and what results you got. Your question lacks specifics - it's almost just a specification. .

  • Get RSS Feed

0 Answers