Validation of xml files in SAP PI

Hi Gurus,
This is a file to proxy scenario.
I am picking the file in XML format using file adapter and sent to SAP for processing the message.
Suppose I placed the new.xml file in the FTP server, this is picked by the fle adapter and sent to SAP.
But when I placed teh same file in FTP server, the file is also getting picked for the second time.
How can SAP PI validate the data in the files , identify the duplicate files and stop the processing of the messages.
Any help appreciated.
Thanks,
Jay.

Hi,
You can have a custom module for file adapter which piks all files and  writes file name and hashcode (http://www.java2s.com/Tutorial/CSharp/0600__Security/Generatethehashcodeofthefilescontents.htm) of the file content into a table in PI.
To check files which are already piked with same name simply check for the file name using RFC lookup in mapping.
To check for files which are already processed with same content check for hashcode of the file using RFC lookup in mapping.
Not sure using module is appropriate here, but this may be one of the solution for ur requirement.
Thanks,
Anand

Similar Messages

  • 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

  • Newbie help please:  "Validation of XML file failed."

    Hopefully my question is short and easy.
    I'm a developer and haven't used FrameMaker before. However for unforeseen reasons, I've inherited our technical help documentation constructed in FrameMaker which I've never used. Unfortunately I'm under a very tight deadline and I'm attempting to update our already existing and fairly extensive application help files.
    However, I'm getting a "Validation of XML file failed" error for 90% of our .xml help docs. I opened our .book file in FrameMaker fairly easily, and can see all of our .xml files. However the variables already embedded in the documents aren't being recognized and seem to be causing the above error. I've located our variable definition files (xml) in the concepts folder, but FrameMaker doesn't seem to recognize them. Any suggestions on what I can check or how I can get FM to refer to the variable definitions? I'm working with a new installation of FM, is there some setup I overlooked?
    Many thanks,
    dana.

    Sheila and Rick,
    Thank you both so much for your offer of help. My apologies for not replying earlier. Other 'emergencies' and priorities at work took me in other directions. It turns out another solution has been found for the time being. But thank you again for your replies. They say a lot about this community and its support. :)
    Thanks again,
    dana.

  • 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

  • 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

  • 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

  • XML File-- XI-- SAP ECC Scenario

    Hi guys,
    We have the following scenario in XI XML File>XI>SAP ECC, and we need to call a BAPI at R/3 side. Which do you think is the best way to implement this, either calling the BAPI directly from XI or using an Inbound Server Proxy ?
    Thank you.

    Hi,
        Addition to the above ensure that the BAPI Commit is called ....
    or expose the BAPI as the RFC so that the commit and rollback operations can take place in the RFC itself...
    Keep the above options during the design..n implementation...
    Recommended is RFC call rather than proxy when standards are available n  volume of the data is less..
    HTH
    Rajesh

  • I want to convert XML file into SAP Internal table

    Hi Frndz,
    My xml file is:
    <?xml version="1.0" ?>
    - <!-- Comments: START DATE :1/11/2002 11:26:14 PM
      -->
    - <!-- Comments: RFID Tags read by Mercury4 Copyright Praff@Anantara Solutions
      -->
      <RFIDs><ID>0x303030303030303035050000B5EC</ID><ID>0x300833B2DDD901403505000042E7</ID></RFIDs>
    i want to take those 2 ID's in a internal table that id field is of 28 character type....
    very urgent.
    Thanks,
    Arunprasad.P

    class cl_ixml definition load.
    type-pools: ixml.
    types: begin of t_xml_line,
             data(256) type x,
           end of t_xml_line,
           begin of tsfixml,
             data(1024) type c,
           end of tsfixml.
    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:\WINDOWS\Desktop\RFIDTags.xml'.
    *Validation of XML file: Only DTD included in xml document is supported
    parameters: pa_val type char1 as checkbox.
    start-of-selection.
    *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 ).
    *Validate a document
    if pa_val eq 'X'.
        l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
    endif.
    *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.
    *Process the document
    if l_parser->is_dom_generating( ) eq 'X'.
        perform process_dom using l_document.
    endif.
    *& 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 FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = l_filename
        FILETYPE                      = 'BIN'
      IMPORTING
        FILELENGTH                    = l_xml_table_size
      HEADER                        =
      TABLES
        DATA_TAB                      = l_xml_table
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *Writing the XML document to the screen
    CLEAR l_str1.
    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.
    WRITE: /.
    WRITE: /' XML File'.
    WRITE: /.
    LOOP AT l_itab INTO l_str1.
    REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab
    IN
    l_str1 WITH space.
    WRITE: / l_str1.
    ENDLOOP.
    WRITE: /.
    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: name2 type string,
          name_root type string,
          node_parent type ref to if_ixml_node,
          node_root type ref to if_ixml_node,
          num_children type i.
        node ?= document.
    check not node is initial.
    uline.
    write: /.
    write: /' DOM-TREE'.
    write: /.
    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.
          num_children = node->num_children( ).
          case node->get_type( ).
          when if_ixml_node=>co_node_element.
           element node
            name = node->get_name( ).
            nodemap = node->get_attributes( ).
            node_root = node->get_root( ).
            name_root = node_root->get_name( ).
            write: / 'ELEMENT :'.
            write: at indent name color col_positive inverse.
            write: 'NUM_CHILDREN:', num_children.
            write: 'ROOT:', name_root.
            node_parent = node->get_parent( ).
            name2 = node_parent->get_name( ).
            write: 'NAME2: ' , name2.
        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( ).
            write: / 'ATTRIBUTE:'.
            write: at indent name color col_heading inverse, '=',
            value color col_total inverse.
        enddo.
    endif.
    when if_ixml_node=>co_node_text or
    if_ixml_node=>co_node_cdata_section.
    *text node
    value = node->get_value( ).
    write: / 'VALUE :'.
    node_parent = node->get_parent( ).
    write: at indent value color col_group inverse.
    name2 = node_parent->get_name( ).
    write: 'NAME2: ' , name2.
    endcase.
    *advance to next node
    node = iterator->get_next( ).
    endwhile.
    endform. "process_dom
    Thanks,
    Arunprasad.P

  • How do I upload XML files into sap table?

    Dear all,
    I found some methods that upload xml into SAP,
    but there doesn’t work under 4.6c.
    Can someone tell me how to upload XML files into
    sap under 4.6c?
    THX!

    hi,
    You can convert XML to abap using transformations. Simple transformations is a proprietary SAP programming language that describes the transformation of ABAP data to XML (serialization) and from XML to ABAP data (deserialization).
    goto SE80->workbench->edit object(or other objects)->in object selection chose more tab and then choose the transformation radio button and write a name and click create new.
    Here you enter your transformation like
    <xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:sap="http://www.sap.com/sapxsl"
    >
    <xsl:strip-space elements="*"/>
    <xsl:template match="/">
      <xsl:copy-of select="."/>
    </xsl:template>
    </xsl:transform>
    You can use this transfomation in your program using call transformation. You can find more info on call transformation in help.
    Hope this helps.
    Regards,
    Richa

  • Read XML file into sap

    hi all can you please tell any way by which i can read my XML file into SAP and store it into a datavase table in SAP

    Try the below link
    Re: Converting Flat file XML format data to SAP
    may help you
    regards
    pradeep

  • Validating large xml files

    In our application we have a requirement to validate large xml file (around 40 mb) against a simple schema file.
    I have tried all options(Sax and Dom) mentioned in below article on sun site -
    http://java.sun.com/developer/EJTechTips/2005/tt1025.html
    but with all of these approches the validation process just hangs for hours.
    Even i am running my test case for this validation by allocating 1 GB memory to test case, on latest processor(core-2 duo) but still it just hangs and returns after a long duration.
    If needed i can provide sample test case, schema file and xml file.
    Please help me to know if its a problem with JAXP 1.3 Schema Validation Framework (SVF) to handle large files, or if there is any other efficient way of validating large xml file.
    Regards
    Rahul

    you may want to split the XML to 10MB each and parse the XML's separately or store in a database and read the XML using XQuery.
    I am sure there may be better ways to do this, will see experts opinions here.

  • XML File to SAP R/3 using SAP XI

    Hello Everyone,
    I'm hoping someone has done this scenario and can provide a step by step example for me.  The scenario I have is as follows:
    -- An XML file is placed manually on a UNIX SAP Server
    -- SAP XI should, once the file is placed on the server, go to a specific directory, pick the file up, and then send it to an RFC of which I've already mapped.
    -- Once the file is placed in the SAP R3 system, then the processing is over and no further processing should take place.
    -- This is an inbound message to SAP XI and also to SAP R/3
    I was thinking of using a File adapter as a "Sender", and poll every 60 seconds on a directory mentioned above.  Once the file is there, then I would call the RFC and then the mapping of the XML would put the data into R/3.
    Any help anyone can provide would be most appreciated.  Thanks in advance for your help!
    Regards,
    John

    John,
    You are looking for File -XI-RFC scenario right, please follow the below weblog
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
    If you need more details, reply!!!!
    Best regards,
    raj.

Maybe you are looking for

  • Find my iphone... wipe pending

    My phone was stolen which I reported to my network / O2. I attempted to find the handset using find my iphone but was unable to locate it. I tried to wipe the data and that remains pending (5 days now). I also set up a 4 digit key-pass which it appea

  • Copy and paste error - Text pastes at half-size.

    Copy and paste error - Text pastes at half-size. When I copy and paste text already in my photoshop document, the text retains the styling but the text size is exactly half of what it should be. I'm using the most recent version of CS6. Thanks!

  • IPad Mini freezes when adding a new mail account

    Hi, I have just bought the new iPad Mini, and when I try to set up my pop mail account, it comes back with an error saying that the SMTP server doesn't work with SSL activated, and asks if I want to try with this off. If I select yes, it attempts to

  • Studio 11 via Forte 6.2 Comparison

    I have Mot_OMCR_R19_Children.cxx file. The file a quite large. Forte 6.2 compiler takes about 9 minutes to compile it, while Studio 11 compiler is not able to compile this file. After a long work, it builds totally corrupted object file without any a

  • Basic Input/Output w/ NetBeans 4.1

    I recently switched to NetBeans 4.1 from 3.6 and now I am unable to run any of my classes requiring basic user input. In version 3.6 input was working fine, as expected. Now, when I run simple classes to test user input, null is automatically entered