XML file to ABAP report..gidance needed on approach

Hello All,
We have an existing ccBPM enabled interface between SAP-ECC and a 3rd party via PI. Currently after all the to-and-fro processing, 3rd party sends an XML FINAL-RESPONSE-FILE to PI, which resides on a folder in PI server. ( Interface ends here)
Now the requirement is that we need to enhance this interface or create a new one which would pick the XML FINAL_RESPONSE_FILE and format the XML data and present it in user-friendly form in terms of a report /alv.
What I want to know is:
1> Should we enhance the existing interface and ccBPM to wait for this final-response file to come and then trigger some BAPI or maybe a proxy to send this data to ECC for further processing.
OR
2> Should we create a sepaarte interface which picks this file asynchronously and sends to ECC for further processing.
OR
3> Should a create an ABAP report, which would pick this file from PI server and format the data and create an report out of it. ( Here I assume SAP must be havinga  fm to convert XML to some internal table readable format)...please advise if there is such an FM.
OR
4> Is there any better approach for my scenario - I am a newbie in ccBPM.
Many thanks
Shirin

Hi,
1> Should we enhance the existing interface and ccBPM to wait for this final-response file to come and then trigger some BAPI or maybe a proxy to send this data to ECC for further processing.
No...if you are planning to make the ccBPM wait then avoid this design...it will keep on utilising system resources till the response gets back...
OR
2> Should we create a sepaarte interface which picks this file asynchronously and sends to ECC for further processing.
you can try this one.....rather I would have tried this one:)
If you have a guarentee that the response will come within a stipulated time-period (say X secs...not very large) and if you are not supposed to create a new interface...then go for change in BPM
Regards,
Abhishek.

Similar Messages

  • Need to generate a Index xml file for corresponding Report PDF file.

    Need to generate a Index xml file for corresponding Report PDF file.
    Currently in fusion we are generating a pdf file using given Rtf template and dataModal source through Ess BIPJobType.xml .
    This is generating pdf successfully.
    As per requirement from Oracle GSI team, they need index xml file of corresponding generated pdf file for their own business scenario.
    Please see the following attached sample file .
    PDf file : https://kix.oraclecorp.com/KIX/uploads1/Jan-2013/354962/docs/BPA_Print_Trx-_output.pdf
    Index file : https://kix.oraclecorp.com/KIX/uploads1/Jan-2013/354962/docs/o39861053.out.idx.txt
    In R12 ,
         We are doing this through java API call to FOProcessor and build the pdf. Here is sample snapshot :
         xmlStream = PrintInvoiceThread.generateXML(pCpContext, logFile, outFile, dbCon, list, aLog, debugFlag);
         OADocumentProcessor docProc = new OADocumentProcessor(xmlStream, tmpDir);
         docProc.process();
         PrintInvoiceThread :
              out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
                   out.print("<xapi:requestset ");
                   out.println("<xapi:filesystem output=\"" + outFile.getFileName() + "\"/>");
                   out.println("<xapi:indexfile output=\"" + outFile.getFileName() + ".idx\">");
                   out.println(" <totalpages>${VAR_TOTAL_PAGES}</totalpages>");
                   out.println(" <totaldocuments>${VAR_TOTAL_DOCS}</totaldocuments>");
                   out.println("</xapi:indexfile>");
                   out.println("<xapi:document output-type=\"pdf\">");
    out.println("<xapi:customcontents>");
    XMLDocument idxDoc = new XMLDocument();
    idxDoc.setEncoding("UTF-8");
    ((XMLElement)(generator.buildIndexItems(idxDoc, am, row)).getDocumentElement()).print(out);
    idxDoc = null;
    out.println("</xapi:customcontents>");
         In r12 we have a privilege to use page number variable through oracle.apps.xdo.batch.ControlFile
              public static final String VAR_BEGIN_PAGE = "${VAR_BEGIN_PAGE}";
              public static final String VAR_END_PAGE = "${VAR_END_PAGE}";
              public static final String VAR_TOTAL_DOCS = "${VAR_TOTAL_DOCS}";
              public static final String VAR_TOTAL_PAGES = "${VAR_TOTAL_PAGES}";
    Is there any similar java library which do the same thing in fusion .
    Note: I checked in the BIP doc http://docs.oracle.com/cd/E21764_01/bi.1111/e18863/javaapis.htm#CIHHDDEH
              Section 7.11.3.2 Invoking Processors with InputStream .
    But this is not helping much to me. Is there any other document/view-let which covers these thing .
    Appreciate any help/suggestions.
    -anjani prasad
    I have attached these java file in kixs : https://kix.oraclecorp.com/KIX/display.php?labelId=3755&articleId=354962
    PrintInvoiceThread
    InvoiceXmlBuilder
    Control.java

    You can find the steps here.
    http://weblogic-wonders.com/weblogic/2009/11/29/plan-xml-usage-for-message-driven-bean/
    http://weblogic-wonders.com/weblogic/2009/12/16/invalidation-interval-secs/

  • Simple Transformation to deserialize an XML file into ABAP data structures?

    I'm attempting to write my first simple transformation to deserialize
    an XML file into ABAP data structures and I have a few questions.
    My simple transformation contains code like the following
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates"
                  xmlns:pp="http://www.sap.com/abapxml/types/defined" >
    <tt:type name="REPORT" line-type="?">
      <tt:node name="COMPANY_ID" type="C" length="10" />
      <tt:node name="JOB_ID" type="C" length="20" />
      <tt:node name="TYPE_CSV" type="C" length="1" />
      <tt:node name="TYPE_XLS" type="C" length="1" />
      <tt:node name="TYPE_PDF" type="C" length="1" />
      <tt:node name="IS_NEW" type="C" length="1" />
    </tt:type>
    <tt:root name="ROOT2" type="pp:REPORT" />
        <QueryResponse>
        <tt:loop ref="ROOT2" name="line">
          <QueryResponseRow>
            <CompanyID>
              <tt:value ref="$line.COMPANY_ID" />
            </CompanyID>
            <JobID>
              <tt:value ref="$line.JOB_ID" />
            </JobID>
            <ExportTypes>
              <tt:loop>
                <ExportType>
                   I don't know what to do here (see item 3, below)
                </ExportType>
              </tt:loop>
            </ExportTypes>
            <IsNew>
              <tt:value ref="$line.IS_NEW"
              map="val(' ') = xml('false'), val('X') = xml('true')" />
            </IsNew>
          </QueryResponseRow>
          </tt:loop>
        </QueryResponse>
        </tt:loop>
    1. In a DTD, an element can be designated as occurring zero or one
    time, zero or more times, or one or more times. How do I write the
    simple transformation to accommodate these possibilities?
    2. In trying to accommodate the "zero or more times" case, I am trying
    to use the <tt:loop> instruction. It occurs several layers deep in the
    XML hierarchy, but at the top level of the ABAP table. The internal
    table has a structure defined in the ABAP program, not in the data
    dictionary. In the simple transformation, I used <tt:type> and
    <tt:node> to define the structure of the internal table and then
    tried to use <tt:loop ref="ROOT2" name="line"> around the subtree that
    can occur zero or more times. But every variation I try seems to get
    different errors. Can anyone supply a working example of this?
    3. Among the fields in the internal table, I've defined three
    one-character fields named TYPE_CSV, TYPE_XLS, and TYPE_PDF. In the
    XML file, I expect zero to three elements of the form
    <ExportType exporttype='csv' />
    <ExportType exporttype='xls' />
    <ExportType exporttype='pdf' />
    I want to set field TYPE_CSV = 'X' if I find an ExportType element
    with its exporttype attribute set to 'csv'. I want to set field
    TYPE_XLS = 'X' if I find an ExportType element with its exporttype
    attribute set to 'xls'. I want to set field TYPE_PDF = 'X' if I find
    an ExportType element with its exporttype attribute set to 'pdf'. How
    can I do that?
    4. For an element that has a value like
    <ErrorCode>123</ErrorCode>
    in the simple transformation, the sequence
    <ErrorCode>  <tt:value ref="ROOT1.CODE" />  </ErrorCode>
    seems to work just fine.
    I have other situations where the XML reads
    <IsNew value='true' />
    I wanted to write
    <IsNew>
            <tt:value ref="$line.IS_NEW"
            map="val(' ') = xml('false'), val('X') = xml('true')" />
           </IsNew>
    but I'm afraid that the <tt:value> fails to deal with the fact that in
    the XML file the value is being passed as the value of an attribute
    (named "value"), rather than the value of the element itself. How do
    you handle this?

    Try this code below:
    data  l_xml_table2  type table of xml_line with header line.
    W_filename - This is a Path.
      if w_filename(02) = '
        open dataset w_filename for output in binary mode.
        if sy-subrc = 0.
          l_xml_table2[] = l_xml_table[].
          loop at l_xml_table2.
            transfer l_xml_table2 to w_filename.
          endloop.
        endif.
        close dataset w_filename.
      else.
        call method cl_gui_frontend_services=>gui_download
          exporting
            bin_filesize = l_xml_size
            filename     = w_filename
            filetype     = 'BIN'
          changing
            data_tab     = l_xml_table
          exceptions
            others       = 24.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
                     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.

  • Creating an xml file from abap code

    Hello All,
    Please let me know which FM do I need to execute in order to create an XML file from my ABAP code ?
    Thanks in advance,
    Paul.

    This has been discussed before
    XML files from ABAP programs

  • How to retrieve data from xml file into obiee reports

    Hi all,
    I've got a situation here. A xml file is stored as blob in oracle database table. Now i need to retrieve data/info from that xml file into obiee reports. How am i supposed to proceed with this ?

    I will go for a table function:
    http://gerardnico.com/wiki/database/oracle/table_function
    In two words, you can create a function that behave as a table. Then you create a function to pick up your xml, you parse it and you send back the rows.
    I know that Oracle has also a library for XML files but I never use it until now.
    Success
    Nico

  • Parsing XML Files to ABAP

    Hello All,
    There is a requirement for parsing of XML files to ABAP.
    1.How do we pick an XML file from Application server and also from FTP server?
    2.After picking the XML file how to parse that XML file to process it to create material master?

    Hi,
    Ur scenario is File to R/3
    For creating material master ..i guess there is IDoc named MATMAS.
    U can make use of it and execute File to IDoc Scenario.
    link for File to IDoc--
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/fileToIDOC&
    U need to pick XML file from FTP server...No need to parse XML file...just create data type which represents ur xml file structure and map it to IDoc fields.
    regards,
    Manisha

  • How to create .csv file from ABAP report

    Hi
    We have a requirement to generate .csv file from abap report.
    Currently user saves data from abap report to spreadsheet(.xls format) in desktop.  Then opens excel file and save as .csv format.  Need option to save directly in .csv format instead of .xls format.
    Please let me know, if there is any standard function module available to create .csv file.
    Regards
    Uma

    I tried with your code it's going to dump
    REPORT ZTEMP101 message-id 00.
    tables: lfa1.
    types: begin of t_lfa1,
          lifnr like lfa1-lifnr,
          name1 like lfa1-name1,
          end of t_lfa1.
    data: i_lfa1 type standard table of t_lfa1,
          wa_lfa1 type t_lfa1.
    types truxs_t_text_data(4096) type c occurs 0.
    data: csv_converted_table type table of TRUXS_T_TEXT_DATA.
    select-options: s_lifnr for lfa1-lifnr.
    select lifnr name1 from lfa1 into table i_lfa1
           where lifnr in s_lifnr.
    CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
    EXPORTING
       I_FIELD_SEPERATOR          = ';'
             I_LINE_HEADER              =
             I_FILENAME                 =
             I_APPL_KEEP                = ' '
      TABLES
        I_TAB_SAP_DATA             = I_LFA1
    CHANGING
       I_TAB_CONVERTED_DATA       = csv_converted_table
    EXCEPTIONS
       CONVERSION_FAILED          = 1
       OTHERS                     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      BIN_FILESIZE                  = ' '
      CODEPAGE                      = ' '
       FILENAME                      =
       'C:\Documents and Settings\ps12\Desktop\Test folder\exl.cvs'
      FILETYPE                      = 'DAT'
      MODE                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        DATA_TAB                      = csv_converted_table
      FIELDNAMES                    =
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_WRITE_ERROR              = 2
      INVALID_FILESIZE              = 3
      INVALID_TYPE                  = 4
      NO_BATCH                      = 5
      UNKNOWN_ERROR                 = 6
      INVALID_TABLE_WIDTH           = 7
      GUI_REFUSE_FILETRANSFER       = 8
      CUSTOMER_ERROR                = 9
      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.
    my version is 4.6c

  • Create XML file from ABAP with SOAP Details

    Hi,
    I am new to XML and I am not familiar with JAVA or Web Service. I have searched in SDN and googled for a sample program for creating XML document from ABAP with SOAP details. Unfortunately I couldn't find anything.
    I have a requirement for creating an XML file from ABAP with SOAP details. I have the data in the internal table. There is a Schema which the client provided and the file generated from SAP should be validating against that Schema. Schema contains SOAP details like Envelope, Header & Body.
    My question is can I generate the XML file using CALL TRANSFORMATION in SAP with the SOAP details?
    I have tried to create Transformation (Transaction XSLT_TOOL) in SAP with below code. Also in CALL transformation I am not able to change the encoding to UTF-8. It's always show UTF-16.
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:template match="/">
        <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
          <SOAP:Header>
            <CUNS:HeaderInfo>
              <CUNS:InterfaceTypeId>10006</InterfaceTypeId>
              <CUNS:BusinessPartnerID>11223344</BusinessPartnerID>
              <CUNS:SchemaVersion>1.0</SchemaVersion>
              <CUNS:DateTime>sy-datum</DateTime>
            </CUNS:HeaderInfo>
          </SOAP:Header>
          <SOAP:Body>
            <xsl:copy-of select="*"/>
          </SOAP:Body>
        </SOAP:Envelope>
      </xsl:template>
    </xsl:transform>
    In ABAP program, I have written below code for calling above Transformation.
      call transformation ('Z_ID')
           source tab = im_t_output[]
           result xml xml_out.
      call function 'SCMS_STRING_TO_FTEXT'
        exporting
          text      = xml_out
        tables
          ftext_tab = ex_t_xml_data.
    Please help me how to generate XML file with SOAP details from ABAP. If anybody have a sample program, please share with me.
    Is there any easy way to create the XML file in CALL Transformation. Please help.
    Thanks

    Try ABAP forum, as it seems not to be PI related.

  • Transforming XML File to abap structure

    Hello,
    I am working in a new project for making an input interface.
    The problem to resolv is :
    1>Reading an XML file on a unix Server
    2>Transforming this file in abap structure with the instruction
    call transformation.
    Format of the input file :
    <LISTEART>
    <ART code="A01" label="Designation A01"/>
    <ART code="A02" label="Designation A02"/>
    <ART code="A03" label="Designation A03"/>
    <ART code="A04" label="Designation A04"/>
    <ART code="A05" label="Designation A05"/>
    </LISTEART>
    Format of the abap structure :
    DATA : BEGIN OF ws_art,
      code(4)      TYPE c,
      label(3)  TYPE c,
    END OF ws_art.
    DATA : wt_art LIKE ws_art OCCURS 0 WITH HEADER LINE.
    is it possible to transform the input file to an internal table
    with the call transformation ?
    CALL TRANSFORMATION transfo
       SOURCE XML xml_string
       RESULT para = result.
    Somebody can explain me how to create links between xml file
    and abap structure ?
    with regards 
    JLuc Ledoux
    [email protected]

    Hi,
    try like this.
    TYPES: BEGIN OF day,
    name TYPE string,
    work(1) TYPE c,
    END OF day.
    DATA: BEGIN OF week,
    day1 TYPE day,
    day2 TYPE day,
    day3 TYPE day,
    day4 TYPE day,
    day5 TYPE day,
    day6 TYPE day,
    day7 TYPE day,
    END OF week.
    DATA xml_string TYPE string.
    DATA result LIKE week.
    week-day1-name = 'Monday'. week-day1-work = 'X'.
    week-day2-name = 'Tuesday'. week-day2-work = 'X'.
    week-day3-name = 'Wednesday'. week-day3-work = 'X'.
    week-day4-name = 'Thursday'. week-day4-work = 'X'.
    week-day5-name = 'Friday'. week-day5-work = 'X'.
    week-day6-name = 'Saturday'. week-day6-work = ' '.
    week-day7-name = 'Sunday'. week-day7-work = ' '.
    CALL TRANSFORMATION ...
    SOURCE root = week
    RESULT XML xml_string.
    CALL TRANSFORMATION ...
    SOURCE XML xml_string
    RESULT root = result.
    Regards,
    Vijay

  • How I could generate an XML file from a report in version 4.0B

    Good morning,
    How could I generate an XML file from a report? Please note that I am using version 4.0B
    I don't have access to
    Billy Vital

    Hi,
            In the Class CL_XML_DOCUMENT,
                 we have a method  EXPORT_TO_FILE to download an XML file.

  • Reading and printing the pdf file in  abap reports.

    Hello friends .
    how to read  pdf file and print the contents of the  pdf file in abap reports.?
    Edited by: Shivanand Kalagi on Jan 11, 2008 12:47 PM

    HI Brad Bohn,
      Issue is not only with the file damaged.
      My requirement is to place the PDF file in FTP folder using FTP_COMMAND, FTP_R3_TO_SERVER Function Modules.
      I'm placing the PDF sucessfully in FTP Folder. When i try to open it's showing the  "File cannot be opened because it's damaged....".
    I'm not sure whether i'm placing the PDF file in correct way.
    Regards,
    Saran

  • Import XML file into ABAP WD

    Hi,
    Is there any way to upload an XML file into ABAP WD?
    I just saw a blog for Java WD.
    <a href="/people/johann.marty/blog/2006/10/03/create-a-web-dynpro-tree-from-an-xml-file:///people/johann.marty/blog/2006/10/03/create-a-web-dynpro-tree-from-an-xml-file
    Is there a similar facility in ABAP WD?
    Regards,
    Haresh.

    hey u can do this by using CALL Transformation id.. command..
    here is the example code where i wrote this to convert it DATA to XML format...it may help u..
      DATA : BEGIN OF l_xml_tab OCCURS 0,
              a(100) TYPE c,
             END OF l_xml_tab.
      DATA : xml_out TYPE string .
      DATA : lw_xml_tab LIKE LINE OF l_xml_tab.
    XML
      CALL TRANSFORMATION id "('ID')
      SOURCE tab = gt_outtab[]
      RESULT XML xml_out.
    Convert to TABLE
      CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'
        EXPORTING
          i_string         = xml_out
          i_tabline_length = 100
        TABLES
          et_table         = l_xml_tab.
      OPEN DATASET p_lgfil1 FOR OUTPUT IN BINARY MODE.
      LOOP AT l_xml_tab INTO lw_xml_tab.
        TRANSFER lw_xml_tab TO p_lgfil1.
      ENDLOOP.
      CLOSE DATASET p_lgfil1.

  • Store/persist XML file on ABAP stack

    Hi everybody,
    as the ABAP Database is a relational DB, I wonder where to store a XML file. Is there a dedicated table?
    Thanks
    Regards Mario
    Edited by: Mario Müller on Sep 10, 2008 2:21 AM

    hi
    try with this function module SMUM_XML_PARSE for parsing xml document into a table structure
    also check this document for how an abap prog take xml and convert into an abap internal table
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f50dcd4e-0501-0010-3596-b686a7b51492
    convert an xml file into abap internal table using sap dom approach
    XML DOM Processing in ABAP part II - Convert an XML file into an ABAP table using SAP DOM Approach.
    regards
    kummari

  • Reading XML files into ABAP

    Hello folks,
    I've been struggling and I need to figure out how to read a field from an XML field into ABAP. I'm writing this method and I need to call this field from my XML file. Can you guys please give me suggestions? Please advise. I will appreciate your time. Thanks in advance.
    Ol.

    *& Report z_xit_xml_check
    report z_xit_xml_check.
    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
    'd:\joao\desenvolvimentos\fi\fact\teste.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.
    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 :'.
    mjprocha
    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

  • Issue in Creation of XML file from ABAP data

    Hi,
    I need to create a XML file, but am not facing some issues in creation of XML file, the in the required format.
    The required format is
    -<Header1 1st field= u201CValueu201D 2nd field= u201CValueu201D>
       - <Header2 1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 10 fields>
              <Header3 1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 6 fields/>
              <Header4  1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 4 fields/.>
               <Header5 1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 6 fields/>
          </Header2>
       </Header1>
    Iu2019m using the call transformation to convert ABAP data to XML file.
    So please anybody can help how to define XML structure in transaction XSLT_TOOL.
    And one more thing, here I need to put the condition to display the Header 3, Header 4, Header 5 values. If there is no record for a particular line item in header 3, 4 & 5, I donu2019t want to display full line items; this is only for Header 3, 4 & 5.
    Please help me in this to get it resolved.

    Hello,
    you can use CALL TRANSFORMATION id, which will create a exact "print" of the ABAP data into the XML.
    If you need to change the structure of XML, you can alter your ABAP structure to match the requirements.
    Of course you can create your own XSLT but that is not that easy to describe and nobody will do that for you around here. If you would like to start with XSLT, you´d better start the search.
    Regards Otto

Maybe you are looking for