Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Read data from PDF to internal table

Former Member
0 Likes
6,707

Hi experts,

I have requirement,

I have PDF file, which i have to read into internal table.i there any possibility . can any one help me please <removed by moderator>.

thanks in advance

Edited by: Thomas Zloch on Oct 7, 2011 8:25 PM

Hi experts,

I have requirement,

I have PDF file, which i have to read into internal table.i there any possibility . can any one help me please <removed by moderator>.

thanks in advance

Edited by: Thomas Zloch on Oct 7, 2011 8:25 PM

6 REPLIES 6
Read only

Former Member
0 Likes
3,165

Hi,

You can use

DATA : l_pdf TYPE fpcontent,

pdftab TYPE solix_tab.

pdftab = cl_document_bcs=>xstring_to_solix( ip_xstring = l_pdf ).

You will get contents in pdftab.

Let me know if this works...

Regards,

Rahul

Read only

Former Member
0 Likes
3,165

hi Rahul,

But how to get the contents of PDF file into FP content

Regards

siva

Read only

Former Member
0 Likes
3,165

Hi,

If you get the data (xstring) in your context you can extract the data. An example of this can be found in the report FP_PDF_TEST_03.

Check the source of the report and you will see what you need to extract the data from the PDF.

Read only

koolspy_ultimate
Active Contributor
0 Likes
3,165

Hi,

try this


DATA: l_filename TYPE string,
        l_rawtab   TYPE STANDARD TABLE OF raw255,
        l_len      TYPE i.

  MOVE p_filename TO l_filename.
  CALL METHOD cl_gui_frontend_services=>gui_upload
    EXPORTING
      filename                = l_filename
      filetype                = 'BIN'
    IMPORTING
      filelength              = l_len
    CHANGING
      data_tab                = l_rawtab
    EXCEPTIONS
      file_open_error         = 1
      file_read_error         = 2
      no_batch                = 3
      gui_refuse_filetransfer = 4
      invalid_type            = 5
      no_authority            = 6
      unknown_error           = 7
      bad_data_format         = 8
      header_not_allowed      = 9
      separator_not_allowed   = 10
      header_too_long         = 11
      unknown_dp_error        = 12
      access_denied           = 13
      dp_out_of_memory        = 14
      disk_full               = 15
      dp_timeout              = 16
      not_supported_by_gui    = 17
      error_no_gui            = 18
      OTHERS                  = 19.
  IF sy-subrc IS NOT INITIAL.
    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 = l_len
    IMPORTING
      buffer       = p_content
    TABLES
      binary_tab   = l_rawtab
    EXCEPTIONS
      failed       = 1
      OTHERS       = 2.
  IF sy-subrc IS NOT INITIAL.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

Regards,

koolspy.

Read only

0 Likes
3,165

Hi,

Thanks for the efforts.But still its not okay. i couldnt do it. I heard some thing called ADS is needed for that. Has anybody have idea on that?

Regards

siva

Read only

0 Likes
3,165

hi,

ADS is a adobe service configuration . It is used for the adobe interactive and to be configured by the Basis.

regards,