Loading xml file in SAP

Hi,
I have a requirement to load xml file into SAP. Can you please tell me most efficient way to do this? Is there any function available in SAP to load xml file?
Please let me know. I would really appreciate this.
Regards,
Sanjeev

HI,
This is the link which will give you the Code
http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/Z_RMTIWARI_XML_TO_ABAP_46C.html
Use this XML file to Upload the same, this Program will work for your XML file also,
http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/input_xml.xml
See the below thread also
Upload XML to internal table and vice versa in SAP 4.6C
look at the below function moduel .. <b>TEXT_CONVERT_XML_TO_SAP</b>
Regards
Sudheer

Similar Messages

  • Loading XML file to BI 7

    Hi,
    I have a requirement to load XML file from Application server to BI 7. Most of the documents I saw online are related to BW 3.X.
    does any one have good examples of how this can be done in BI 7.
    thanks

    hi
    check the SAP documentation for loading XML file to BI
    http://help.sap.com/saphelp_nw70/helpdata/en/fe/65d03b3f34d172e10000000a11402f/frameset.htm

  • Load XML files

    Hi Guys,
    do you have any experience with loading XML files into BI 7.0?
    I've got XML files with transaction data (and XSD files - "translation files for that XML") located in the  Enterprise Portal Respository.
    Which would be the best way to load that information into BI?
    Transfer with UD Connect using BI XMLA Connector or is it only for OLAP providers such as MS Analyses Services?
    Any help will be appreciate
    cheers
    Krzysztof

    Hi,
    Check this link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/21d8aa90-0201-0010-5e83-a3798b9a5ee0

  • Pls Help me with steps to add data from xml file to SAP B1 through B1iSN.

    Pls Help me with steps to add data from xml file to SAP B1 through B1iSN. I  am getting stuck in xsl transformation. not able to understand where the mapping code needs to be added.
    Pls explain me the steps for adding data from xml to B1 quotation step by step.
    thanks and regards
    Priya

    Hi,
    Have you checked this: https://sap.na.pgiconnect.com/p45508295/?launcher=false&fcsContent=true&pbMode=normal ?
    Thanks,
    Gordon

  • Error while loading xml files using JDBC

    Hi,
    I am trying to load xml files into an xmltype table using JDBC calls and am getting this error for some files
    LPX-00200: could not convert from encoding UTF-8 to UCS2
    The xml files and our database are both UTF-8 encoded. The version of oracle that we have here is 9.2.0.6
    Any suggestions in this matter will be greatly appreciated.
    Thanks,
    Uma

    I also experienced this problem and unfortunately this solution didn't work for me given that the tag you suggested was already on the XML file.

  • Error while loading XML files into scott user

    Hi All,
    I'm new to xml files. I need to load xml files into database through OWB.
    I have xml file in my local machine & am trying to load into table PO of Scott. Scott is registered as repository user.
    Followed same steps as specified in userguide.
    But, when executing the procedure ( in two ways one as just table name, and other as user.table name) it is showing the below error:
    Procedure is:(1)--with username.tablename
    begin
    wb_xml_load(
    '<OWBXMLRuntime>'||
    '<XMLSource>'||
    '<file>&&SAMPLES_DIR.sample1.xml</file>'||
    '</XMLSource>'||
    '<targets>'||
    '<target dateFormat="yyyy.MM.dd">scott.PO</target>'||
    '</targets>'||
    '</OWBXMLRuntime>'
    end;
    ERROR at line 1:
    ORA-20006: Error occurred while truncating target database object SCOTT.PO.
    Base exception: ORA-01031: insufficient privileges
    ORA-06512: at "OWBSYS.WB_XML_LOAD_F", line 12
    ORA-06512: at "OWBSYS.WB_XML_LOAD", line 4
    ORA-06512: at "SCOTT.SAMPLE1", line 3
    ORA-06512: at line 1
    Procedure is:(2) with out username
    begin
    wb_xml_load(
    '<OWBXMLRuntime>'||
    '<XMLSource>'||
    '<file>&&SAMPLES_DIR.sample1.xml</file>'||
    '</XMLSource>'||
    '<targets>'||
    '<target dateFormat="yyyy.MM.dd">PO</target>'||
    '</targets>'||
    '</OWBXMLRuntime>'
    end;
    ERROR at line 1:
    ORA-20006: Error occurred while truncating target database object PO.
    Base exception: ORA-00942: table or view does not exist
    ORA-06512: at "OWBSYS.WB_XML_LOAD_F", line 12
    ORA-06512: at "OWBSYS.WB_XML_LOAD", line 4
    ORA-06512: at line 2
    xml file:
    <ROWSET>
    <ROW>
    <ID>100</ID>
    <ORDER_DATE>2000.12.20</ORDER_DATE>
    <SHIPTO_NAME>Adrian Howard</SHIPTO_NAME>
    <SHIPTO_STREET>500 Marine World Parkway</SHIPTO_STREET>
    <SHIPTO_CITY>Redwood City</SHIPTO_CITY>
    <SHIPTO_STATE>CA</SHIPTO_STATE>
    <SHIPTO_ZIP>94065</SHIPTO_ZIP>
    </ROW>     
    </ROWSET>
    Note: Everything works fine if I create PO table in OWBSYS user and execute the procedurein OWBSYS user. OWBSYS.PO table will be loaded.
    What privileges are missing, what shouldI do if I want to execute the procedure from scott user and load the table of scott.
    Thanks in advance for the help.
    Regards,
    Joshna

    Hi Joshna,
    Please follow below steps to load xml file to oracle database.
    1.First connect to owb (Design Center) through your repository owner user (ex : REP_OWNER).
    2. Import WB_XML_LOAD procedure . and exit to repository owner.
    3. connect to owb design center through your repository user (ex : REP_USER)
    Create New mapping and drag one Constant Operator and create one attribute, paste / edit following code
    '<OWBXMLRuntime>'||
    '<XMLSource>'||
    '<file>E:\SOURCE\emp.xml</file>'||
    '</XMLSource>'||
    '<targets>'||
    '<target truncateFirst = "FALSE" dateFormat="yyyy.MM.dd">rep_user.emp</target>'||
    '</targets>'||
    '</OWBXMLRuntime>'
    4. Drag pre mapping operator and select WB_XML_LOAD procedure
    5. Connect Constant Operator attribute to pre mapping operator.
    6. Drag two dummy tables and connect source to target. (ex : drag t1 (table) tab two times and connect.
    7. Validate and deploy the mapping.
    8. grant necessary grant command to rep_owner user to rep_user user.
    (Note : target truncateFirst = "FALSE" by default truncate the table. So you have to give grant privileges
    To rep_user , select ,insert, delete privileges.
    9. Execute the mapping , and check EMP table. (Note : before loading EMP table delete all records ).
    10 . If you want more description please go through the below link
    http://download.oracle.com/docs/html/A95931_01/apf.htm
    Regards
    Venkat

  • Load XML file from addon domain without cross-domain Policy file

    Hello.
    Assuming that there are two addon domains on the same server: /public_html/domain1.com       and      /public_html/domain2.com
    I try to load XML file from domain2.com into domain1.com without using cross-domain policy file (since it doesn’t work on xml files in my case).
    So the idea is to use php file in order to load XML and read it back to flash.
    I’ve found an interesting scripts that seems to do the job but unfortunately I can't get it to work. In my opinion there is somewhere problem with AS3 part. Please take a look.
    Here are the AS3/PHP scripts:
    AS3 (.swf in www.domain1.com):
    // location of the xml that you would like to load, full http address
    var xmlLoc:String = "http://www.domain2.com/MyFile.xml";
    // location of the php xml grabber file, in relation to the .swf
    var phpLoc:String = "loadXML.php";
    var xml:XML;
    var loader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest(phpLoc+"?location="+escape(xmlLoc) );
    loader.addEventListener(Event.COMPLETE, onXMLLoaded);
    loader.addEventListener(IOErrorEvent.IO_ERROR, onIOErrorHandler);
    loader.load(request);
    function onIOErrorHandler(e:IOErrorEvent):void {
        trace("There was an error with the xml file "+e);
    function onXMLLoaded(e:Event):void {
        trace("the rss feed has been loaded");
        xml = new XML(loader.data);
        // set to string, since it is passed back from php as an object
        xml = XML(xml.toString());
        xml_txt.text = xml;
    PHP (loadXML.php in www.domain1.com):
    <?php
    header("Content-type: text/xml");
    $location = "";
    if(isset($_GET["location"])) {
        $location = $_GET["location"];
        $location = urldecode($location);
    $xml_string = getData($location);
    // pass the url encoded vars back to Flash
    echo $xml_string;
    //cURLs a URL and returns it
    function getData($query) {
        // create curl resource
        $ch = curl_init();
        // cURL url
        curl_setopt($ch, CURLOPT_URL, $query);
        //Set some necessary params for using CURL
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
       //Execute the curl function, and decode the returned JSON data
        $result = curl_exec($ch);
        return $result;
        // close curl resource to free up system resources
        curl_close($ch);
    ?>

    I think you might be right about permissions/settings on the server for php. Unfortunately I'm not allowed to adjust them.
    So I wrote my own script - this time I used file path instead of http address of the XML file.  It works fine in my case.
    Here it is:
    XML file on domain2.com:
    <?xml version="1.0" encoding="UTF-8"?>
    <gallery>
        <image imagePath="galleries/gallery_1/images/1.jpg" thumbPath="galleries/gallery_1/thumbs/1.jpg" file_name= "1"> </image>
        <image imagePath="galleries/gallery_1/images/2.jpg" thumbPath="galleries/gallery_1/thumbs/2.jpg" file_name= "2"> </image>
        <image imagePath="galleries/gallery_1/images/3.jpg" thumbPath="galleries/gallery_1/thumbs/3.jpg" file_name= "3"> </image>
    </gallery>
    swf  on domain1.com:
    var imagesXML:XML;
    var variables:URLVariables = new URLVariables();
    var varURL:URLRequest = new URLRequest("MyPHPfile.php");
    varURL.method = URLRequestMethod.POST;
    varURL.data = variables;
    var MyLoader:URLLoader = new URLLoader;
    MyLoader.dataFormat =URLLoaderDataFormat.VARIABLES;
    MyLoader.addEventListener(Event.COMPLETE, XMLDone);
    MyLoader.load(varURL);
    function XMLDone(event:Event):void {
        var imported_XML:Object = event.target.data.imported_XML;
        imagesXML = new XML(imported_XML);
       MyTextfield_1.text = imagesXML;
       MyTextfield_2.text = imagesXML.image[0].attribute("thumbPath");  // sample reference to attribute "thumbPath" of the first element
    php file on domain1.com:
    <?php
    $xml_file = simplexml_load_file('../../domain2.com/galleries/gallery_1/MyXMLfile.xml');  // directory to XML file on the same server
    $imported_XML = $xml_file->asXML();
    print "imported_XML=" . $imported_XML;
    ?>
    Regards
    PS: for those who read the above discussion: the first and the second script work but you must test which one is better in your situation. The first script will also work between two domains on different servers. No cross domain policy file needed.

  • 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

  • Can I load xml file from SWC without using @embed

    I'm developing a mobile application in which I need to load xml files from File.applicationDirectory. This works great if the xml files are part of the main application swf. But I would like to move these xml files into a SWC so they could be shared across multiple applications.
    Using FlashBuilder 4.5, when a SWC is built, I can specify files to embed in the library that are not assets (Assets Tab of Flex Library Build Path). For various design reasons, I do NOT want to embed the xml files via @embed.
    When the swc is built and I open it up using a zip utility, I see the xml files in there just fine. So they are being bundled with the SWC. But how can I load these files in my main application that does not involve using @embed? When the main application is built, the swc setting for link type is "merged into code".
    I wouldn't expect the application to automatically pull out the xml files from the swc and place them in the File.applicationDirectory on the mobile device. I've tried loading from there just in case but file.exists is false (as expected).
    I've searched the web (and continue to do so) and all the answers seem to be to use @embed. Is there another way?
    Randy

    It's actually a lot easier than you think.
    Just reference the file like any'ol URL using a path relative to the SWC's src directory.
    So if you include the file "assets/xml/some.xml", just use that same string like you would any remote resource.
    For example:
    var loader:URLLoader = new URLLoader( new URLRequest("assets/xml/some.xml"));
    I believe it would also work like this "/assets/xml/some.xml", but I prefer relative paths so the link doesnt break if moved out of the SWC...

  • Dynamic title for Chart created by an xml-file in SAP ChartDesigner

    Hello everybody.
    I created an xml-file with SAP ChartDesigner for using it in my abap program. I import this file as a MIME-Object.
    Everything works fine, i declared my charts and all my values.
    But now I need a dynamic title on the top.
    And know that I can give a title in my xml. But it's not dynamic.
    I looked into the xml file and the path for the title is:
    SAPChartCustomizing
    Elements
    ChartElements
    Title
    and then Caption.
      p_ixml_doc = g_ixml->create_document( ).
      l_encoding = g_ixml->create_encoding( byte_order = if_ixml_encoding=>co_little_endian character_set = 'utf-8' ).
      p_ixml_doc->set_encoding( l_encoding ).
      l_chartdata = p_ixml_doc->create_simple_element( name = 'SAPChartCustomizing' parent = p_ixml_doc ).
      l_elements =   p_ixml_doc->create_simple_element( name = 'Elements' parent = l_chartdata ).
      l_chartelements = p_ixml_doc->create_simple_element( name = 'ChartElements' parent = l_elements ).
      l_title = p_ixml_doc->create_simple_element( name = 'Title' parent = l_chartelements ).
      l_element = p_ixml_doc->create_simple_element( name = 'Caption' parent = l_title ).
      l_element->if_ixml_node~set_value( 'QRK-Mittelwert' ).
    In my opinion, it's the right path :/
    My other values i declare like this.
    l_series = p_ixml_doc->create_simple_element( name = 'Series' parent = l_chartdata ).
      l_series->set_attribute( name = 'label' value = 'TO' ).
      l_series->set_attribute( name = 'customizing' value = 'Series1' ).
      loop at gt_mw into gs_mw.
        lv_tabix = sy-tabix.
        l_point = p_ixml_doc->create_simple_element( name = 'Point' parent = l_series ).
        l_element = p_ixml_doc->create_simple_element( name = 'Value' parent = l_point ).
        l_element->set_attribute( name = 'type' value = 'x' ).
        l_element->if_ixml_node~set_value( lv_tabix ).
        l_element = p_ixml_doc->create_simple_element( name = 'Value' parent = l_point ).
        l_element->set_attribute( name = 'type' value = 'y' ).
        l_element->if_ixml_node~set_value( '35.00' ).
      endloop.
    It works...and i already checked this solution for my title, but it didn't work.
    I call the xml file with the method cl_wb_mime_repository:
    CALL METHOD cl_wb_mime_repository=>load_mime
        EXPORTING
          io              = lv_io
        IMPORTING
          bin_data        = lt_xmlr
        CHANGING
          language        = sy-langu
        EXCEPTIONS
          no_io           = 1
          illegal_io_type = 2
          not_found       = 3
          error_occured   = 4
          OTHERS          = 5.
      CHECK sy-subrc = 0.
    *-- Convert raw to xstring
      CREATE OBJECT lo_conv.
      LOOP AT lt_xmlr INTO ls_xmlr.
        CALL METHOD lo_conv->convert
          EXPORTING
            inbuff    = ls_xmlr
            outbufflg = 25000
          IMPORTING
            outbuff   = lv_xstr.
        CONCATENATE p_xml lv_xstr INTO p_xml IN BYTE MODE.
    Maybe somebody can help me.
    Thanks a lot.

    I got it!
    This thread helped me.
    [http://forums.sdn.sap.com/thread.jspa?threadID=1343796|http://forums.sdn.sap.com/thread.jspa?threadID=1343796]

  • Scenario: XML File to SAP BI ystem

    Hi Friends,
       I have scenario to send xml file to SAP BI system through PI 7.0
      Can anybody show step by step guide for (_Xml file to SAP BI 7.0 system Scenario_ ).
       How to find possible message types in SAP BI 7.0 system  if i use idoc adapter to connect BI 7.0 system.
    Karthik.k

    Here is the guide for BI integration
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40574601-ec97-2910-3cba-a0fdc10f4dce
    Thanx
    Aamir
    Pl:Search SDN before posting the questions.

  • Convert XML file to sap

    Dear friends
                  For converting XML file to SAP, I used TEXT_CONVERT_XML_TO_SAP function module. In this I have some doubt. Pls clarify this.
    1. I am getting run time error with type h.
    2  I_FIELD_SEPERATOR          = ';'
       I_LINE_HEADER              =
       I_TAB_RAW_DATA             =
       I_FILENAME                 =
       I_TOTALSIZE                =
    for the above parameter what are the value has to passed.
    Thanks.

    Hi,
    Take a look in this code:
    *& Report  z_xit_xml_check
      REPORT  z_xit_xml_check.
      TYPE-POOLS: ixml.
      DATA: BEGIN OF t_cabec OCCURS 0.
              INCLUDE STRUCTURE zmmt2010.
      DATA END OF t_cabec.
      DATA: BEGIN OF t_item OCCURS 0.
              INCLUDE STRUCTURE zmmt2011.
      DATA END OF t_item.
      DATA: BEGIN OF t_itemt OCCURS 0.
              INCLUDE STRUCTURE zmmt2012.
      DATA END OF t_itemt.
      TYPES: BEGIN OF t_xml_line,
              data(256) TYPE x,
            END OF t_xml_line.
      DATA check_item(1).
      DATA check_itemt(1).
      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 if_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,
            l_xml_line        TYPE t_xml_line,
            l_xml_table_size  TYPE i.
      DATA: l_filename        TYPE string.
      PARAMETERS: pa_file TYPE char1024 DEFAULT 'c:\xml.xml'.
      START-OF-SELECTION.
        PERFORM busca_xml.
        PERFORM carrega_tabela.
    *&      Form  get_xml_table
      FORM get_xml_table CHANGING l_xml_table_size TYPE i
                                  l_xml_table      TYPE STANDARD TABLE.
      Local variable declaration
        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 = pa_file.
      upload a file from the client's workstation
        CALL METHOD cl_gui_frontend_services=>gui_upload
          EXPORTING
            filename   = l_filename
            filetype   = 'BIN'
          IMPORTING
            filelength = l_xml_table_size
          CHANGING
            data_tab   = l_xml_table
          EXCEPTIONS
            OTHERS     = 19.
        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.                    "get_xml_table
    *&      Form  process_dom
      FORM process_dom USING document TYPE REF TO if_ixml_document.
        DATA: node      TYPE REF TO if_ixml_node,
              iterator  TYPE REF TO if_ixml_node_iterator,
              nodemap   TYPE REF TO if_ixml_named_node_map,
              attr      TYPE REF TO if_ixml_node,
              name      TYPE string,
              prefix    TYPE string,
              value     TYPE string,
              indent    TYPE i,
              count     TYPE i,
              index     TYPE i.
        DATA v_codcat TYPE zmmt2011-codcat.
        DATA v_master_for TYPE zmmt2011-master_for.
        node ?= document.
        CHECK NOT node IS INITIAL.
        IF node IS INITIAL. EXIT. ENDIF.
      create a node iterator
        iterator  = node->create_iterator( ).
      get current node
        node = iterator->get_next( ).
      loop over all nodes
        WHILE NOT node IS INITIAL.
          indent = node->get_height( ) * 2.
          indent = indent + 20.
          CASE node->get_type( ).
            WHEN if_ixml_node=>co_node_element.
            element node
              name    = node->get_name( ).
              TRANSLATE name TO LOWER CASE.
              IF name = 'iten'.
                MOVE 'I' TO check_item.
              ENDIF.
              IF name = 'cabec'.
                MOVE 'C' TO check_item.
              ENDIF.
              IF name = 'iten_texto'.
                MOVE 'T' TO check_item.
              ENDIF.
              nodemap = node->get_attributes( ).
              IF NOT nodemap IS INITIAL.
              attributes
                count = nodemap->get_length( ).
                DO count TIMES.
                  index  = sy-index - 1.
                  attr   = nodemap->get_item( index ).
                  name   = attr->get_name( ).
                  prefix = attr->get_namespace_prefix( ).
                  value  = attr->get_value( ).
                ENDDO.
              ENDIF.
            WHEN if_ixml_node=>co_node_text OR
                 if_ixml_node=>co_node_cdata_section.
            text node
              value  = node->get_value( ).
              IF check_item = 'C'.
                TRANSLATE name TO LOWER CASE.
                CASE name.
                  WHEN 'lifnr'.     MOVE value TO t_cabec-lifnr.
                  WHEN 'codcat'.
                    MOVE value TO t_cabec-codcat.
                    MOVE value TO v_codcat.
                  WHEN 'bukrs'.     MOVE value TO t_cabec-bukrs.
                  WHEN 'zterm'.     MOVE value TO t_cabec-zterm.
                  WHEN 'waers'.     MOVE value TO t_cabec-waers.
                  WHEN 'inco1'.     MOVE value TO t_cabec-inco1.
                  WHEN 'inco2'.     MOVE value TO t_cabec-inco2.
                  WHEN 'telf1'.     MOVE value TO t_cabec-telf1.
                  WHEN 'verkf'.     MOVE value TO t_cabec-verkf.
                  WHEN 'datav'.
                    MOVE value TO t_cabec-datav.
                    APPEND t_cabec.
                ENDCASE.
              ENDIF.
              IF check_item = 'I'.
                TRANSLATE name TO LOWER CASE.
                CASE name.
                  WHEN 'master_for'.
                    MOVE value TO t_item-master_for.
                    MOVE value TO v_master_for.
                  WHEN 'werks'.      MOVE value TO t_item-werks.
                  WHEN 'versao'.     MOVE value TO t_item-versao.
                  WHEN 'matkl'.      MOVE value TO t_item-matkl.
                  WHEN 'j_1bindus3'. MOVE value TO t_item-j_1bindus3.
                  WHEN 'j_1bmatuse'. MOVE value TO t_item-j_1bmatuse.
                  WHEN 'j_1bmatorg'. MOVE value TO t_item-j_1bmatorg.
                  WHEN 'j_1bnbmco1'. MOVE value TO t_item-j_1bnbmco1.
                  WHEN 'bsgru'.      MOVE value TO t_item-bsgru.
                  WHEN 'ekgrp'.      MOVE value TO t_item-ekgrp.
                  WHEN 'txz01'.      MOVE value TO t_item-txz01.
                  WHEN 'epstp'.      MOVE value TO t_item-epstp.
                  WHEN 'netpr'.      MOVE value TO t_item-netpr.
                  WHEN 'peinh'.      MOVE value TO t_item-peinh.
                  WHEN 'meins'.      MOVE value TO t_item-meins.
                  WHEN 'plifz'.      MOVE value TO t_item-plifz.
                  WHEN 'mwskz'.      MOVE value TO t_item-mwskz.
                  WHEN 'steuc'.
                    MOVE value TO t_item-steuc.
                    MOVE v_codcat TO t_item-codcat.
                    APPEND t_item.
                ENDCASE.
              ENDIF.
              IF check_item = 'T'.
                TRANSLATE name TO LOWER CASE.
                CASE name.
                  WHEN 'linha'.     MOVE value TO t_itemt-linha.
                  WHEN 'txlng'.     MOVE value TO t_itemt-txlng.
                    MOVE v_master_for TO t_itemt-master_for.
                    MOVE v_codcat     TO t_itemt-codcat.
                    append t_itemt.
                ENDCASE.
              ENDIF.
          ENDCASE.
        advance to next node
          node = iterator->get_next( ).
        ENDWHILE.
      ENDFORM.                    "process_dom
    *&      Form  Busca_XML
          text
    -->  p1        text
    <--  p2        text
      FORM busca_xml .
        DATA: lc_mess(70) TYPE c,lv_tab.
        TYPES: BEGIN OF ty_zvmsgorgtr.
                INCLUDE STRUCTURE zmmt2011.
        TYPES   END OF ty_zvmsgorgtr.
      Creating the main iXML factory
        l_ixml = cl_ixml=>create( ).
      Creating a stream factory
        l_streamfactory = l_ixml->create_stream_factory( ).
        PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
      wrap the table containing the file into a stream
        l_istream = l_streamfactory->create_istream_itable( table =
        l_xml_table size  = l_xml_table_size ).
      Creating a document
        l_document = l_ixml->create_document( ).
      Create a Parser
        l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
                                          istream        = l_istream
                                          document       = l_document ).
      Parse the stream
        IF l_parser->parse( ) NE 0.
          IF l_parser->num_errors( ) NE 0.
            DATA: parseerror TYPE REF TO if_ixml_parse_error,
                  str        TYPE string,
                  i          TYPE i,
                  count      TYPE i,
                  index      TYPE i.
            count = l_parser->num_errors( ).
            WRITE: count, ' parse errors have occured:'.
            index = 0.
            WHILE index < count.
              parseerror = l_parser->get_error( index = index ).
              i = parseerror->get_line( ).
              WRITE: 'line: ', i.
              i = parseerror->get_column( ).
              WRITE: 'column: ', i.
              str = parseerror->get_reason( ).
              WRITE: str.
              index = index + 1.
            ENDWHILE.
          ENDIF.
        ENDIF.
      ENDFORM.                    " Busca_XML
    *&      Form  Carrega_Tabela
          text
    -->  p1        text
    <--  p2        text
      FORM carrega_tabela .
      Process the document
        IF l_parser->is_dom_generating( ) EQ 'X'.
          PERFORM process_dom USING l_document.
        ENDIF.
      ENDFORM.                    " Carrega_Tabela

  • XML file to SAP

    Hi All,
    We have a requirement for which we need to post an XML file to SAP.
    I have already checked for SAP MDM and BC but they have been ruled out.
    Is there any other method of communication? We cannot think of implementing SAP XI/PI.
    Our source data is BOM related informaiton from Arena system.
    Any inputs would be appreciated.
    Regards
    Neelav

    Hello,
    please look at the following link:
    http://help.sap.com/saphelp_nw04/helpdata/en/47/b5413acdb62f70e10000000a114084/frameset.htm
    regards
    Eric

  • How to load XML files ? HELP!

    Hi folks.
    We have an old Oracle database 7.3..
    So we need to load XML files into its tables.
    As we understand Oracle Loader doesn't help us.
    Is the way to load that files?
    Thanks in advance
    Alex

    I know you realize 7.3 is old but this is sort of like trying trying to view a DVD when you only have a VCR. Simple answer would be buy a DVD player, i.e. upgrade to a more recent version of Oracle where you will get many features to handle XML.
    How do you want the XML loaded, all as a single object? That could be a CLOB column if 7.3 had them, I am not sure. You would probably have to write PL/SQL and something with UTL_FILE (if 7.3 had that) to load it.
    If you want to put it multiple columns based on its tags, you would be better off parsing it using PERL (or something) into a CSV and loading that in SQL*Loader.
    I assume as this is using XML it is a reasonably recent design, combining that with an ancient version of the database is just going to lead to endless headaches.

  • Loading XML file

    Hi All,
               How to load xml file from backend.
              i have 5 xml files in databse. i need to get the xml files from database sequentially .means i need to get in a for loop.
    how can i do this.
    any one can help?
    thanks
    Raghu

    is your front end in Flex?
    Sammi

Maybe you are looking for