Skip to Content
author's profile photo Former Member
Former Member

Reading a PDF file

Hello,

it's possible to open and extract information from a PDF file with an abap program?

thanks in advance,

Oscar

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2008 at 03:54 PM

    Hi,

    As per my knowledge, you can convert PDF to XML and then read the same into ABAP structure.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 21, 2008 at 04:02 PM

    Hi Oscar,

    Check out the below Program.

    REPORT ztest_otf_convert .
    
    
    The link between R/3 and the document content server 
    is in TABLE TOA01 
    
    PARAMETERS: obj_key LIKE toa01-object_id.
    
    START-OF-SELECTION.
    
    DATA: i_toa01 LIKE toa01.
    data: path type SAEPFAD.
    
    path = '\\someservername\somedirectoryname\somefilename.pdf'
    
    SELECT SINGLE * FROM toa01 INTO i_toa01 WHERE 
    ar_object = obj_key.
    
    IF sy-subrc = 0.
    
    CALL FUNCTION 'ARCHIVOBJECT_GET_DT_VIA_TABLE'
    EXPORTING
    archiv_id = i_toa01-archiv_id
    archiv_doc_id = i_toa01-archiv_doc_id
    doc_type = i_toa01-reserve
    dtpath = path
    convert = 'X'
    EXCEPTIONS
    error_application = 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.
    
    ENDIF.
    

    Thanks,

    Chidanand

    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.