Skip to Content

How to open PDF doc on LinkToAction event

Hello,

I have a linktoaction UI element. I want to open a PDF file which is in my mime folder when I click it.

Please help...

Regards,

Sridhar Karra.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Nov 27, 2007 at 04:54 PM

    Look at the below thread, it will answer your question:

    open-pdf-document-in-webdynpro

    Raja T

    Add a comment
    10|10000 characters needed characters exceeded

    • Thxs for your help.... Raja

      But here the code that will help you open PDF files....

      DATA : lv_object_id(40) TYPE c VALUE 'DCA24C262A1F82F18331005056AA0110'.

      " This is the logical ID for the PDF uploaded in the Mime folder of your WDA

      DATA : lv_io TYPE skwf_io.

      DATA : lit_data TYPE sdokcntbins.

      DATA : lv_lang TYPE sy-langu VALUE 'E'.

      DATA lv_filesize TYPE i.

      DATA lv_buffer TYPE mime_data.

      lv_io-objtype = 'L'.

      lv_io-class = 'M_APP_L'.

      lv_io-objid = lv_object_id.

      CALL METHOD cl_wb_mime_repository=>load_mime

      EXPORTING

      io = lv_io

      • check_authority = ' '

      IMPORTING

      • docname =

      • description =

      • filename =

      filesize = lv_filesize

      bin_data = lit_data

      • mimetype =

      CHANGING

      language = lv_lang

      EXCEPTIONS

      no_io = 1

      illegal_io_type = 2

      not_found = 3

      error_occured = 4

      OTHERS = 5

      .

      IF sy-subrc <> 0.

      • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

      CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'

      EXPORTING

      input_length = lv_filesize

      • FIRST_LINE = 0

      • LAST_LINE = 0

      IMPORTING

      buffer = lv_buffer

      TABLES

      binary_tab = lit_data

      • EXCEPTIONS

      • FAILED = 1

      • OTHERS = 2

      .

      IF sy-subrc <> 0.

      • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

      cl_wd_runtime_services=>attach_file_to_response(

      EXPORTING

      i_filename = 'WebHelp.pdf'

      i_content = lv_buffer

      i_mime_type = 'application/pdf'

      i_in_new_window = abap_true

      ).

  • Posted on Dec 04, 2007 at 10:17 AM

    Solved by self and with help from raja..

    Regards

    Sridhar Karra.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.