Extract data from PDF to SAP

Hi all,
   I have created an Offline form in sfp Transaction and emailed successfully .
     And now that Receiver has sent me the form with the filled pdf form to my outlook id ( bcas my mail id is being configured in SMTP) .
   Now I want to Update a table with that filled values in the received pdf..
1) What r all the steps should i follow now?
2) What for guided procedures or workflow?
3) Do i have the option to receive the mail to my Business       workplace inbox instead my personal mail id?
i went thru all the related threads in this topic. But could not get the Idea..
If someone knows please suggest me ..
Thank you.
Rgrds.
Edited by: Deepa K on Feb 25, 2008 1:30 PM

Hi,
When you create an abap object based on standard interface IF_INBOUND_EXIT_BCS you will got 2 method .
First here is the attributes i define in my object , all are Private instance attributes.
XML_DOCUMENT type ref to IF_IXML_DOCUMENT.
CONVERTER type ref to CL_ABAP_CONV_IN_CE,
ATTACHEMENT_ATTRIBUTES type BCSS_DBPA,
ATTACHEMENT_FILE type BCSS_DBPC ,
BINARY_FILE Type XSTRING,
FORMXML      Type STRING,
PDF_FORM_DATA Type XSTRING ,
XML_NODE Type Ref To IF_IXML_NODE,
XML_NODE_VALUE Type STRING.
Set this code in method CREATE_INSTANCE
* Check if the singleton instance has already
* been created.
IF instance is INITIAL.
  CREATE OBJECT instance.
ENDIF.
* Return the iTE nstance.
ro_ref = instance.
The other method is where the mail will be process
here is a sample code for method PROCESS_INBOUND
* Data definition :
  DATA : pdf_line    TYPE solix  .
  DATA : nb_att(10) TYPE n.
  DATA w_part TYPE int4 .
  FIELD-SYMBOLS : <pdf_line> TYPE solix.
** Set return code so no other Inbound Exit will be done.
  e_retcode = if_inbound_exit_bcs=>gc_terminate.
  TRY .
* Get the email document that was sent.
      mail = io_sreq->get_document( ).
* Get number of attachement in the mail
* If number is lower than 2 that means no attachement to the mail
      nb_att = mail->get_body_part_count( ) - 1.
      CHECK nb_att GT 0.
      CLEAR w_part.
* Process each document
      DO nb_att TIMES.
        w_part  = sy-index + 1 .
        CLEAR xml_document .
* Get attachement attributes
        attachement_attributes =
           mail->get_body_part_attributes( im_part = w_part ).
        IF attachement_attributes-doc_type IS INITIAL.
          DATA w_pos TYPE i .
          FIND '.' IN attachement_attributes-filename
            IN CHARACTER MODE MATCH OFFSET w_pos.
          ADD 1 TO w_pos.
          attachement_attributes-doc_type =
             attachement_attributes-filename+w_pos.
        ENDIF.
* Get the attachement
        attachement_file = mail->get_body_part_content( w_part ).
* If attachement is not a binary one ,
* transform it to binary.
        IF attachement_attributes-binary IS INITIAL.
          CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'
            EXPORTING
              ip_solitab  = attachement_file-cont_text
            IMPORTING
              ep_solixtab = attachement_file-cont_hex.
        ENDIF.
* Convert the attachement file into an xstring.
        CLEAR binary_file.
        LOOP AT attachement_file-cont_hex ASSIGNING <pdf_line>.
          CONCATENATE binary_file <pdf_line>-line
             INTO binary_file IN BYTE MODE.
        ENDLOOP.
        TRANSLATE attachement_attributes-doc_type TO UPPER CASE.
* Process the file depending on file extension
* Only XML and PDF file is allow
        CASE attachement_attributes-doc_type  .
          WHEN 'PDF'.
* Process an interactive form
            me->process_pdf_file( ).
          WHEN 'XML'.
* Process XML data
            me->process_xml_file( input_xstring = binary_file ).
          WHEN OTHERS.
* Nothing to do , process next attachement
        ENDCASE.
    CATCH zcx_pucl003 .
  ENDTRY.
As you can see i add several specific method to my object in order to make the code more clear.
Here is the code for all the specifics methods
PROCESS_PDF_FILE
  TRY.
* Extract the Data of the PDF as a XSTRING stream
      me->process_form( pdf = binary_file ).
      me->process_xml_file( input_xstring = pdf_form_data ).
    CATCH zcx_pucl003 INTO v_exception.
      RAISE EXCEPTION v_exception.
  ENDTRY.
PROCESS_FORM with inbound parameter PDF type XSTRING
  DATA :
     l_fp          TYPE REF TO if_fp ,
     l_pdfobj      TYPE REF TO if_fp_pdf_object .
TRY.
* Get a reference to the form processing class.
      l_fp = cl_fp=>get_reference( ).
* Get a reference to the PDF Object class.
      l_pdfobj = l_fp->create_pdf_object( ).
* Set the pdf in the PDF Object.
      l_pdfobj->set_document( pdfdata = pdf ).
* Set the PDF Object to extract data the Form data.
      l_pdfobj->set_extractdata( ).
* Execute call to ADS
      l_pdfobj->execute( ).
* Get the PDF Form data.
      l_pdfobj->get_data( IMPORTING formdata = pdf_form_data ).
    CATCH cx_fp_runtime_internal
          cx_fp_runtime_system
          cx_fp_runtime_usage.
  ENDTRY.
PROCESS_XML_FILE with inbound parameter INPUT_XSTRING type XSTRING.
  TRY.
      me->create_xml_document( input_xstring = input_xstring ).
      me->process_xml( ).
    CATCH ZCX_PUCL003 INTO v_exception.
      RAISE EXCEPTION v_exception.
  ENDTRY.
CREATE_XML_DOCUMENT with inbound parameter INPUT_XSTRING type XSTRING.
  DATA :
     l_ixml        TYPE REF TO if_ixml,
     streamfactory TYPE REF TO if_ixml_stream_factory ,
     istream       TYPE REF TO if_ixml_istream,
     parser        TYPE REF TO if_ixml_parser.
  DATA: parseerror TYPE REF TO if_ixml_parse_error,
        str        TYPE string,
        i          TYPE i,
        count      TYPE i,
        index      TYPE i.
DATA :
* Convert the xstring form data to string so it can be
* processed using the iXML classes.
  TRY.
      converter = cl_abap_conv_in_ce=>create( input = input_xstring ).
      converter->read( IMPORTING data = formxml ).
* Get a reference to iXML object.
      l_ixml = cl_ixml=>create( ).
* Get iStream object from StreamFactory
      streamfactory = l_ixml->create_stream_factory( ).
      istream = streamfactory->create_istream_string( formxml ).
* Create an XML Document class that will be used to process the XML
      xml_document = l_ixml->create_document( ).
* Create the Parser class
      parser = l_ixml->create_parser( stream_factory = streamfactory
                                      istream        = istream
                                      document       = xml_document ).
* Parse the XML
      parser->parse( ).
      IF sy-subrc NE 0
        AND parser->num_errors( ) NE 0.
        count = parser->num_errors( ).
        index = 0.
        WHILE index < count.
          parseerror = parser->get_error( index = index ).
          str = parseerror->get_reason( ).
          index = index + 1.
        ENDWHILE.
        EXIT.
      ENDIF.
    CATCH cx_parameter_invalid_range
          cx_sy_codepage_converter_init
          cx_sy_conversion_codepage
          cx_parameter_invalid_type.
  ENDTRY.
Method PROCESS_XML
  DATA v_formname TYPE fpname.
* For each node of the XML file you want to retrieve the value
* Then use the specific method PROCESS_NODE .
* Find Node where System Id is store
  CLEAR : xml_node ,
          xml_node_value.
  TRY.
      me->process_node( node_name     = 'SYSID' ).
      CHECK NOT xml_node_value IS INITIAL.
      CASE xml_node_value.
        WHEN sy-sysid.
* Search for Form name.
          me->process_node( node_name = 'FORM_NAME').
          CHECK NOT xml_node_value IS INITIAL.
          v_formname = xml_node_value.
        WHEN OTHERS.
      ENDCASE.
      CATCH cx_root.
  ENDTRY.
Method PROCESS_NODE with inbound parameter NODE_NAME type STRING
  CLEAR : xml_node , xml_node_value .
  xml_node = xml_document->find_from_name( name = node_name ).
  IF xml_node IS INITIAL.
* Missing one node in the form, nothing will be done
      RAISE EXCEPTION TYPE ....
  ELSE.
    xml_node_value = xml_node->get_value( ).
  ENDIF.
Hope this help you .
Best regards
Bertrand

Similar Messages

  • Extract data from AMPLA to SAP BW

    Hi All,
    My requirement is to extract data from a Non SAP system called AMPLA (SQL Server 2012) to SAP BI system (7.0). I need to consider possible ways for SAP BI to extract data from Non SAP Systems like DB Connect, UD Connect, Web services etc. Does anyone have experience extracting AMPLA data to SAP BI system successfully and what method is ideal to be used? Also in what form is data usually available in AMPLA source system(tables/views etc)?

    Hi Udit
    Before that could you refer this SAP Notes for database connection
    128126: Database Connect for external tools
    1601608: How to access an external SQL Server database
    Regards
    Sriram

  • Extracting data From PDF to Excel

    I have inherited a large library of PDF invoices which I need to extract data from into excell - or some other spreadsheet. The other option is to open up thousands of pdf documents and run the numbers by hand which is just dumb. I am new to acrobat and an entire afternoon of trial by fire / google hasn't gotten me very far - so even pointers in the right direction are appriciated.
    Ideally I would like to tell Acrobat what data is important on each document (can I use the form tool to do this?), extract the data from the relevant files (batch processing tool I presume?), compile the data and extract it to a CSV.
    It looks like the functionality is here I am just unsure how it all needs to fit together. Any Suggestions?

    Hi,
    There is software out there that will convert PDFs to excel... look for ABBYY or Able to extract... If you have a lot of files that are the same merge them together before using the software. Remember that if the data is created from a scanned image then the results will only be as good as the ability of the OCR engine contained in the software. You can play with the software to create tables, etc...

  • BO DI for extracting data from legacy to SAP BW 7.0

    Hi,
    Has anyone worked on scenario where BO Data Integrator is being used as ETL tool for extracting data from legacy systems to SAP BW 7.0 ?
    Please share your experience on such a landscpae or related documents any of you had come across.
    Regards,
    Pritesh

    Hi,
    BO Integrator connects with other system (Database) and you will be creating your reports on the top of that DB or system. It never saw it being used to pull data from legacy to BW.
    Regards,
    Bashir Awan

  • Extract data from PDF

    Hello,
    I am using Adobe Acrobat Professional 6.0 to create a bunch of survey questionnaires for respondents to fill out using an off-line computer. I used check boxes and radio buttons to set up the forms and assign output values. However, I couldn't figure out how to export the response values into one single file (preferably .csv). Does anyone know how to make that happen? Thanks in advance.

    Thanks for the reply!
    So, how do I get data from fdf to csv?
    I have participants coming in to fill out the questionnaire in my lab and we save their files. For example, for participant #001, the PDF file was saved as Questionnaire_001, and participant #002 as Questionnaire_002, and etc. If say I have 50 participants I will have 50 PDF files stored in the computer. This is the method used by the guy worked here before me and he somehow was able to extract data from those saved files.
    I know in the Adobe Acrobat Professional 6.0 I can get fdf file by going Advanced--> Forms--> Export Forms Data. But how do I get a csv file that has all 50 people's responses, with each column a response field (Q1, Q2, Q3, and etc) and each row a participant?
    Thanks a lot.

  • Extract data  from CRM to SAP R/3

    Hi Experts,
    I Facing Problem to Extract the data from database table BUT000 in CRM 2.0 System to SAP R/3 whether its possible to update the data directly in R/3 system from CRM. whether any functional module exists?
    Plz Provide me details about it

    Why do you need to copy it? The data is easily available from R/3 via RFC.
    Rob

  • How to Extract Data from Hyperion to SAP BW

    Dear Guru,
    I have a client that have a data in hyperion and they want to extract those data into SAP BW. Can you tell me how to connect those two system? is it possible to use DB connect?
    Thanks in advance for the answer.
    Tienus

    HI
    http://www.intellient.co.za/content/HYP1011-6419%20Sys9%20BI+Anlytic%20DS.pdf
    Re: Hyperion to BW Connection for Drill through reporting
    Hope it helps you.....
    Regards
    Chandra Sekhar T

  • Applescript: Extract data from pdf

    I am trying to extract a string from a pdf, and then rename the pdf with that string. The string varies in length, but always comes between "Name:" and "ID:"
    Ideally I could drop a pdf with multiple pages, and it would extract the individual sheets and rename as new documents with this string.
    From another thread, I've tried using this shell script (the Citing Patent and Classifications were the delimiters):
    for f in "$@" 
    do 
         echo "$f" >> ~/Desktop/Patent01.txt 
         cat "$f" | sed -n '/Citing Patent/,/CLASSIFICATIONS/p' | sed  's/CLASSIFICATIONS//p' >> ~/Desktop/Patent01.txt 
    done
    Thanks!

    Replying to self with progress, and maybe someone can help.
    Drop the single page pdf onto the script; it calls an automator which converts the pdf to plaintext; applescript then reads the txt file for the data I want; last step is to rename the original file with the string that I want (a name).
    I'm getting error -10006, can't rename. Below is the script and a screenshot of the automator.
    on open fileList
      tell application "Finder"
      --set thePDFfile to (choose file)
      repeat with thePDFfile in fileList
      set theInfo to info for thePDFfile
      set theFile to name of theInfo
      set qtdstartpath to quoted form of (POSIX path of thePDFfile)
      set workflowpath to "/Users/Galen/PDFextract/NoInput.workflow"
      set qtdworkflowpath to quoted form of (POSIX path of workflowpath)
      set command to "/usr/bin/automator -i " & qtdstartpath & " " & qtdworkflowpath
      set output to do shell script command
      --do shell script "automator /Users/Galen/PDFextract/NoInput.workflow"
      set AppleScript's text item delimiters to "
      set thetext to text items of (read "/Users/Galen/Desktop/ExtractOutput.txt")
      set studentName to item 2 of thetext
      set AppleScript's text item delimiters to " "
      set thetext to text items of studentName
      set lastName to item 2 of thetext
      set firstName to item 3 of thetext
      set lastFirst to (lastName & " " & firstName)
      --return lastFirst
      set AppleScript's text item delimiters to ""
      set the name of theFile to ((lastFirst as text) & ".pdf")
      end repeat
      end tell
    end open

  • Reg Extracting data from PDF using file adapter

    Hi Experts,
                 In my business process I will get different files in the form of pdf. I have to extract the fields from the file and send it to ECC system. Can any one suggest me how to do it without using CA.
    Regards
    Suresh

    you might have to use a custom solution.
    you will find tips here Trouble writing out a PDF in XI/PI?

  • Extracting Data from PDF forms in Reader created in Livecycle

    Hello
    We would like users who complete a PDF  document in Adobe Reader created in Livecycle to be able to export the  completed fields (and accompanying questions) to a MS Word document in a  format that appears similar to the PDF so it can be pasted in future  documents.
    Is there a simple step procedure that the users can follow
    Any assistance would be much appreciated

    Hi,
    I think, you had selected "3.x Datasource" as the type when you were replicating the Metadata from second client.
    If so, delete the datsource (in BIW) from the second client , and then replicate the datsource one more time.But this time , you need to select "As Datasource" option only.
    with rgds,
    Anil Kumar Sharma .P

  • Extracting data from a SQL Server to BW

    Hi Experts,
        Can somebody let me know how to extract data from a NON SAP
        SQL Server I mean
        1. Creating a Source System
        2. Connecting to the SQL server
        3. Creating datasources and extraction
        Kindly help me its urgent
        thank you
        arshad.

    Hi Ingo,
    What I suggest is instead of extracting it to a file, can you use the function module which replicates this data to the mobile clients and use this function module to call the select statement. If a mobile client is able to access this info, then it must be doing a RFC call to some system whose logical system would have been in SAP as well. This is an assumption.
    May be if you could call the same function to derive the required data instead of extracting it to a file and then uploading it.
    Regards,
    Srikanth

  • Extract data from flat file

    Hi,
    I'm trying to extract data from a non-SAP datasource (flat file) to BW, I need to first convert the source file (txt) into the appropriate format to load to BW (CSV or ASCII). Currently, the txt file is not in a either format but more in a report kind of format. Is there any functionality in BW that I could utilize to convert the source file esaily in the format that BW can understand? Can I do this using transfer rules?
    Thanks.

    Thanks. But on the text file, there's some other information that I don't need such as the header information and the data currently is in group level. Can I utilize BW without changing the format on the original source file?
    Thanks.

  • Extracting data from Z-table from SAP R/3 to BW

    Hi all
    I want to extract data from a Z-table from SAP R/3 system to Bw system. Currently I am on BW 3.5. Since it is a Z table I dont have a standard extractor for it & I dont knw how to create it. Can anyone provide me with the step-by-step documentation of how to extract data from a non standard SAP table????

    Hi
    You need to create Generic Datasource on the Z-Table you want to get data from
    Go to RSO2 transaction to create generic datasource .
    You need to give technical name of datasource under datasource type you want and click on create. Then you can give descrption and Application component under which u want see the datasource,
    enter the z table name under view/ table and save.
    here you can click on check boxes to make fields hidden or selection fields.
    Regards
    Ravi
    Edited by: Ravi Naalla on Aug 25, 2009 8:24 AM

  • How to Extract Data from the PDF file to an internal table.

    HI friends,
    How can i Extract data from a PDF file to an internal table....
    Thanks in Advance
    Shankar

    Shankar,
    Have a look at these threads:-
    extracting the data from pdf  file to internal table in abap
    Adobe Form (data extraction error)
    Chintan

  • How to extract data from SAP in FDM 11121

    I came across some documents from version 11113, says there is a SAP adapter, however ,when I check 11121 there's no such adapter, does anyone know how to extract data from SAP in FDM 11121?

    I download a package from Bristlecone, but I dont see any xml files in it, just a bunch of dll and I didn't find any instructions on how to set up/configure in FDM, it just explained how to register in SAP app server and client.
    Hyperion 11113 has readme on sap adapter(Hyperion Readme Template), but I cannot find the same readme file in 11121, all I can find is ERP Integration Adapter document. any idears where I can find at least a readme document?

Maybe you are looking for