Generation of XML

I need to download the table data into XML Format.
For that we can use Transformations. But i am using 4.6c. Here i think some of the classes wont available to use that statement.
Kindly sugggest how to approach

Hi
Use the function module
SAP_CONVERT_TO_XML_FORMAT
Example
TYPE-POOLS truxs.
DATA:
  itab TYPE TABLE OF spfli,
  itab1 TYPE truxs_xml_table,
  fs TYPE truxs_xml_line,
  w_xml TYPE xstring.
SELECT * FROM spfli INTO TABLE itab.
CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
* EXPORTING
*   I_FIELD_SEPERATOR          =
*   I_LINE_HEADER              =
*   I_FILENAME                 =
*   I_APPL_KEEP                = ' '
*   I_XML_DOC_NAME             =
* IMPORTING
*   PE_BIN_FILESIZE            =
  TABLES
    i_tab_sap_data             = itab
CHANGING
   i_tab_converted_data       = itab1
* 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.
LOOP AT itab1 INTO fs.
  WRITE:/ fs-data.
ENDLOOP.
the above works the same as this,
CALL TRANSFORMATION id SOURCE
                        source = itab
                        RESULT XML w_xml.
ULINE.
WRITE:/ w_xml.
regards
sarves

Similar Messages

  • Generation of XML file from Java objects using castor

    I have the following java file(Customer.java).
    public class Customer
         private String ID;
         private FirstName firstName;
         private MiddleName middleName;
         private LastName lastName;
         private ArrayList address;
         public ArrayList getAddress() {
              return address;
         public void setAddress(ArrayList address) {
              this.address = address;
         public FirstName getFirstName() {
              return firstName;
         public void setFirstName(FirstName firstName) {
              this.firstName = firstName;
         public String getID() {
              return ID;
         public void setID(String id) {
              ID = id;
         public LastName getLastName() {
              return lastName;
         public void setLastName(LastName lastName) {
              this.lastName = lastName;
         public MiddleName getMiddleName() {
              return middleName;
         public void setMiddleName(MiddleName middleName) {
              this.middleName = middleName;
    Using castor i have created an xml file(customer.xml) which has the following format.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <customer ID="fbs0001">
    <FIRSTNAME>Fred</FIRSTNAME>
    <MIDDLENAME>B</MIDDLENAME>
    <LASTNAME>Scerbo</LASTNAME>
    - <ADDRESS>
    <FIRSTLINE>No 18, Sheshadri road</FIRSTLINE>
    <SECONDLINE>Gandhinagar Bangalore</SECONDLINE>
    </ADDRESS>
    - <ADDRESS>
    <FIRSTLINE>ITPL</FIRSTLINE>
    <SECONDLINE>Whitefield Bangalore</SECONDLINE>
    </ADDRESS>
    </customer>
    I have used a mapping file to get this output.Is there a way where i can get the output xml in the following format without changing the Java object structure.If yes then please suggest how this can be done.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <customer ID="fbs0001">
    <FIRSTNAME>Fred</FIRSTNAME>
    <MIDDLENAME>B</MIDDLENAME>
    <LASTNAME>Scerbo</LASTNAME>
    </customer>
    <ADDRESS>
    <FIRSTLINE>No 18, Sheshadri road</FIRSTLINE>
    <SECONDLINE>Gandhinagar Bangalore</SECONDLINE>
    </ADDRESS>
    - <ADDRESS>
    <FIRSTLINE>ITPL</FIRSTLINE>
    <SECONDLINE>Whitefield Bangalore</SECONDLINE>
    </ADDRESS>
    I mean the output xml file should have the address as a separate tag not withing the root tag customer.

    Hello,
    Castor's own discussion groups might be able to point you to the solution you're looking for (if this use case is possible using Castor).
    Oracle has its own object-to-XML mapping tool that is part of the TopLink product. It allows you to map existing objects to an existing XML Schema. This can be done visually using the TopLink Workbench, or programmatically using the TopLink APIs. TopLink OXM also supports the JAXB specification.
    Using TopLink OXM to get the desired XML result I would recommend the following. Map the Customer and Address classes to XML, but don't map the relationship between Customer and Address. Then make the calls to the marshaller something like the following:
    marshaller.marshal(aCustomer, System.out);
    for(int x=0; x<aCustomer.getAddress().size(); x++) {
         marshal(aCustomer.getAddress().get(x), System.out);
    Example - Using TopLink OXM to map an existing object model to an existing XML Schema:
    http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp4/howto/ox/index.htm
    For more information on TopLink object-to-XML mapping:
    http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp4/objectxml/index.html
    -Blaise

  • Generation of xml file from java code

    hi,
    I want to manipulate data in a xml file with java code.I have read data from xml file and also changed it. But i am unable to covert it again in xml file from java code. Can you please tell me how i can do this?

    Let me know which parser are you using currently for reading xml files so that i assist you. For now, you can refer to STAX Parser API under this link
    http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP3.html

  • Crystal Report generation using XML

    I have some reports that were created using XML and as I recall when I created them using CR v. 9 I used a connections called ADO (Xml) or something like that. On one of my machines I have CR XI and the only option available is XML and when I add a field from this connection it inserts: "{NewDataSet\TableName.FieldName}" however, previously when I used the ADO XML connections it only inserted {TableName.FieldName}. In the version 9 CR i was using the professsional version and in the version 11 CR it is still the professional version but I can't seem to create an XML connector that doesn't prefix the table/field with "NewDataSet". My request is two fold, first, can you please direct me to some articles that I can read to better understand how to generate  CR from XML? My project is to generate the XML and then set the xml during runtime into the report using SetDataSource and then display the report using the CR viewing that I package and redist with my app. Secondly, why does the ADO XML connector not available in CR XI professional version and is there any way to get the CR v. 9 behaviour back?
    Thanks,
    Marcus

    Hi, Markus
    If you are planning to run reports from a .NET application, you need to have the Developer edition, not the professional.
    The ADO.NET Driver is not installed by default. Go into Control Panel - Add / Remove programs, and chose Crystal Reports, and change. You can expand the Database drivers, and you should see the ADO.NET driver there. Note: you need to have the .NET framework installed for this to work.
    Regards,
    Jonathan

  • Generation of XML file using DMEE format tree

    Hi Experts,
                     Can you please provide all the steps to generate a XML file using a DMEE format tree.
    Thanks in adavance!!!
    Regards,
    Vishal.

    Hi,
    you can do it exaclty the same way like creating ordinary flat file.
    You can find also some examples made by SAP. Search format tree with this pattern: XML

  • Generation of XML file out of iView

    Hi,
    Is it possible to generate the xml file with the content of the actual iView? If yes, then please tell me how it is possible?
    Thanks in advance,
    manish

    Hi Manish,
    Did you check the <b>java.beans.XMLEncoder</b> class? It has a method
    writeObject(Object o)
    which converts any object into XML.
    Greetings,
    Praveen Gudapati
    p.s. Points are always welcome for helpful answers

  • Generation of Xml file with java output

    Hi i m new to xml and java combination. I have a name value pair kind of output returning from java program. I want to generate the new xml file with the data. Could some one help me out in generating xml file with the data. Could anyone send me the java code that does this task.

    Let me know which parser are you using currently for reading xml files so that i assist you. For now, you can refer to STAX Parser API under this link
    http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP3.html

  • Generation of XML Schema according to Table structure

    Hi all !,
    I am extracting the data from the database and creating an XML file with corresponding data elements. I can do it successfully. Is there any way to generate the XML schema file based on the structure of the Table, dynamically? Please help.
    Thanks in advance.
    All efforts will be appreciated.
    Regards

    look at source code of XMLVisualisator http://ententee.com

  • Generation of XML using XSD

    I Have to generate XML file using XSD. I have the xsd available with me ,i have the values of elements also,now i need create a xml file using the XSD or DTD, with the values i got from the database.
    Kindly help.

    Create an XML file from XSD file

  • Generation of xml document of rows in table.

    hi..
    i want to generate xml document for one table.....i want all records from that table to xml...
    thank u
    sam

    create table test(col1 varchar2(10));
    insert into test values('hello1');
    insert into test values('hello2');
    insert into test values('hello3');
    insert into test values('hello4');
    commit;
    set serveroutput on;
    declare
    v_sql varchar2(1000);
    v_output clob;
    begin
    v_sql := 'select * from test';
    v_output := dbms_xmlgen.getxml(v_sql);
    dbms_output.put_line(v_output);
    end;
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <COL1>hello1</COL1>
    </ROW>
    <ROW>
    <COL1>hello2</COL1>
    </ROW>
    <ROW>
    <COL1>hello3</COL1>
    </ROW>
    <ROW>
    <COL1>hello4</COL1>
    </ROW>
    </ROWSET>
    The dbms_xmlgen can do it for you like the above example.
    Lee
    null

  • Sequence Number Generation in XML Form Buider??????

    Hi All,
    I want to generate some Sequence Number for each XML Form Generated by the XML Form Builder Application?
    Ex: my XML Form Builder Application is "MYAPP". Using this I filled data and Save, then an XML will be created, then it should have some unique Number(say 1234), then if I fill the differennt Data and Save, then another XML will be created. For this the Number should be 1235, next 1236, ........
    I can use the XML Form ID, but that is not User friendly format. Becaz I need to display this Number to the End User.
    (Example: 10b2ae7b-e269-2b10-d88e-ddade2e62015.xml)
    If anybody have idea on this, Please guide me...
    Thanks&Regards||
    Ashok M.
    Edited by: Ashok Kumar Munugoti on Oct 16, 2008 8:04 AM

    closing this Thread.

  • Generation of XML Tags for columns in Lexical parameter in select query

    Hi,
    I have lexical parameter in my select statement of my data model in the report.
    How do i generate XML tags for these columns inside a Lexical Parameter?
    Simple Example: I have data model query as follows:
    SELECT msi.inventory_item_id
    &LP_SELECT
    FROM mtl_system_items_b
    Here my lexical Parameter LP_SELECT is generated in before report trigger as follows in my report:
    :LP_SELECT := 'msi.segment1,msi.description';
    So, the question is how to generate XML Tags for columns in Lexical Parameter(as in the example above, i need XML tags for these columns - segment1 and description)
    Thanks,
    Ratan

    try this
    Select &order data_show
    from oe_order_headers_all
    where order_number ='7889'
    and setting  :order:='order_number';  in after parameter form trigger.
    Hope this helps
    Hamid

  • Report generation with XML

    We already generate reports without OracleReporter. We build a xml file and based on this file we generate reports with the report-server. But these are very easy tabular reports.
    Now we want to generate more complex reports (eg. matrix reports).
    Is anybody out there who already made this by generating xml files? Maybe there is some ready to use code for solving our problem.
    andreas

    Hello,
    Report is defined through a XML file. The format of XML definition follows : Reports.dtd in ORACLE_HOME/reports/dtd/
    That means the data comes out of a XML file :XML Data can be treated as data source(reading data from xml file) is possiable through
    Oracle Reports 9i feature XML Query. if you do not want to use ReportBuilder, You have to manually
    write the XMLPDS portion in XML Report. Please make some XML Query report from Builder and try to
    follow the same format while you write your XML Definition.
    with Regards
    Sachin

  • Crystal Reports generation from XML datasource or file.

    How to generate the crystal report(.rpt file) from XML/XSD file as input..?
    I'm trying out this from 'Crystal Reports in Eclipse'.

    Same problem here using CR4J v.2 sp1<BR/>
    This is the complete StackTrace:<BR/>
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Error al cargar el conector de base de datos. No se pudo obtener acceso a la clase 'com.crystaldecisions.reports.queryengine.driverImpl.DriverLoader'.---- Error code:-2147467259 Error code name:failed
         at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
         at com.businessobjects.samples.InformePruebaXML.main(InformePruebaXML.java:64)
    Caused by: com.crystaldecisions.reports.common.QueryEngineException: Error al cargar el conector de base de datos. No se pudo obtener acceso a la clase 'com.crystaldecisions.reports.queryengine.driverImpl.DriverLoader'.
         at com.crystaldecisions.reports.queryengine.Connection.ur(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.uB(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.br(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.bs(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.t1(Unknown Source)
         at com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.for(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.ReportHelper.a(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.long(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(Unknown Source)
         at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.businessobjects.sdk.erom.jrc.a.a(Unknown Source)
         at com.businessobjects.sdk.erom.jrc.a.execute(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ds.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
         ... 4 more
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         ... 32 more
    Caused by: com.businessobjects.reports.jdbinterface.common.DBException: No se pudo cargar el conector de base de datos 'crdb_xml.dll'.
         at com.crystaldecisions.reports.queryengine.driverImpl.DriverLoader.loadDriver(Unknown Source)
         ... 36 more
    Edited by: Asier Camara Martin on Jun 1, 2009 2:16 PM

  • Flex UI generation from xml input

    hi,
    i have a requirement where user will create xml file for the ui screen that he wants,the xml file will contain the information about the components to be placed on the screen for eg. label,combobox,button etc
    we want to write a program which will parse this xml file and spit out corresponding flex mxml file so basically i am looking for code generator for mxml file,
    could you please suggest an approach to create such a programme

    Check out
    http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf.  I believe it's the first question on the list, but I don't have Reader installed yet on this computer (I just reimaged it).
    HTH;
    Amy

  • MMB Generation from XML

    Ive successfuly developed a PLSQL package to build a dynamic menu in XML which I then convert into a menu MMB file using the ifxml2f90 utility supplied with 9iDS. I can run all this locally on my PC.
    Now that its working I want to deploy it to our DB Unix server. Our DBAs are telling me that the ifxml2f90 utility requires an install of 9iDS on our unix server and that this is outwith our licensing agreement.
    Is there a way that I can do this without a full install of 9iDS on Unix?

    If you can use an XSLT engine in Java,
    we provide that today with the Oracle XML Parser V2.
    We do not presently have a C/C++
    implementation of the XSLT engine.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

Maybe you are looking for

  • Example of  a Simple ALV Report using Function Modules (not OO)

    Hi, I am new to ABAP. Where can I get a proper Example of  a Simple ALV Report using Function Modules?  I searched the forum but did not find a proper solution. Kindly help. Smruthi. Edited by: Smruthi Acharya on Jan 29, 2009 7:13 PM

  • How ti disable enter button in selection screen.

    Hi, Developed a  report and when execute the Tx code first i get selection screen and when inputs are given in selection screen and hit enter it will direct to module pool screen.. here after giving inputs in selection screen,ENTER and F8 button are

  • Related to SAP Notes

    Hi Folks, 1.Will there be a SAP Notes even for Script too or SAP will provide a new script when there is a change in the layout,say for changes in J1INCERT-CIN. 2.We are currently working on 4.7c and we generally apply notes as and when an error aris

  • E75 send and receive problem

    I have had my e 75 for about a month.  Two days ago it started to continuously send and receive all the emails in the inbox.  The number of emails will reduce to zero and then they all come back again then return to zero then come back on and on.  th

  • BADI to qualify lead and generate opportunity..

    Hi All, I am working on an enhancement for qualifying a lead automativally based on the values from Z table. This is in CRM2007 and the transaction i m using is CRM_ORDER. If the country and business unit matches from Z table then it should qualify t