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

Similar Messages

  • 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

  • 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

  • Upload any XML file to internal table

    Hi,
    I'm writing a FM to upload any XML file (Which means I don't know the structure) to a internal table.
    I tried to use FM 'GUI_UPLOAD' and CALL TRANSFORMATION ('ID'). But the problem is that, the RESULT tab of CALL TRANSFORMATION ('ID') needs to define the structure of the table for the corresponding XML file, otherwise it will not work. For example, I want to get the result table like this:
      CALL TRANSFORMATION ('ID')
      SOURCE XML xmlupl
      RESULT tab = <tab>.
    Then it will give me a run time error 'CX_XSLT_FORMAT_ERROR' because I didn't give a specific structure for <tab>.
    Any solution for my situation?
    Thanks.

    Where is your XLST file for the call transformation ID
    From ABAP to XML you can do it as dynamic, but XML to ABAP you need a XLST to convert.
    otherwise please look at this

  • Error when Uploading _fmb.xml files

    Hi...
    I'm a newbie in Apex. I'm trying to create a migration project (ie migrating Oracle Forms 6i/10g to xml via Apex). I've converted the *.fmb files to _fmb.xml using frmf2xml.bat utility. My problem is when I tried to upload the _fmb.xml, this error appears:
    +1 error has occurred+
    +•Select the Forms File you want to upload. For Forms Modules, upload the XML file which is generated by the Forms2XML conversion tool, containing the information of your Forms Module. (Go to error)+
    the error message is - javascript:apex.jQuery('#P3_FORMS_XML_FILE').focus();void(0)
    the url returns: http://localhost:8080/apex/wwv_flow.accept
    I've also tried to upload any type of file but it still returns the same error message. Please, anyone can help me...
    Thanks.

    when i tried the online workspace as in http://apex.oracle.com/pls/apex/, i successfully created the migration project. But still failed to do it locally. Obviosly my locally setup Apex is having problem uploading the _fmb.xml files. Where have i gone wrong? Could anyone please help me?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to upload an XML file into another system

    Hi friends,
    I have a requirement where I need to upload an  XML file into one system
    which has been downloaded  using  another  system.
    I have tried using the method ' cl_gui_frontend_services=>gui_upload'
    to upload the file but it is going for dump.
    I have used the  method ' w_xml->import_from_file' also,
    but it is also going for dump ,because  both methods are using the same FM
    ' GUI_UPLOAD'.
    Can any one suggest on this.
    Regards,
    Bhargavi.D

    "Here is the  Explaination for uploading the XML   Format file to sap   " through ABAP Program ....
    1. Basically you simply have to convert the XML file into the proper IDoc format. There are many ways to achieve this. One solution would be to convert it externally to SAP, e.g. via VB Script or with an XSLT transformation. Or you use the built in SAP functions for importing an IDoc from an XML stream.
    2. Uploading a file is either done via GUI_UPLOAD or via the usual way of reading a file from the application server (Open dataset. Read dataset) But what do you mean by "send to external system"? Do you want to convert an IDoc into XML? Then you simply define an XML port with WE21 to send the IDoc out.
    Here is an example of code that loads an XML from file and posts it as an IDoc. Please keep in mind that the XML has to be in its canonical format as described in the interface repository: ifr.sap.com (choose the template of the desired IDoc from there as an example).
    data: data_tab type table of char1024.
    data: XML_STREAM type string.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'D:test.xml'
    *   FILETYPE                      = 'ASC'
    *   HAS_FIELD_SEPARATOR           = ' '
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   CHECK_BOM                     = ' '
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
      TABLES
        DATA_TAB                      = DATA_TAB
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'CONVERT_TABLE_TO_STRING'
      EXPORTING
        I_TABLINE_LENGTH       = '1024'
      IMPORTING
        E_STRING               = XML_STREAM
      TABLES
        IT_TABLE               = DATA_TAB[].
    write: / xml_stream color col_total.
    data: CONTENT_LENGTH type string.
    data: CONTENT_TYPE type string.
    data: REMOTE_ADDR type string.
    CALL FUNCTION 'IDOC_INBOUND_XML_VIA_HTTP'
      EXPORTING
        XML_STREAM                      = XML_STREAM
        CONTENT_LENGTH                  = content_type
        CONTENT_TYPE                    = content_type
        REMOTE_ADDR                     = remote_addr
    EXCEPTIONS
       NO_IDOCS_SAVED                  = 1
       TAG_ERROR                       = 2
       NO_DATA_RECEIVED                = 3
       NO_IDOCS_RECEIVED               = 4
       SEGMENT_ERROR                   = 5
       IDOC_WAS_SEND_SECOND_TIME       = 6
       OTHERS                          = 7
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    write: / sy-subrc color COL_NEGATIVE.
    ENDIF.
    reward  points if it is usefull.......
    Girish

  • How to upload a XML file to Servlet

    Hi,
    I am new to Java, I have to upload an XML file to java/j2ee server. The web server running on the server is "Tomcat 4.1". My new requirement is I have to upload an "Input.XML" file, can you please tell me how to upload an XML file. If any samples appriciated very soon.
    Thanks & Regards,

    Hi!
    On the client side, the client's browser must support form-based upload. Most modern browsers do, but there's no guarantee. For example,
    <FORM ENCTYPE='multipart/form-data'
    method='POST' action='/myservlet'>
    <INPUT TYPE='file' NAME='mptest'>
    <INPUT TYPE='submit' VALUE='upload'>
    </FORM>
    The input type &quot;file&quot; brings up a button for a file select box on the browser together with a text field that takes the file name once selected. The servlet can use the GET method parameters to decide what to do with the upload while the POST body of the request contains the file data to parse.
    When the user clicks the "Upload" button, the client browser locates the local file and sends it using HTTP POST, encoded using the MIME-type multipart/form-data. When it reaches your servlet, your servlet must process the POST data in order to extract the encoded file. You can learn all about this format in RFC 1867.
    Unfortunately, there is no method in the Servlet API to do this. Fortunately, there are a number of libraries available that do. Some of these assume that you will be writing the file to disk; others return the data as an InputStream.
    You can see more things about Servlet on this website [http://pedrofao.blogspot.com|http://pedrofao.blogspot.com].

  • How do I upload an XML file to salesforce using BULK API?

    Hi There,
    Please let me know how do we upload an XML file to salesforce using Bulk API?
    Thanks,
    ET

    Hi,
    I think that this is a more SalesForce.com question and think you will have more chance looking at SOAP API Developer's Guide for salesforce. Sending a SOAP request from the API Server is very straight forward and there are several tutorials and well documented about this.
    Cheers,
    Stefan

  • Upload an xml file as a clob

    Can you give me an example of uploading an xml file from c:\test.xml to and oracledb where the field type is clob?

    I think the following error from sqlplus indicates there was an issue loading the xml file
    SQL> execute LOAD_XML(p_dir => 'XML_DIR', p_filename => 'test.xml');
    BEGIN LOAD_XML(p_dir => 'XML_DIR', p_filename => 'test.xml'); END;
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00210: expected '<' instead of '?'
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    ORA-06512: at "SYS.LOAD_XML", line 12
    ORA-06512: at line 1

  • Reading XML file using BAPI and then uploading that xml file data into SAP

    I am getting a xml file from Java server. I need to take
    data from this file using BAPI and need to upload into SAP using SAP.
    Please tell me how to read XML files using BAPI's.

    <b>SDIXML_DATA_TO_DOM</b> Convert SAP data (elementary/structured/table types) into DOM (XML
    <b>SDIXML_DOM_TO_XML</b>  Convert DOM (XML) into string of bytes that can be downloaded to PC or application server
    <b>SDIXML_DOM_TO_SCREEN</b> Display DOM (XML)
    <b>SDIXML_DOM_TO_DATA</b>
    data: it_table like t001 occurs 0.
    data: l_dom      TYPE REF TO IF_IXML_ELEMENT,
          m_document TYPE REF TO IF_IXML_DOCUMENT,
          g_ixml     TYPE REF TO IF_IXML,
          w_string   TYPE XSTRING,
          w_size     TYPE I,
          w_result   TYPE I,
          w_line     TYPE STRING,
          it_xml     TYPE DCXMLLINES,
          s_xml      like line of it_xml,
          w_rc       like sy-subrc.
    start-of-selection.
      select * from t001 into table it_table.
    end-of-selection.
    initialize iXML-Framework          ****
      write: / 'initialiazing iXML:'.
      class cl_ixml definition load.
      g_ixml = cl_ixml=>create( ).
      check not g_ixml is initial.
      write: 'ok'.
    create DOM from SAP data           ****
      write: / 'creating iXML doc:'.
      m_document = g_ixml->create_document( ).
      check not m_document is initial.
      write: 'ok'.
      write: / 'converting DATA TO DOM 1:'.
      CALL FUNCTION 'SDIXML_DATA_TO_DOM'
        EXPORTING
          NAME               = 'IT_TABLE'
          DATAOBJECT         = it_table[]
        IMPORTING
          DATA_AS_DOM        = l_dom
        CHANGING
          DOCUMENT           = m_document
        EXCEPTIONS
          ILLEGAL_NAME       = 1
          OTHERS             = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
      check not l_dom is initial.
      write: / 'appending DOM to iXML doc:'.
      w_rc = m_document->append_child( new_child = l_dom ).
      if w_rc is initial.  write  'ok'.
      else.                write: 'Err =', w_rc.
      endif.
    visualize iXML (DOM)               ****
      write: / 'displaying DOM:'.
      CALL FUNCTION 'SDIXML_DOM_TO_SCREEN'
        EXPORTING
          DOCUMENT          = m_document
        EXCEPTIONS
          NO_DOCUMENT       = 1
          OTHERS            = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
    convert DOM to XML doc (table)     ****
      write: / 'converting DOM TO XML:'.
      CALL FUNCTION 'SDIXML_DOM_TO_XML'
        EXPORTING
          DOCUMENT            = m_document
        PRETTY_PRINT        = ' '
        IMPORTING
          XML_AS_STRING       = w_string
          SIZE                = w_size
        TABLES
          XML_AS_TABLE        = it_xml
        EXCEPTIONS
          NO_DOCUMENT         = 1
          OTHERS              = 2.
      if sy-subrc = 0.   write  'ok'.
      else.              write: 'Err =', sy-subrc.
      endif.
      write: / 'XML as string of size:', w_size, / w_string.
      describe table it_xml lines w_result.
      write: / 'XML as table of', w_result, 'lines:'..
      loop at it_xml into s_xml.
        write s_xml.
      endloop.
      write: / 'end of processing'.
    end of code
    Hope this will be useful.
    regards
    vinod

  • Help regarding uploading an xml file

    Hi All
    I have to upload data from an xml file.
    I guess the function module SMUM_XML_PARSE can be used for achieving this. But can anybody please tell me the exact procedure to use this function module.
    The program is going for a dump showing a CALL_FUNCTION_CONFLICT_TYPE error.
    The code is as follows
    data: stab like smum_xmltb occurs 0 with header line.
    data: ret1 like bapiret2 occurs 0.
          call function 'SMUM_XML_PARSE'
            exporting
              xml_input       = 'C:TEST.XML'
            tables
              xml_table       = stab
              return          = ret1
    loop at stab.
      write:/ stab-hier,stab-type.
    endloop.
    Thanks in advance
    Sree Ramya

    hii
    as for fm
    CALL FUNCTION 'SMUM_XML_PARSE'
    EXPORTING
    XML_INPUT = inputstring
    TABLES
    XML_TABLE = xmltab
    RETURN = ZBAPIRET2.
    This function module converts yr xml file i.e. in inputstring into zmltab table. Then U can loop on table to check the content.
    go thru this link
    http://www.geocities.com/victorav15/sapr3/abapfun.html#xml
    and also refer the example
    check this code
    1. Convert internal table to XML.
    Here is a sample program to convert internal table to XML
    *& Report ZTESTXML *
    Report ZPRUEBA_MML_13 *
    Export an internal table to XML document *
    NO BORRAR ESTE CODIGO *
    report zprueba_mml_13.
    PANTALLA SELECCION *
    parameters: gk_ruta type rlgrap-filename.
    PANTALLA SELECCION *
    TYPE TURNOS *
    types: begin of turnos,
    lu like t552a-tpr01,
    ma like t552a-tpr01,
    mi like t552a-tpr01,
    ju like t552a-tpr01,
    vi like t552a-tpr01,
    sa like t552a-tpr01,
    do like t552a-tpr01,
    end of turnos.
    TYPE TURNOS *
    TYPE SOCIO *
    types: begin of socio,
    numero like pernr-pernr,
    reposicion like pa0050-zauve,
    nombre like pa0002-vorna,
    turnos type turnos,
    end of socio.
    TYPE SOCIO *
    ESTRUCTURA ACCESOS *
    data: begin of accesos occurs 0,
    socio type socio,
    end of accesos.
    ESTRUCTURA ACCESOS *
    START OF SELECTION *
    start-of-selection.
    perform llena_accesos.
    perform descarga_xml.
    end-of-selection.
    END OF SELECTION *
    FORM LLENA_ACCESOS *
    form llena_accesos.
    refresh accesos.
    clear accesos.
    move: '45050' to accesos-socio-numero,
    'MOISES MORENO' to accesos-socio-nombre,
    '0' to accesos-socio-reposicion,
    'T1' to accesos-socio-turnos-lu,
    'T2' to accesos-socio-turnos-ma,
    'T3' to accesos-socio-turnos-mi,
    'T4' to accesos-socio-turnos-ju,
    'T5' to accesos-socio-turnos-vi,
    'T6' to accesos-socio-turnos-sa,
    'T7' to accesos-socio-turnos-do.
    append accesos.
    clear accesos.
    move: '45051' to accesos-socio-numero,
    'RUTH PEÑA' to accesos-socio-nombre,
    '0' to accesos-socio-reposicion,
    'T1' to accesos-socio-turnos-lu,
    'T2' to accesos-socio-turnos-ma,
    'T3' to accesos-socio-turnos-mi,
    'T4' to accesos-socio-turnos-ju,
    'T5' to accesos-socio-turnos-vi,
    'T6' to accesos-socio-turnos-sa,
    'T7' to accesos-socio-turnos-do.
    append accesos.
    endform. "LLENA_ACCESOS
    FORM LLENA_ACCESOS *
    FORM DESCARGA_XML *
    form descarga_xml.
    data: l_dom type ref to if_ixml_element,
    m_document type ref to if_ixml_document,
    g_ixml type ref to if_ixml,
    w_string type xstring,
    w_size type i,
    w_result type i,
    w_line type string,
    it_xml type dcxmllines,
    s_xml like line of it_xml,
    w_rc like sy-subrc.
    data: xml type dcxmllines.
    data: rc type sy-subrc,
    begin of xml_tab occurs 0,
    d like line of xml,
    end of xml_tab.
    class cl_ixml definition load.
    g_ixml = cl_ixml=>create( ).
    check not g_ixml is initial.
    m_document = g_ixml->create_document( ).
    check not m_document is initial.
    write: / 'Converting DATA TO DOM 1:'.
    call function 'SDIXML_DATA_TO_DOM'
    exporting
    name = 'ACCESOS'
    dataobject = accesos[]
    importing
    data_as_dom = l_dom
    changing
    document = m_document
    exceptions
    illegal_name = 1
    others = 2.
    if sy-subrc = 0.
    write 'Ok'.
    else.
    write: 'Err =',
    sy-subrc.
    endif.
    check not l_dom is initial.
    w_rc = m_document->append_child( new_child = l_dom ).
    if w_rc is initial.
    write 'Ok'.
    else.
    write: 'Err =',
    w_rc.
    endif.
    call function 'SDIXML_DOM_TO_XML'
    exporting
    document = m_document
    importing
    xml_as_string = w_string
    size = w_size
    tables
    xml_as_table = it_xml
    exceptions
    no_document = 1
    others = 2.
    if sy-subrc = 0.
    write 'Ok'.
    else.
    write: 'Err =',
    sy-subrc.
    endif.
    loop at it_xml into xml_tab-d.
    append xml_tab.
    endloop.
    call function 'WS_DOWNLOAD'
    exporting
    bin_filesize = w_size
    filename = gk_ruta
    filetype = 'BIN'
    tables
    data_tab = xml_tab
    exceptions
    others = 10.
    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. "DESCARGA_XML
    FORM DESCARGA_XML *
    2. To convert XML to internal table.
    You can use these function modules
    TEXT_CONVERT_XML_TO_SAP or
    SDIXML_DOM_TO_XML Convert DOM (XML) into string of bytes that can be downloaded to PC or application server
    or
    SMUM_XML_PARSE (Parse XML docment into a table structure)
    You can also refer to these:
    SMUM_XML_CREATE (Create XML document from internal table)
    SMUM_XML_CREATE_X (Create XSTRING xml doc)
    Check this code, it converts an XML data into a string internal table.
    REPORT Z_XML_TO_TABLE.
    TYPE-POOLS: ixml.
    TYPES: BEGIN OF t_xml_line,
    data(256) TYPE x,
    END OF t_xml_line.
    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:     emporders_dtd.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 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.
    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.
    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.
    CASE node->get_type( ).
    WHEN if_ixml_node=>co_node_element.
    element node
    name = node->get_name( ).
    nodemap = node->get_attributes( ).
    WRITE: / 'ELEMENT :'.
    WRITE: AT indent name COLOR COL_POSITIVE INVERSE.
    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 :'.
    WRITE: AT indent value COLOR COL_GROUP INVERSE.
    ENDCASE.
    advance to next node
    node = iterator->get_next( ).
    ENDWHILE.
    ENDFORM. "process_dom
    Regards
    Naresh

  • XML data upload from .xml file

    Hi,
    Can anyone let me know is ther any way how I can upload the data from .xml file into Oracle Table.
    Note: I just want to upload the data from xml file; not entire .xml file.
    I have data like as below in test.xml file and I want to upload the data only into TEST_EMP table:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <TABLE_NAME>DEPT</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="2">
    <TABLE_NAME>EMP</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="3">
    <TABLE_NAME>BONUS</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="4">
    <TABLE_NAME>SALGRADE</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="5">
    <TABLE_NAME>BHAVESH_EMP</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    </ROWSET>
    Any help would be highly appreciated!!
    Thanks... Bhavesh

    One way is to use sql* loader...
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb25loa.htm

  • How to upload a XML File in database

    i use Blob type to set domain the Xml file. But i don't know use what class to define it.i only know use OrdHttpUploadFile to define a image. What class do i use to define a Xml file.

    during my tries to adapt this code to my needs, following error occured during compilation of the procedure:
    PLS-00201: identifier 'IMAGES.MIME_TYPE' must be declared
    here is my procedure:
    CREATE OR REPLACE PROCEDURE load_file( file_name VARCHAR2 )
    AS file_lob BFILE;
    binary_lob BLOB;
    mime_type images.mime_type%TYPE;
    extension_pos NUMBER;
    BEGIN
    --Use the extension of the file name to determing the MIME-type 
    --The MIME-type for a .pdf file will be application/pdf
    extension_pos := INSTR( file_name, '.' );
    mime_type := 'application/' || SUBSTR( file_name,extension_pos + 1,LENGTH( file_name ) );
    -- Insert a new row into the images table. Get the LOB locator
    -- for the newly inserted row
    -- we will be using that to insert
    -- the content from the file.
    INSERT INTO TESTBLOB( blobid, filename, mime_type, content )
    VALUES( 1, file_name, mime_type, EMPTY_BLOB() )
    RETURNING content INTO binary_lob;
    -- Open up the file in the IMAGES directory named file_name,
    -- load that file into the newly created LOB locator, and
    -- close the file
    file_lob := BFILENAME( 'TESTDIRECTORY', file_name );
    dbms_lob.fileOpen ( file_lob, dbms_lob.file_readOnly );
    dbms_lob.loadFromFile( binary_lob,file_lob,dbms_lob.getLength( file_lob ) );
    dbms_lob.fileClose ( file_lob );
    END;
    how do I have to adjust the declaration of the mime_type variable respectively what does images.mime_type%TYPE mean?
    katharina

  • Hi All , validating the overlapped periods ,Uploading the xml file to sap

    Hi All,
    please provide me the logic for the following requirement: Its an urgent .
    Upload Global exception periods via File:
              A customized transaction will be created for uploading the global exception periods using
              an excel file. User has to maintain the global exception periods in an excel sheet with the 
              below mentioned format and upload the file manually into the system.  The global
              exceptions are maintained at step of half hourly period with a factor value.
              Please find the format followed for maintaining the global exception periods in the
              excel sheet.
    Date From      Period From     Date To     Period To     Factor value
    06.02.2008     12     06.02.2008     14     1.2
    07.02.2008     1     07.02.2008     2     1.4
    07.02.2008     3     07.02.2008     4     1.2
    07.02.2008     5     07.02.2008     6     1.6
    07.02.2008     7     07.02.2008     8     1.1
          Once user uploads the excel file and press execute button, file contents are downloaded
          and the global exception periods are updated into ZLF_GEXCEPTION table. Please refer        
          the necessary table format for details.
                During the upload of global exception periods, the periods are checked if it is overlapping
                 with the previously uploaded periods. For those overlapping periods, below method is
                followed. 
    1.     For e. g,  If a below exception period is already uploaded,
       Date From     Period From        Date To      Period To         Factor value
       06.02.2008       12                     06.02.2008      16               1.4     
    The new file contains the period which gets overlapped with the previous global
    exception period.
       Date From     Period From        Date To      Period To         Factor value
        06.02.2008       14                     06.02.2008      15               1.6     
    The overlapped periods are split accordingly,
    Date From     Period from        Date to      Period To                   Factor value
      06.02.2008       12                   06.02.2008      13               1.4     
      06.02.2008       14                   06.02.2008      15               1.6
      06.02.2008       16                   06.02.2008      16               1.4
    2.For e.g., Already existing period, 
       Date From     Period From        Date To      Period To         Factor value
        06.02.2008       12                     07.02.2008      16          1.3
       New period,
    Date From     Period From        Date To         Period To         Factor value
      07.02.2008       5                     07.02.2008      8          1.7
    The Global exception periods are split into,
       Date From     Period From        Date To      Period To         Factor value
        06.02.2008       12                     07.02.2008      4          1.3
        07.02.2008       5                     07.02.2008      8          1.7
        07.02.2008       9                     07.02.2008      16          1.3
          If any error occurs while updating the global exception periods into ZLF_GEXCEPTION
          table, then display LF-001 message given below the Error messages section. For the
          successful updating of global exception periods to ZLF_GEXCEPTION table, then
          display the message “Successfully completed”.
                 User will be provided an option to download the global exception periods into an excel
                 file. User has to provide the necessary location details where to download the file while
                 downloading.
    Thanks&Regards.
    Bk

    Hi All,
    please provide me the logic for the following requirement: Its an urgent .
    Upload Global exception periods via File:
              A customized transaction will be created for uploading the global exception periods using
              an excel file. User has to maintain the global exception periods in an excel sheet with the 
              below mentioned format and upload the file manually into the system.  The global
              exceptions are maintained at step of half hourly period with a factor value.
              Please find the format followed for maintaining the global exception periods in the
              excel sheet.
    Date From      Period From     Date To     Period To     Factor value
    06.02.2008     12     06.02.2008     14     1.2
    07.02.2008     1     07.02.2008     2     1.4
    07.02.2008     3     07.02.2008     4     1.2
    07.02.2008     5     07.02.2008     6     1.6
    07.02.2008     7     07.02.2008     8     1.1
          Once user uploads the excel file and press execute button, file contents are downloaded
          and the global exception periods are updated into ZLF_GEXCEPTION table. Please refer        
          the necessary table format for details.
                During the upload of global exception periods, the periods are checked if it is overlapping
                 with the previously uploaded periods. For those overlapping periods, below method is
                followed. 
    1.     For e. g,  If a below exception period is already uploaded,
       Date From     Period From        Date To      Period To         Factor value
       06.02.2008       12                     06.02.2008      16               1.4     
    The new file contains the period which gets overlapped with the previous global
    exception period.
       Date From     Period From        Date To      Period To         Factor value
        06.02.2008       14                     06.02.2008      15               1.6     
    The overlapped periods are split accordingly,
    Date From     Period from        Date to      Period To                   Factor value
      06.02.2008       12                   06.02.2008      13               1.4     
      06.02.2008       14                   06.02.2008      15               1.6
      06.02.2008       16                   06.02.2008      16               1.4
    2.For e.g., Already existing period, 
       Date From     Period From        Date To      Period To         Factor value
        06.02.2008       12                     07.02.2008      16          1.3
       New period,
    Date From     Period From        Date To         Period To         Factor value
      07.02.2008       5                     07.02.2008      8          1.7
    The Global exception periods are split into,
       Date From     Period From        Date To      Period To         Factor value
        06.02.2008       12                     07.02.2008      4          1.3
        07.02.2008       5                     07.02.2008      8          1.7
        07.02.2008       9                     07.02.2008      16          1.3
          If any error occurs while updating the global exception periods into ZLF_GEXCEPTION
          table, then display LF-001 message given below the Error messages section. For the
          successful updating of global exception periods to ZLF_GEXCEPTION table, then
          display the message “Successfully completed”.
                 User will be provided an option to download the global exception periods into an excel
                 file. User has to provide the necessary location details where to download the file while
                 downloading.
    Thanks&Regards.
    Bk

  • The agent can not upload the xml file in the repository of the OMS

    Hi,
    I install an agent 10.2.0.4 HP-UX v.11.23, 64 bit, which has an Oracle database v.10.2.0.4.
    The OMS identified a single server, but no database.
    I uninstall the agent and remove the server from the OEM (html).
    I install agent again with the patch 6409645.
    Configure a security key to the agent (emctl secure agent).
    However, it generates a file error emagent.trc, when i start the agent:
    2009-04-14 12:23:05,819 Thread-1 WARN collector: MESSAGE_NLSID "Successful Name Registration Request Sent By Identity Provider(%)" is too long, truncating to "Successful Name Registration Request Sent By Identity Provider(%"
    2009-04-14 12:23:40,616 Thread-21 WARN upload: FxferSend: received http error in header from repository: https://gcontrol.manquehue.local:1159/em/upload
    ERROR-400|ORA-01861: literal does not match format string
    2009-04-14 12:23:40,619 Thread-21 ERROR upload: Failed to upload file B0000001.xml: HTTP error.
    Response received: ERROR-400|ORA-01861: literal does not match format string
    Please anyone can help me?
    David

    Hi:
    Do the following in OMS host:
    [oracle@gcontrol bin]$ ./emctl secure unlock
    Oracle Enterprise Manager 10g Release 4 Grid Control
    Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
    Checking the security status of the OMS... Done.
    Stopping the HTTP Server... Done.
    Updating HTTPS Virtual Host for Enterprise Manager OMS... Done.
    Starting the HTTP Server... Done.
    OMS Unlocked. Non Secure Agents may upload using HTTP.
    [oracle@gcontrol bin]$
    In Agent host:
    $AGENT_HOME/bin/emctl unsecure agent
    $AGENT_HOME/bin/emctl secure agent
    $AGENT_HOME/bin/emctl start agent
    $AGENT_HOME/bin/emctl status agent
    $AGENT_HOME/bin/emctl upload agent
    but the error continues:
    2009-04-16 18:08:07,700 Thread-1 WARN http: snmehl_connect: connect failed to (delfos:1830): Connection refused (error = 239)
    2009-04-16 18:08:07,700 Thread-1 ERROR main: nmectla_agentctl: Error connecting to https://delfos:1830/emd/main/. Returning status code 1
    Even start the agent without security, but the error remains. (unsecure only)
    2009-04-16 18:07:43,353 Thread-1 WARN http: snmehl_connect: connect failed to (delfos:1830): Connection refused (error = 239)
    2009-04-16 18:07:43,354 Thread-1 ERROR main: nmectla_agentctl: Error connecting to http://delfos:1830/emd/main/. Returning status code 1
    Not yet implemented $OMS_HOME/bin/emctl secure lock
    Any idea?
    Thanks for your help.
    David

Maybe you are looking for