XML file to BDC upload

Hi all,
I have one requirement regarding BDC and XML files. There will be one folder in application server, like 'IN'. I need to write a program which will be scheduled for every 15 mins. It should check the 'IN' folder for XML files. If there are any XML files present in that folder, program should take input from every file and it should call one BDC program for uploading into SAP. Now i need a function module, which will give no.of files and file names present in the folder. Please help me as early as possible.
Thanks in Advance.
Siva Sankar.

Hi siva,
i have the similar requirement...
hw did u got the solution for this requirement..
kindly help me if you got the solution..
thanks

Similar Messages

  • Upload an XML file

    hi all
        i want to know can we upload XML  file using bdc can i do it
    if yes how to do it.
    thanks & regard
    kiran.

    HI Kiran,
    Look at the Below thread, same question was asked before ....
    Upload XML to internal table and vice versa in SAP 4.6C
    http://wiki.ittoolbox.com/index.php/Code:Download_and_upload_OO_ABAP_class_in_XML_format
    Regards
    Sudheer

  • Error while uploading .xml file for Customer/Vendor List for Italy

    Hi All,
    We are facing problem while uploading the .xml file in DMEE transaction for the new Customer/Vendor List for Italy.
    We have followed the entire process given in the OSS Note(1090857).
    We have SAP 4.6c and followed the below steps:
    1. Created ID-FI-IT Development class
    2. Added domains
    3. Added Data elements
    4. Tried to upload the given .xml file and got any error saying ".xml file could not be interpreted".
    Also there is a .SAR file mentioned to upload if we receive any errors while uploading .xml file.
    Tried uploading the .SAR file also. STill we are recieving the same Error.
    Can any one of you help us out.
    Thanks in Advance.
    Ramesh

    Ok, we upload .SAR file in this way:
    1. unpack .SAR file with SAPCAR.EXE program. Yuo obtain 2 files
    R492445.P9C and K492445.P9C
    2. put K492445.P9C in directory \SAPMNT\TRANS\COFILES and put R492445.P9C in directory \SAPMNT\TRANS\DATA of your system (DEV, TST or PRD)
    3. Use Tx STMS. If You want create DMEE tree in DEV system, go to DEV import queue. Choose menu Extras | Other requests | Add. Insert P9CK492445 in Transp. request field.
    4. Import the request. This creates the DMEE tree. You don't need ti upload XML file after. You can see the DMEE tree created with Tx DMEE and inserting
    Tree type        UMS1            
    Format tree     IT_CUST_VEN_LIST
    5. after continue follow the note
    I hope this help you
    Roberto

  • How To Process an XML File

    Hi All
    Clasic ASP
    MySQL
    Win 2K Server
    I have an XML file that is uploaded from clients via a
    browser which
    contains job data. Once uploaded I need to process it into a
    MySQL DB using
    classic ASP.
    The file contains 3 lots of elements under the main job
    element; these are:-
    <job_detail>
    <engineers>
    <materials>
    The upload and save aspect I can do no problem what I need to
    do is read the
    file and process each job detail record, each engineer detail
    record and
    each materials record into a database, something on the lines
    of:-
    Upload file from client
    Save file to disk
    Open XML file
    Select all job records
    Loop through and process job records
    Select all engineer records
    Loop through and process engineer records
    Select all material records
    Loop through and process material records
    How do I select the job detail, engineer and materials
    records, into say an
    array or a recordset for example. (if someone feels there is
    a better way
    then please feel free to suggest.)?
    An example of my XML file is below
    TIA
    Bren
    <?xml version="1.0" ?>
    - <jobs>
    - <job_detail>
    <j_recid>4041</j_recid>
    <j_numofvisits>1</j_numofvisits>
    <j_client>800</j_client>
    <j_site>864</j_site>
    <j_workdone />
    <j_suppliervisit>N</j_suppliervisit>
    <j_furtherwork>N</j_furtherwork>
    <j_returnvisit>N</j_returnvisit>
    <j_furtherworksdesc />
    <j_tobequoted>N</j_tobequoted>
    <j_status>6</j_status>
    <j_enteredby>Yolanda Baker</j_enteredby>
    <j_e_signature>53,29,-1,-1,53,29,53,30,53,30,58,33,58,33,75,45,75,45,110,58,110,58,149,61 ,149,61,176,54,176,54,186,42,186,42,191,33,191,33,192,30,192,30,192,29,192,29,189,29,189,2 9,184,28,184,28,174,29,174,29,159,32,159,32,124,39,124,39,82,46,82,46,54,50,54,50,43,50,43 ,50,38,50,38,50,37,49,37,49,38,49,38,49,39,49,39,49,57,49,57,49,109,54,109,54,180,56,180,5 6,239,54,239,54,277,46,277,46,281,45,281,45,281,44</j_e_signature>
    <j_e_name>Test Engineer</j_e_name>
    <j_e_position>Engineer</j_e_position>
    <j_e_comments />
    <j_e_sigdate>20/11/2008</j_e_sigdate>
    <j_c_signature>54,7,-1,-1,54,7,54,8,54,8,54,10,54,10,57,19,57,19,65,30,65,30,81,46,81,46, 100,58,100,58,121,62,121,62,144,63,144,63,163,57,163,57,181,47,181,47,190,41,190,41,200,36 ,200,36,207,33,207,33,207,31,207,31,201,29,201,29,197,27,197,27,193,27,193,27,184,28,184,2 8,172,31,172,31,160,34,160,34,146,40,146,40,140,43,140,43,138,45,138,45,137,45,137,45,136, 45,136,45,135,46,135,46,131,50,131,50,127,56,127,56,124,58,124,58,124,57,124,57,124,56,124 ,56,132,54,132,54,151,50,151,50,178,44,178,44,204,39,204,39,220,39,220,39,228,40,228,40,23 0,41,230,41,233,44,233,44,237,49,237,49,246,57,246,57,254,60,254,60,263,63,263,63,264,63</ j_c_signature>
    <j_c_name>Mr Blobby</j_c_name>
    <j_c_position>Fat Chap</j_c_position>
    <j_c_comments />
    <j_c_sigdate>20/11/2008</j_c_sigdate>
    <j_qos>3</j_qos>
    <j_notified>N</j_notified>
    <j_processed>N</j_processed>
    <j_active>Y</j_active>
    </job_detail>
    - <job_detail>
    <j_recid>4042</j_recid>
    <j_numofvisits>1</j_numofvisits>
    <j_client>798</j_client>
    <j_site>865</j_site>
    <j_workdone>As per job sheet</j_workdone>
    <j_suppliervisit>N</j_suppliervisit>
    <j_furtherwork>N</j_furtherwork>
    <j_returnvisit>N</j_returnvisit>
    <j_furtherworksdesc />
    <j_tobequoted>N</j_tobequoted>
    <j_status>6</j_status>
    <j_enteredby>Yolanda Baker</j_enteredby>
    <j_e_signature>44,20,-1,-1,44,20,43,20,43,20,42,20,42,20,39,21,39,21,34,25,34,25,28,29,28 ,29,25,32,25,32,22,38,22,38,22,41,22,41,22,43,22,43,22,44,22,44,26,44,26,44,38,45,38,45,64 ,42,64,42,104,36,104,36,135,33,135,33,165,31,165,31,178,31,178,31,185,33,185,33,189,35,189 ,35,192,38,192,38,197,41,197,41,203,43,203,43,211,49,211,49,220,51,220,51,228,52,228,52,23 1,53,231,53,232,49,232,49,233,43,233,43,230,34,230,34,229,31,229,31,224,27,224,27,213,24,2 13,24,195,23,195,23,171,27,171,27,152,32,152,32,141,36,141,36,138,36,138,36,137,37,137,37, 140,38,140,38,157,43,157,43,191,46,191,46,230,48,230,48,242,48</j_e_signature>
    <j_e_name>Test Engineer</j_e_name>
    <j_e_position>Engineer</j_e_position>
    <j_e_comments>Great job</j_e_comments>
    <j_e_sigdate>20/11/2008</j_e_sigdate>
    <j_c_signature>31,13,-1,-1,31,13,31,14,31,14,31,16,31,16,34,23,34,23,36,32,36,32,38,42,38 ,42,42,53,42,53,43,59,43,59,44,60,44,60,44,59,44,59,44,57,44,57,45,52,45,52,50,44,50,44,56 ,38,56,38,64,33,64,33,74,28,74,28,86,23,86,23,98,21,98,21,111,20,111,20,121,20,121,20,123, 20,123,20,123,21,123,21,126,24,126,24,126,27,126,27,130,33,130,33,133,37,133,37,135,42,135 ,42,139,47,139,47,142,51,142,51,144,54,144,54,151,57,151,57,157,57,157,57,164,52,164,52,17 1,46,171,46,180,42,180,42,193,38,193,38,203,38,203,38,215,38,215,38,228,38,228,38,238,39,2 38,39,245,39,245,39,247,39,247,39,248,38</j_c_signature>
    <j_c_name>Mr Blobby 2</j_c_name>
    <j_c_position>Fat Chap 2</j_c_position>
    <j_c_comments>Very well done</j_c_comments>
    <j_c_sigdate>20/11/2008</j_c_sigdate>
    <j_qos>1</j_qos>
    <j_notified>N</j_notified>
    <j_processed>N</j_processed>
    <j_active>Y</j_active>
    </job_detail>
    - <engineers>
    <m_recid>1</m_recid>
    <m_jid>4041</m_jid>
    <m_operative>18</m_operative>
    <m_starttime>07:00</m_starttime>
    <m_finishtime>17:00</m_finishtime>
    <m_traveltime>1</m_traveltime>
    <m_jobdate>20/11/2008</m_jobdate>
    </engineers>
    - <engineers>
    <m_recid>2</m_recid>
    <m_jid>4041</m_jid>
    <m_operative>3</m_operative>
    <m_starttime>07:00</m_starttime>
    <m_finishtime>17:00</m_finishtime>
    <m_traveltime>1</m_traveltime>
    <m_jobdate>20/11/2008</m_jobdate>
    </engineers>
    - <engineers>
    <m_recid>3</m_recid>
    <m_jid>4042</m_jid>
    <m_operative>3</m_operative>
    <m_starttime>07:00</m_starttime>
    <m_finishtime>17:00</m_finishtime>
    <m_traveltime>1</m_traveltime>
    <m_jobdate>20/11/2008</m_jobdate>
    </engineers>
    - <engineers>
    <m_recid>4</m_recid>
    <m_jid>4042</m_jid>
    <m_operative>25</m_operative>
    <m_starttime>09:00</m_starttime>
    <m_finishtime>17:00</m_finishtime>
    <m_traveltime>1</m_traveltime>
    <m_jobdate>20/11/2008</m_jobdate>
    </engineers>
    - <engineers>
    <m_recid>5</m_recid>
    <m_jid>4042</m_jid>
    <m_operative>8</m_operative>
    <m_starttime>07:00</m_starttime>
    <m_finishtime>17:00</m_finishtime>
    <m_traveltime>1</m_traveltime>
    <m_jobdate>20/11/2008</m_jobdate>
    </engineers>
    - <materials>
    <mu_recid>1</mu_recid>
    <mu_jid>4041</mu_jid>
    <mu_qty>1</mu_qty>
    <mu_description>Widget</mu_description>
    <mu_location>Van</mu_location>
    </materials>
    - <materials>
    <mu_recid>2</mu_recid>
    <mu_jid>4042</mu_jid>
    <mu_qty>20</mu_qty>
    <mu_description>2.5 T & E</mu_description>
    <mu_location>Van</mu_location>
    </materials>
    </jobs>

    And there was much rejoiceing Yayyy! :-)
    I have sorted it, if anyone is interested then see my code
    below. The code
    below writes to the screen for testing purposes. To insert
    into a DB then
    just build your SQL statement and Insert or Update DB as you
    would normally
    instead of writing to screen.
    Code
    <%
    Dim objXML
    Set objXML = Server.CreateObject("Microsoft.XMLDOM")
    objXML.async = False
    objXML.load
    (Server.MapPath("/mwsclient/files/upload/Test_Engineer.xml"))
    If objXML.parseerror.errorCode <> 0 Then
    Response.Write(objXML.parseError.reason)
    Else
    Set objNodeList =
    objXML.documentElement.selectNodes("job_detail")
    For i = 0 To (objNodeList.length - 1)
    Response.Write("JOB RECORD<br>")
    For x = 0 To (objNodeList.Item(i).childNodes.length - 1)
    Response.Write(objNodeList.Item(i).childNodes(x).nodeName
    Response.Write(objNodeList.Item(i).childNodes(x).xml &
    "<br>")
    Next
    Response.Write("<br>")
    Next
    End If
    Set objXML = Nothing
    %>
    Output:
    JOB RECORD
    j_recid - 4041
    j_numofvisits - 1
    j_client - 800
    j_site - 864
    j_workdone -
    j_suppliervisit - N
    j_furtherwork - N
    j_returnvisit - N
    j_furtherworksdesc -
    j_tobequoted - N
    j_status - 6
    j_enteredby - Yolanda Baker
    j_e_signature - 44
    j_e_name - Test Engineer
    j_e_position - Engineer
    j_e_comments -
    j_e_sigdate - 20/11/2008
    j_c_signature - 63
    j_c_name - Mr Blobby
    j_c_position - Fat Chap
    j_c_comments -
    j_c_sigdate - 20/11/2008
    j_qos - 3
    j_notified - N
    j_processed - N
    j_active - Y
    JOB RECORD
    j_recid - 4042
    j_numofvisits - 1
    j_client - 798
    j_site - 865
    j_workdone - As per job sheet
    j_suppliervisit - N
    j_furtherwork - N
    j_returnvisit - N
    j_furtherworksdesc -
    j_tobequoted - N
    j_status - 6
    j_enteredby - Yolanda Baker
    j_e_signature - 48
    j_e_name - Test Engineer
    j_e_position - Engineer
    j_e_comments - Great job
    j_e_sigdate - 20/11/2008
    j_c_signature - 38
    j_c_name - Mr Blobby 2
    j_c_position - Fat Chap 2
    j_c_comments - Very well done
    j_c_sigdate - 20/11/2008
    j_qos - 1
    j_notified - N
    j_processed - N
    j_active - Y

  • While signing a .XML file a message "cannot read the file for signing" is displayed. What is the solution.

    An official site incometaxindiaefiling.gov.in requires .XML files to be uploaded. When .XML files are uploaded without digital signatures there is no problem. When digital signatures are required for signing the same a message 'CANNOT READ THE FILE FOR SIGNING" is displaced. It happens with CHROME and IE also. The solution which I have devised is that I copy the .XML files in a folder called FAKEPATH in C: drive and pick the file for signing from this folder. The browser allows the file to sign with digital signatures. What is the solution.
    Ashish Goel

    Ashish,
    You might want to submit this feedback at https://incometaxindiaefiling.gov.in/e-Filing/Services/Feedback.html instead.

  • XML file not getting transferred to archive folder once upload is done!!

    Hi all,
            I am working on a scenario where SAP R/3 sends data to SAP MDM 5.5 (SP04 PATCH 2) with XI as middleware.The XML file sent by XI is getting uploaded from the FTP folder using Manual Import (Import Manager).
    But after importing for the first time, the XML file does not go automatically to the
    Archive folder.
    Any suggestions would be appreciated.
    Regards,
    Ravi Verma

    Hi Ravi,
    it's possible that this was a bug in SP4 Patch 2. I know that it worked with Patch 3 because this was the first time I used this feature. Is it possible for you to upgrade to the latest SP4 Patch?
    Fact is that this should work with IM automatically. But I'm afraid that, if you report this in a OSS ticket, you'll get exactly the same reply as I've given to you above...
    Kind regards
    Michael

  • Uploading xml file in a background job .

    Hi Experts ,
    I am uploading a xml file from application server to internal table .
    While uploading from presentation server I get the value of stream as ( first few lines )
    Case 1 :
    ?<?xml version="1.0" encoding="utf-16" standalone=
    "yes"?><WPUBON01>##  <IDOC BEGIN="1">##    <EDI_DC
    40 SEGMENT="1">##      <TABNAM>EDI_DC40</TABNAM>##
    but while uploading from  application server , I get :
    Case 2 :
    <?xml version="1.0" standalone="yes"?>##<WPUBON01>##  <IDOC BEGIN="1">##    <EDI
    DC40 SEGMENT="1">##      <TABNAM>EDIDC40</TABNAM>##      <MANDT>108</MANDT>##
    Difference is of  unicode 16 as seen in file from presentation server .
    As a result File from Presentation server is getting uploaded in internal table , but not from Application Server . In this case internal table is coming blank .
    I am using :
          CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
              EXPORTING
                text   = stream
              IMPORTING
                buffer = xstring
              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.
    here xstring is coming blank when you use same file from application server .
    *Extract data from xsting to internal table
            CALL FUNCTION 'SMUM_XML_PARSE'
              EXPORTING
                xml_input = xstring
              TABLES
                xml_table = it_data
                return    = it_ret.
    I am getting error it it_ret as :
    line   1 col   1-unexpected symbol; expected '<', '</', entity reference, character data, CDATA section, processing instruction or comment
    How to get file like case 1 . or how to convert to utf-16 ?
    I am using :
    OPEN DATASET l_filename FOR INPUT IN  BINARY MODE    .
    DO.
    READ DATASET l_filename INTO l_xml_line.
    IF sy-subrc EQ 0.
    APPEND l_xml_line TO l_xml_table.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET l_filename.
    LOOP AT l_xml_table INTO l_xml_line.
    c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data
    replacement
    = space ).
    c_conv->read( IMPORTING data = l_content len = l_len ).
    CONCATENATE l_str1 l_content INTO l_str1.
    ENDLOOP.
    Help please ......
    regards ,
    SA

    Hi Alpana ,
    Thanks for the reply .
    I already am uploading data in internal table . If you see through my question ,
    My problem is modify  the error in xml file uploaded in  l_xml_table through read dataset .
    My file has been uploaded   from application server as 
    <?xml version="1.0" standalone="yes"?>
    <WPUBON01>
      <IDOC BEGIN="1">
    This file is getting changed while uploading from presentation server as 
    ?<?xml version="1.0" encoding="utf-16" standalone=
    "yes"?><WPUBON01>##  <IDOC BEGIN="1">##    <EDI_DC
    40 SEGMENT="1">##      <TABNAM>EDI_DC40</TABNAM>##
          <MANDT>108</MANDT>##      <DOCNUM>3C10000001
    notice the addition   'encoding="utf-16" '  .
    How to achieve this addition .
    If i am uploading it frompresentation server it is getting uploaded in internal table successfully , but not from application server
    so that i can parse this xml file into xstring successfulyy to get it into internal table thru function module
    CALL FUNCTION 'SMUM_XML_PARSE'
              EXPORTING
                xml_input = xstring
                xml_input = l_string_output
              TABLES
                xml_table = it_data
                return    = it_ret.
    Please help me in hanging the file stream .
    Regards ,
    SA

  • How to upload a multistructured file in BDC program using gui_upload?

    I want to upload a multistructured file in BDC program...in which some structures are repeating for multiple records..how to do this..
    BP_GEN_DATA     FR0100270154                         FR12345678902
    BP_PAYMENT     FR     0123456789     01234567890          
    BP_UNLOAD     MARSEILLE     X     FR                    
    BP_UNLOAD     PARIS          FR                         
    Here BP_GEN_DATA is root structure and BP_UNLOAD is lower level structure which is repeating

    Resolved

  • Issue with uploading XML file from application server into internal table

    i Need to fetch the XML file from the application server and place into internal table and i am getting error message while using the functional module   SMUM_XML_PARSE and the error message is "line   1 col   1-unexpected symbol; expected '<', '</', entity reference, character data, CDATA section, processing instruction or comment" and could you please let me know how to resolve this issue?  
        TYPES: BEGIN OF T_XML,
                 raw(2000) TYPE C,
               END OF T_XML.
    DATA:GW_XML_TAB TYPE  T_XML.
    DATA:  GI_XML_TAB TYPE TABLE OF T_XML INITIAL SIZE 0.
    DATA:GI_STR TYPE STRING.
    data:  GV_XML_STRING TYPE XSTRING.
    DATA: GI_XML_DATA TYPE  TABLE OF SMUM_XMLTB INITIAL SIZE 0.
    data:GI_RETURN TYPE STANDARD TABLE OF BAPIRET2.
        OPEN DATASET LV_FILE1 FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF SY-SUBRC NE 0.
          MESSAGE 'File does not exist' TYPE 'E'.
        ELSE.
          DO.
    * Transfer the contents from the file to the work area of the internal table
            READ DATASET LV_FILE1 INTO GW_XML_TAB.
            IF SY-SUBRC EQ 0.
              CONDENSE GW_XML_TAB.
    *       Append the contents of the work area to the internal table
              APPEND GW_XML_TAB TO GI_XML_TAB.
            ELSE.
              EXIT.
            ENDIF.
          ENDDO.
        ENDIF.
    * Close the file after reading the data
        CLOSE DATASET LV_FILE1.
        IF NOT GI_XML_TAB IS INITIAL.
          CONCATENATE LINES OF GI_XML_TAB INTO GI_STR SEPARATED BY SPACE.
        ENDIF.
    * The function module is used to convert string to xstring
        CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
          EXPORTING
            TEXT   = GI_STR
          IMPORTING
            BUFFER = GV_XML_STRING
          EXCEPTIONS
            FAILED = 1
            OTHERS = 2.
        IF SY-SUBRC <> 0.
          MESSAGE 'Error in the XML file' TYPE 'E'.
        ENDIF.
      ENDIF.
      IF GV_SUBRC = 0.
    * Convert XML to internal table
        CALL FUNCTION 'SMUM_XML_PARSE'
          EXPORTING
            XML_INPUT = GV_XML_STRING
          TABLES
            XML_TABLE = GI_XML_DATA
            RETURN    = GI_RETURN.
      ENDIF.
      READ TABLE GI_RETURN TRANSPORTING NO FIELDS WITH KEY TYPE = 'E'.
      IF SY-SUBRC EQ 0.
        MESSAGE 'Error converting the input XML file' TYPE 'E'.
      ELSE.
        DELETE GI_XML_DATA WHERE TYPE <> 'V'.
        REFRESH GI_RETURN.
      ENDIF.

    Could you please tel me  why the first 8 lines were removed, till <Soap:Body and also added the line <?xml version="1.0" encoding="UTF-8"?> in the beggining .
    Becuase there will be lot of  XML files will be coming from the Vendor daily and that should be uploaded in the application server and should update in the SAP tables based on the data in the XML file.
    what information i need to give to vendor that do not add the first 8 lines in the XML file and add the line in the beggining <?xml version="1.0" encoding="UTF-8"?>   ??????
    Is there any other way we can do with out removing the lines?

  • Getting error when try to upload xml file into Data Template

    Hi,
    Getting error when try to upload xml file into Data Template.error:"The uploaded file XXSLARPT.xml is invalid. The file should be in XML-DATA-TEMPLATE format."Plz anybody help me.
    Thanks,
    Prasad.

    Hi,
    Anybody Help Plzzzzzz.
    thx,
    Prasad

  • Upload XML file from server to itab

    After failed to get a answer about download data from xml file in server to my itab, and searching and searching in hundred of post and threads i try my own solution for this issue.
    I read the file with:
    OPEN DATASET FICHERO FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    In this case the result is a table filled with register type string like this:
    #<label>22222</label>
    I need a table with this kind of value (example):
    label   | 22222
    label2 | John
    label3 | Smith
    Therefore i have to parse the data of my table, i try with the FM:
    TEXT_CONVERT_XML_TO_SAP
    But dont works for me,
    I am too new in ABAP.
    The code for my report is very simple:
    REPORT ZPRUEBA_XML.
    DATA: BEGIN OF TABLA OCCURS 1,
    TEXTO(256) TYPE C,
    END OF TABLA.
    DATA: FICHERO LIKE RLGRAP-FILENAME.
    OPEN DATASET FICHERO FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF SY-SUBRC NE 0.
      WRITE:/ 'ERROR'.
    ENDIF.
    FREE TABLA.
    DO.
      READ DATASET FICHERO INTO TABLA.
      IF SY-SUBRC NE 0.
        EXIT.
      ELSE.
        APPEND TABLA.
        WRITE: TABLA-TEXTO.
      ENDIF.
    ENDDO.
    CLOSE DATASET FICHERO.
    And my ".xml" in the server is very simple too.
    <label>222222</label>
    <name>John</name>
    <street>Smith, 23, NY</street>
    Anyone can help me?
    Thanks

    Hi,
    You could use a transformation to do that, or call FM 'TEXT_CONVERT_XML_TO_SAP'... you also have the class IF_IXML that should help you and a lot of threads on the subject, such as:
    convert XML data into ABAP internal table
    ABAP Class to convert XML to itab
    Upload XML to internal table and vice versa in SAP 4.6C
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e66701fc-0d01-0010-9c9a-f8a36c4e87ba
    Kr,
    Manu.

  • Upload an XML file into the Internal table

    Hi Guys,
    I want to know, how to upload an xml file into the Internal table through ABAP programming

    you just wanted to load the xml file into internal table (as a table of binary strings)or load the xml data mapped to itab row columns
    for the first one you can simply use gui_upload
    and for the second one you need to load the xml file using gui_upload and use XLST program to transform into an itab
    Regards
    Raja

  • How to upload XML file into the internal table in Webdynpro  ABAP ?

    Hi Friends,
    I am not able to upload the XML file into ABAP,can you please help me in solving this issue with the help of source code.
    Regards
    Dinesh

    Hi Dinesh,
    Try go through this program which I had developed earlier. It takes as input an XML file and then breaks it down into name-value pairs of an intrnal table. You need to pass an XML file as input to this program. (I had hard coded the path for my XML file in it. You need to replace it with 1 of your own or you can just delete it and use the browse button to selet the file on your PC)
    Regards,
    Uday
    REPORT  ZUDAY_XML no standard page heading.
    " Internal table to store the XML file in binary mode
    data: begin of it_xml occurs 1,
            c(255) type x,
          end of it_xml,
    " Name-value pairs table rturned by FM SMUM_XML_PARSE
          it_SMUM_XMLTB type SMUM_XMLTB occurs 0 with header line,
    " Table returned by FM SMUM_XML_PARSE for error handling
          it_bapiret2 type bapiret2 occurs 0 with header line.
    " XSTRING variable to be used by FM SCMS_BINARY_TO_XSTRING to hold the XML file in XSTRING format
    data: I_xstring type xstring, 
    " String variable to hold XML file path to pass to GUI_UPLOAD
          I_file_path type string,
    " Variable to store the size of the uploaded binary XML file
          I_LENGTH TYPE I VALUE 0.
    parameters: P_path type IBIPPARMS-PATH default 'C:\Documents and Settings\c5104398\Desktop\flights.xml'.
    " Get the XML file path from the user
    at selection-screen on value-request for P_path.
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          FILE_NAME = P_PATH.

  • Uploading xml file from application server

    HI everybody guys having promblem reading xml file from application server.Here is the solution. the sample program is below.
    TYPE-POOLS: ixml. "iXML Library Types
    *TABLES : rbkp.
           TYPE DECLERATIION
    TYPES: BEGIN OF type_tabpo,
           ebeln  TYPE ekko-ebeln,         "PO document number
           ebelp TYPE ekpo-ebelp,          "PO line item
           END OF type_tabpo.
    TYPES: BEGIN OF type_ekbe,
           belnr TYPE rbkp-belnr,          "Invoice document
           gjahr TYPE rbkp-gjahr,          "fiscal year
           END OF type_ekbe.
    TYPES: BEGIN OF type_invoice,
           belnr TYPE rbkp-belnr,          "PO document number
           gjahr TYPE rbkp-gjahr,          "Fiscal Year
           rbstat TYPE rbkp-rbstat,        "invoice status
           END OF type_invoice.
    TYPES: BEGIN OF t_xml_line,            "Structure for holding XML data
            data(256) TYPE x,
            END OF t_xml_line.
         INTERNAL TABLE DECLERATIION
    DATA: gi_tabpo TYPE STANDARD TABLE OF type_tabpo,
          gi_ekbe TYPE STANDARD TABLE OF type_ekbe,
          gi_invoice TYPE STANDARD TABLE OF type_invoice,
          gi_bapiret2 TYPE STANDARD TABLE OF bapiret2.
    DATA: l_ixml TYPE REF TO if_ixml,
          l_streamfactory TYPE REF TO if_ixml_stream_factory.
         l_parser TYPE REF TO if_ixml_parser,
         l_istream TYPE REF TO swif_ixml_istream,
         l_document TYPE REF TO if_ixml_document,
         l_node TYPE REF TO if_ixml_node,
         l_xmldata TYPE string.
    *DATA: l_elem TYPE REF TO if_ixml_element,
         l_root_node TYPE REF TO if_ixml_node,
         l_next_node TYPE REF TO if_ixml_node,
         l_name TYPE string,
         l_iterator TYPE REF TO if_ixml_node_iterator.
    DATA: l_xml_table TYPE TABLE OF t_xml_line, " XML Table of the structure
          l_xml_line TYPE t_xml_line, " Record of structure t_xml_line
          l_xml_table_size TYPE i. " XML table size
    DATA: l_filename TYPE string.
          WORK AREA DECLARATION
    DATA: gw_tabpo TYPE type_tabpo,
          gw_ekbe TYPE type_ekbe,
          gw_invoice TYPE type_invoice,
          gw_bapiret2 TYPE bapiret2.
       BEGIN OF SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    PARAMETERS: p_file TYPE pathintern LOWER CASE DEFAULT '/usr/sap/tmp/'.
    Validation of XML file: Only DTD included in XML document is supported
    SELECTION-SCREEN END OF BLOCK blk1.
      INTIALISATION.
    INITIALIZATION.
      SELECTION SCREEN VALIDATION
    AT SELECTION-SCREEN.
    To validate p_file is not initial
      PERFORM sub_validate_file.
    PERFORM sub_validate_path.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Request for filename for xml file from the application server
      PERFORM sub_get_filename_appl USING  p_file.
      START OF SELECTION SCREEN
    START-OF-SELECTION.
      PERFORM sub_fetch_po_details.
      PERFORM sub_get_invoice.
      PERFORM sub_rel_invoice.
      END OF SELECTION SCREEN
    END-OF-SELECTION.
    *&      Form  sub_validate_file
         To Validate the file
    FORM sub_validate_file .
      IF p_file IS INITIAL.
        MESSAGE e000.           "specify the file path
      ENDIF.
    ENDFORM.                    " sub_validate_file
    *&      Form  sub_get_filename_appl
    form sub_get_filename_appl  USING  l_fname TYPE any.
    DATA:  l_fname TYPE filename-fileintern.        " File name
    *GET THE FILENAME FROM THE APPLICATION SERVER
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = l_fname
          filemask         = '*'
        IMPORTING
          serverfile       = l_fname
        EXCEPTIONS
          canceled_by_user = 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.
    ENDFORM.                    " sub_get_filename_appl
    *&      Form  sub_fetch_po_details
         To fetch the PO details from the application server
         Format of file is XML
    FORM sub_fetch_po_details .
          TYPE DECLERATIION
      l_ixml = cl_ixml=>create( ).
    Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
      PERFORM get_xml_table.
      LOOP AT gi_tabpo INTO gw_tabpo.
        WRITE:/ gw_tabpo.
      ENDLOOP.
    ENDFORM.     " sub_fetch_po_details
    *&      Form  get_xml_table
          Read from the xml file
    FORM get_xml_table .
    Local variable declarations
      DATA: l_len TYPE i,
      l_len2 TYPE i,
      l_tab TYPE tsfixml,
      l_content TYPE string,
      l_str1 TYPE string,
      c_conv TYPE REF TO cl_abap_conv_in_ce,
      l_itab TYPE TABLE OF string.
      l_filename = p_file.
    code to upload data from application server
      OPEN DATASET l_filename FOR INPUT IN BINARY MODE.
      IF sy-subrc <> 0.
        WRITE:/ 'invalid file path'.
      ENDIF.
      DO.
        READ DATASET l_filename INTO l_xml_line.
        IF sy-subrc EQ 0.
          APPEND l_xml_line TO l_xml_table.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET l_filename.
    code to find the table size
      DESCRIBE TABLE l_xml_table.
      l_xml_table_size = ( sy-tleng ) * ( sy-tfill ).
    *code to convert hexadecimal to XML
      LOOP AT l_xml_table INTO l_xml_line.
        c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data
    replacement
        = space ).
        c_conv->read( IMPORTING data = l_content len = l_len ).
        CONCATENATE l_str1 l_content INTO l_str1.
      ENDLOOP.
      l_str1 = l_str1+0(l_xml_table_size).
      SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
      LOOP AT l_itab INTO l_str1.
        REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
        l_str1 WITH space.
      ENDLOOP.
      CALL TRANSFORMATION ('ID')    " code to put in internal table
      SOURCE XML l_str1
      RESULT tab = gi_tabpo[].
    ENDFORM. " get_xml_table

    Hi Raja,
    I tried the same. But it not populating the table and giving an error message in the return table "line   1 col   1-unexpected symbol; expected '<', '</', entity reference, charac".
    I can't find any ' ; ' in the XML file. What could be the possible reason of error?

  • Uploading an XML file from SAP into third party URL

    Hi,
    I need to Upload an XML file from sap into Third party URL. Can any body tell me the possible ways in SAP to achieve this task. Also explain me the proceedure.
    Thanks in advance.
    -Namdev

    Sorry. If they only said HTTP/HTTPS and didn't say explicitly web service, it means they don't want it.
    One thing I'm not sure is, do you have an URL at the third-party system that you need to contact, or should you provide one at your SAP system that they will contact?
    If it is the first one, to send an HTTP request to a given URL using ABAP, you'll find an example here: [SAP Library: Example Program: Executing an HTTP Request|http://help.sap.com/saphelp_nw70/helpdata/en/1f/93163f9959a808e10000000a114084/frameset.htm]
    Sandra

Maybe you are looking for

  • Using multiple Iphones on one computer

    My family has multiple Iphones and I was wondering if there is a way to have three seperate accounts on one computer? I don't want my apps or music to be synced on my son's or wife's phone. How do I do this? Help!

  • URGENT: Problems with Dates in BC4J

    Hello I have the next problem, I have to access to Dates from my B Component and consult the day , month , and I don4t know how because it only give the posibility to convert it to a String and with a String i don4t know to access to the day. Thanks

  • Retrieving file name using web agent

    When uploading to the database using interMedia web agent and an HTML form, is the file name (as well as the file contents) passed to the agent? If so, how does one retrieve the file name on the server side? Thanks for insight. -John

  • Case Statement doesn't switch.

    Hello, I'm having an odd problem with a case statement.  I'm passing is a Boolean that is false but the case statement never switches over to the 'false' loop.  I have attached a word doc that has the screen shot of this being single stepped through.

  • How can you repair "invalid node structure and invalid b-tree node size"

    I have a MacBook Pro 17"  and the original install disk is Mac OS 10.4.  I have an update 10.6 install CD, but I cannot use it to boot up my computer.  My computer had been running on 10.6 when the problem occurred. It seems my harddrive has crashed.