XML for Qualified tables (SP05)

Hi all
I have a xml file like this
<?xml version="1.0" encoding="UTF-8"?>
<od:schema xmlns:od="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<od:element name="Test">
  <od:complexType>
   <od:sequence>
          <od:element name="Material_Number_R3"/>
          <od:element name="ST_Code"/>
          <od:element name="Family"/>
          <od:element name="Line"/>
          <od:element name="Category"/>
          <od:element name="Ginco_R3_Code"/>
          <od:element name="Material_Type"/>
          <od:element name="Material_Group"/>
          <od:element name="Division"/>
   </od:sequence>
  </od:complexType>
</od:element>
</od:schema>
And when i load it in the syndicator manager i can do the mapping, but i want to add some field of a qualified table: what should i change in my xml?
BR
PP

Hi Jose,
when you look at the delivered xsd-structures for the material master, you can see, taht Q-Lookup tables are already mirrored in these strcutres. so this could be used as a template.
You simply would define a complex type structure for the Q-lookup-table fields (I call it MFGDATA). This complex type would then be referred to in your main strucutre (I call it MFGInfo).
It would have the following for :
<?xml version="1.0" encoding="UTF-8"?>
<od:schema xmlns:od="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<od:element name="Test">
<od:complexType>
<od:sequence>
<od:element name="Material_Number_R3"/>
<od:element name="ST_Code"/>
<od:element name="Family"/>
<od:element name="Line"/>
<od:element name="Category"/>
<od:element name="Ginco_R3_Code"/>
<od:element name="Material_Type"/>
<od:element name="Material_Group"/>
<od:element name="Division"/>
<xsd:element name="MFGInfo" type="MFGDATA" maxOccurs="unbounded" />
</od:sequence>
</od:complexType>
</od:element>
<xsd:complexType name="MFGDATA">
######here you define all the fields of the Q-lookup tabel #####
</xsd:complexType>
</od:schema>
Regards Klaus

Similar Messages

  • How to parse XML for internal table

    hi guys, I would like to know how to parse xml for an internal table. I explain myself.
    Let's say you have a purchase order form where you have header data & items data. In my interactive form, the user can change the purchase order quantity at the item level. When I received back the pdf completed by mail, I need to parse the xml and get the po qty that has been entered.
    This is how I do to get header data from my form
    lr_ixml_node = lr_ixml_document->find_from_name( name = ''EBELN ).
    lv_ebeln = lr_ixml_node->get_value( ).
    How do we do to get the table body??
    Should I used the same method (find_from_name) and passing the depth parameter inside a do/enddo?
    thanks
    Alexandre Giguere

    Alexandre,
    Here is an example. Suppose your internal table is called 'ITEMS'.
    lr_node = lr_document->find_from_name('ITEMS').
    lv_num_of_children = lr_node->num_children( ).
    lr_nodechild = lr_node->get_first_child( ).
    do lv_num_of_children times.
        lv_num_of_attributes = lr_nodechild->num_children( ).
        lr_childchild = lr_nodechild->get_first_child( ).
       do lv_num_of_attributes times.
          lv_value = lr_childchild->get_value( ).
          case sy-index.
             when 1.
               wa_item-field1 = lv_value
             when 2.
               wa_item-field2 = lv_value.
          endcase.
          lr_childchild = lr_childchild->get_next( ).
       enddo.
       append wa_item to lt_item.
       lr_nodechild = lr_nodechild->get_next( ).
    enddo.

  • Unique key for Qualified tables

    Hello Experts,
    We are currently facing an issue with qualified tables. We need to retain existing system keys as below:
    Item (Main table)
    Item_Id, Item_Number
    Item_Price (Qualified Table)
    Item_Price_Id, Item_Id, Price_Type_Id, Price
    E.g.
    1, Pencil
    2, Pen
    3, Notepad
    1, 1, Retail_Price, $10
    2, 1, Wholesale_Price, $5
    3, 2, Retail_Price, $15
    4, 2, Wholesale_Price, $10
    We need to migrate the existing ids (Item_Price_Id) in MDM qualified table and need to maintain the same as max(Item_Price_Id) + 1 for all future records.
    Is there a way we can achieve this?
    Your help is greatly appreciated.
    Thanks in advance,
    Vinay

    Hi Karol,
    The Interface Iprinciple has this function as it:
    Gets the unique identifier which unambiguously identifies the object's <b>principal type and principal's data record</b>(s) in the data store (e.g. a relational database).
    <b>Note: the unique ID is a case sensitive string</b>
    Use this identifier to keep and persist references to principals. As this identifier contains internal information and is usually not readable, it should not be displayed in user interfaces.
    UME implementation guarantees to return Strings which are not longer than 255 characters.
    <b>Returns:</b>
    a non-null String identifying this principal
    I hope this helps you.
    Regards
    Pravesh

  • Expression logic for qualified tables

    Hello Experts.
    I am searching for an expression that can manage the following requirements:
    Different records of a qualified table belong to one record of the main table. One value that belongs to a certain combination in the qualified table should be automatically transferred to a field in the main table. For example there is one main table (MAIN) and a qualified table (QT) with at least two fields.
    Main table (MAIN) with some fields
    Qualified table (QT) with Field 1 and Field 2
    I tried following expression: IF(QT.Field 1 = ‘NAME’, QT.Field 2). But the expression doesn't’t work.
    How can an expression work with a certain combination of a qualified table? Has anybody an idea how to solve such a mystery?
    Thank you in advanced,
    Anja

    Hi Anita.
    I have the answer: You need an additional field in qualified table. This field is filled during import with the concatenation of all field values of the QT record.
    Qualified table with field 1 and field 2 look then like this
    Field 1: Name
    Field 2: Anita
    Field Conca:Name.Anita
    Now it is possible to build expression that can evaluate the string of the concatenation field.
    Thanks for your help,
    Anja

  • Using MDIS to import qualified tables

    Hi, All !
    I've encountered a strange problem - MDIS throws structural exception during import of data from xml into qualified table.
    In MDIS logs I found this record: "Create lookups failed. Source record No. : -11, Error message : Invalid field values."
    But if I try to import the same file with the same import mapping, using Import Manager, everything is ok!
    Has anybody faced same problem?
    Edited by: Alexander Pomazunoff on Apr 22, 2008 6:14 PM

    Hi Alexander,
    According to me, there can be 2 reasons of failure:
    1. You have mentioned that your source file has 3 tables in it. MDIS can handle only 1 table mapping at 1 mapping. For mapping all the 3 tables at 1 go, you will have to look-up all the fields in the 2 tables to the Main Table. This will ensure that all the fields that you want, exist in the Main Table Mapping.
    You have mentioned that you have done this for the Quailifer table, Kindly check it for the Look up FLat also.
    2. If the above problem is not there, then kindly check the Map. I think, You have mentioned that the Map works with the Import Manager. The map should be perfect, only then the MDIS will be able to import it.
    Now, Actaully sometimes what happens is,
    The map is saved with a source file. After that it might happen that you would be using a source file which would have extra Tags ( Fields). That means, now the source file that you would be using might be having some extra tags as compared to the source file which you must have used for saving the Map. The Map becomes Out of Date. Perfom, Save Update ( in the Import Manager) after any changes made to the map.
    Also, try creating 1 map for the current source file.
    Configure the same map for the MDIS and keep the same source file in the Ready Folder. If MDIS does not gives an error and it imports the file, then the problem is with your Old map as it throwing a structural Exception.
    Kindly check it.
    Hope it helps.
    *Please reward points if useful.
    Thanks and Regards
    Nitin Jain

  • How to add record in Qualified table using MDM Java API

    Hi experts,
    I am trying to add a record into a Table.
    but I am facing the problem in setFieldValue method.
    //Getting Field-ID to pass in setFieldValue() method.
    FieldId[] fields = new FieldId[6];
              fields[0] = repSchema.getFieldId("GTINs", "Description");
              fields[1] = repSchema.getFieldId("GTINs", "Unit_Descriptor");
              fields[2] = repSchema.getFieldId("GTINs", "GTIN");
              fields[3] = repSchema.getFieldId("GTINs", "Alternate_Item_Classifications");
              fields[4] = repSchema.getFieldId("GTINs", "Country_Of_Origin");
              fields[5] = repSchema.getFieldId("GTINs", "Bar_Coded");
    Record rec = RecordFactory.createEmptyRecord(mainTableId);
    rec.setFieldValue(fields, );
    but I am not getting how to assign the value to these fields using MDMvalue Interface.
    Can anyone provide me the code sample or Code flow so that I can do this.
    Plz help me it'll be great help for me.
    Thanks
    Tarun
    Edited by: Tarun Sharma on Feb 4, 2008 11:39 AM
    ==========================================================================================
    Hi Gurus
    I found the way to add the MDMValue in setFieldValue Method.
    we can set like this:
    setFieldValue(<fieldId object like fieldId[], <MdmValue like this> new StringValue("ABC"));
    Now I am facing problem in adding value to lookup flat table.
    According to the setFieldValue method we can assign the loookup like this:
    setFieldValue(<fieldId[0]>, new LookpValue(<here we have to pass the recordID of lookup table>);
    so I want to know how I can pass the recordId of lookup table here.
    Please suggest.
    Thanks
    Tarun Sharma
    Edited by: Tarun Sharma on Feb 4, 2008 3:15 PM
    Edited by: Tarun Sharma on Feb 4, 2008 3:25 PM
    Edited by: Tarun Sharma on Feb 8, 2008 6:58 PM

    Hi Andrea,
    I tried your suggestion but now i am getting Type Mismatch Error.
    Please suggest me what I can do?
    //TableId for Lookup[Flat].
    TableId lookupTableId = repSchema.getTableId("Return_Goods_Policies");
    FieldId[] ReturnGoodsPolicyTableIdFields = new FieldId[1];
    ReturnGoodsPolicyTableIdFields[0] = repSchema.getFieldId("Return_Goods_Policies", "Name");               
    Record recLookup = RecordFactory.createEmptyRecord(lookupTableId);
    try{
    recLookup.setFieldValue(ReturnGoodsPolicyTableIdFields[0], new StringValue("New_Brand"));
    }catch(Exception ex){
    System.out.println(ex);
    //Creating Record in Qualified Table - Request Details
    CreateRecordCommand createLookupcommand = new CreateRecordCommand(simpleConnection);
    createLookupcommand.setSession(session);
    createLookupcommand.setRecord(recLookup);
    createLookupcommand.execute();     
    //Getting the recordId of Lookup record.
    RecordId lookupRecordId = createLookupcommand.getRecord().getId();
    //Table Id for Qualified table.
    TableId  qualifiedTableId = repSchema.getTableId("Ext_Hardlines");
    FieldId[] ExtHardlinesFields = new FieldId[3];
    ExtHardlinesFields[0] = repSchema.getFieldId("Ext_Hardlines", "Name");//Text
    ExtHardlinesFields[1] = repSchema.getFieldId("Ext_Hardlines", "Pieces_Per_Trade_item");//Integer
    ExtHardlinesFields[2] = repSchema.getFieldId("Ext_Hardlines","Return_Goods_Policy");
    Record recQualified = RecordFactory.createEmptyRecord(qualifiedTableId);
    try{
    recQualified.setFieldValue(ExtHardlinesFields[0], new StringValue("Qualified Value"));
    recQualified.setFieldValue(ExtHardlinesFields[1], new StringValue("Qualified Description"));
    recQualified.setFieldValue(ExtHardlinesFields[2], new LookupValue(lookupRecordId));
    }catch(Exception ex){
    System.out.println(ex);
    //Creating Record in Qualified Table - Request Details
    CreateRecordCommand createQualifiedCommand = new CreateRecordCommand(simpleConnection);
    createQualifiedCommand.setSession(session);
    createQualifiedCommand.setRecord(recQualified);
    createQualifiedCommand.execute(); I am getting this Type match here, but i m not getting what mistake i did.     
    RecordId qualifiedRecordId = createQualifiedCommand.getRecord().getId();
    //Adding to Main Table
    TableId  mainTableId = repSchema.getTableId("GTINs");
    FieldId[] gtinsFields = new FieldId[1];
    gtinsFields[0] = repSchema.getFieldId("GTINs","Ext_Hardlines");
    Record recMain = RecordFactory.createEmptyRecord(mainTableId);
    //Adding the new record to Qualifed Lookup value and setting the Yes Qualifiers
    QualifiedLookupValue qualifiedLookupValue = new QualifiedLookupValue();
    qualifiedLookupValue.createQualifiedLink(qualifiedRecordId);
    try{
    recMain.setFieldValue(gtinsFields[0], new QualifiedLookupValue(qualifiedLookupValue));
    }catch(Exception ex){
    System.out.println(ex);
    CreateRecordCommand createCmd = new CreateRecordCommand(simpleConnection);
    createCmd.setSession(session);
    createCmd.setRecord(recMain);
    createCmd.execute();
    Could you help me out?
    Thanks
    Tarun

  • Issue creating qualified tables in MDM 5.5 SP04 Console

    Try the following:
    1) Make sure you are using SP04 Patch 1 (Build 5.5.33.13)
    2) Unarchieve one of the supplied business content repositories (Eg. Customer, Material, etc).
    3) Create a flat lookup table
    4) Create a qualified table with only one field: Field type lookup flat referencing the flat lookup table created in step 3, non-qualifier, display field.
    5) Create a new field in main table, type qualified multi-value, referencing the qualified table created in step 4.
    6) Load the repository
    7) Login to repository with data manager
    8) Create 1 entry in lookup table created in step 3
    9) Create 1 entry in main table, also creating 1 sub-entry in qualified table, save the record with SHIFT-ENTER
    10) Make sure the record was saved, including qualified table entry
    11) Close data manager
    12) Open data manager again
    13) Select your record and try to go in to the qualified sub-entry
    In my case this produces data manager to crash.
    This does not happen for qualified tables created in SP03 and updated to SP04, only for tables created directly in the SP04 console.
    Please let me know if everybody is having the same problem.

    Hi, Jorge,
    I have MDM5.5 SP4 P1 HF1 and followed your steps (except in step 4 (THANK YOU for numbering them), I have more than one field.) At step 13, I selected my record and to my amazement the record was there but my qualified table data was gone. And I then performed your step 14, and opened the qualified lookup table, and again to my amazement the console crashed.
    This definitely appears to be a bug and you should report it. I will also see if I can ask around for other solutions.
    Kristin

  • Loading main tables or Qualified tables first recommended??

    Hi All,
    Is the loading data for  Qualified tables first recommended before we load the main table data??
    Could I find any SAP recommeded quotes regarding this??
    thanks

    Hi Arvind,
    First Qualified Table data is uploaded and the Main Table data .
    FOLLOW THE LINKS.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1012f58f-a6e6-2a10-7caf-a46b7ad0f299
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/abe914fa-0301-0010-7bb1-d25c2a4bb655
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30380d0e-2f23-2a10-8f9d-da55511adbd8
    Reward if Useful.
    Regards,
    Vinay Yadav

  • Mass Update of date in Qualified  table

    I having problem in updating End availability date in Partner Specific Data (which is a qualified table). How can do a mass update of selected records. I have written an assignment expression which has no error but it is not doing the update.
    Regards,
    Marcel

    Hi Marcel
    Assignment and validation does not work well for qualified table. It will work for only first qualified linked record and not all.
    for mass update you can use import manager map the date qualifier field and select replcae action for qualified update in the destination item.
    best regards
    ravi

  • SAP J2EE Engine JTA Transaction Xml for table TABLE could not be ana

    I'm having a weird case. I created 3 entity bean. In my R/3 will call this JCO.Function to do the insert to database. But out of 3 entity bean, only 1 entity bean got error where it unable to insert to database and have this error in the log.
    The case is quite weird where i created the same entity but only 1 entity is not working as expected. Wondering what cause this problem.
    Thanks.
    org.xml.sax.SAXException: Fatal Error: URI=:main: Line=1: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Name expected: 0x20(:main:, row:1, col:218)#
    at com.sap.dictionary.database.dbs.XmlExtractor$XMLErrorHandler.fatalError(XmlExtractor.java:279)#
    at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:144)#
    at com.sap.dictionary.database.dbs.XmlExtractor.map(XmlExtractor.java:130)#
    at com.sap.dictionary.database.catalog.DbGeneralStructure.<init>(DbGeneralStructure.java:86)#
    at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:90)#
    at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:124)#
    at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:87)#
    at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTables(CheckColAndTabVisitor.java:299)#
    at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:176)#
    at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:169)#
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)#
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)#
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)#
    at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:472)#
    at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:375)#
    at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)#
    at net.tnb.model.ReasonCodeEntityBean3_0Persistent.ejb_iInsert(ReasonCodeEntityBean3_0Persistent.java:306)#
    at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)#
    at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)#
    at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)#
    at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)#
    at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)#
    at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)#
    at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:546)#
    at net.tnb.model.ReasonCodeEntityHome_Stub.create(ReasonCodeEntityHome_Stub.java:57)#
    at net.tnb.model.EToGatewayBean.insertIntoTable(EToGatewayBean.java:223)#
    at net.tnb.model.EToGatewayBean.processFunction(EToGatewayBean.java:166)#
    at net.tnb.model.EToGatewayLocalLocalObjectImpl3_0.processFunction(EToGatewayLocalLocalObjectImpl3_0.java:175)#
    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:324)#
    at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:277)#
    at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)#
    at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:260)#
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)#
    at java.security.AccessController.doPrivileged(Native Method)#
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)#
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)#
    ##0#0#Error##Java###{0}.commit(), Cannot commit due to unexpected exception in beforeCompletion(): 
    [EXCEPTION]
    {1}#2#SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b]#java.lang.IllegalStateException: Xml for table <TABLE> could not be analysed
         at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:100)
         at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:124)
         at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:87)
         at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTables(CheckColAndTabVisitor.java:299)
         at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:176)
         at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:169)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
         at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:472)
         at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:375)
         at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)
         at net.tnb.model.ReasonCodeEntityBean3_0Persistent.ejb_iInsert(ReasonCodeEntityBean3_0Persistent.java:306)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
         at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
         at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
         at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:546)
         at net.tnb.model.ReasonCodeEntityHome_Stub.create(ReasonCodeEntityHome_Stub.java:57)
         at net.tnb.model.EToGatewayBean.insertIntoTable(EToGatewayBean.java:223)
         at net.tnb.model.EToGatewayBean.processFunction(EToGatewayBean.java:166)
         at net.tnb.model.EToGatewayLocalLocalObjectImpl3_0.processFunction(EToGatewayLocalLocalObjectImpl3_0.java:175)
         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:324)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:277)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
         at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:260)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    #1.5 #001A6467CDF400590000004E000018D8000459BB785F496C#1224561620123#com.sap.engine.services.ts#sap.com/ESolutionsEGatewayEAR#com.sap.engine.services.ts#J2EE_GUEST#0####95b74d409f2411dd86c4001a6467cdf4#SAPEngine_Application_Thread[impl:3]_20##0#0#Error#1#/System/Server#Java#ts_0004##Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b] ).#1#SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b]#
    #1.5 #001A6467CDF400590000004F000018D8000459BB785F4BC5#1224561620123#com.sap.engine.services.ts#sap.com/ESolutionsEGatewayEAR#com.sap.engine.services.ts#J2EE_GUEST#0####95b74d409f2411dd86c4001a6467cdf4#SAPEngine_Application_Thread[impl:3]_20##0#0#Error#1#/System/Audit#Java###Exception {0}#1#com.sap.engine.services.ts.exceptions.BaseRollbackException: Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b] ).
         at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:236)
         at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:546)
         at net.tnb.model.ReasonCodeEntityHome_Stub.create(ReasonCodeEntityHome_Stub.java:57)
         at net.tnb.model.EToGatewayBean.insertIntoTable(EToGatewayBean.java:223)
         at net.tnb.model.EToGatewayBean.processFunction(EToGatewayBean.java:166)
         at net.tnb.model.EToGatewayLocalLocalObjectImpl3_0.processFunction(EToGatewayLocalLocalObjectImpl3_0.java:175)
         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:324)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:277)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
         at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:260)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.IllegalStateException: Xml for table ZREASON_CODE could not be analysed
         at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:100)
         at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:124)
         at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:87)
         at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTables(CheckColAndTabVisitor.java:299)
         at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:176)
         at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:169)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
         at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:472)
         at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:375)
         at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)
         at net.tnb.model.ReasonCodeEntityBean3_0Persistent.ejb_iInsert(ReasonCodeEntityBean3_0Persistent.java:306)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
         at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
         at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
         ... 16 more
    #1.5 #001A6467CDF4005900000050000018D8000459BB785F4E8F#1224561620123#com.sap.engine.services.ejb.entity.Container#sap.com/ESolutionsEGatewayEAR#com.sap.engine.services.ejb.entity.Container#J2EE_GUEST#0####95b74d409f2411dd86c4001a6467cdf4#SAPEngine_Application_Thread[impl:3]_20##0#0#Error##Java###null
    [EXCEPTION]
    {0}#1#com.sap.engine.services.ejb.exceptions.BaseRemoteException: Transaction system failure in method net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(net.tnb.model.ReasonCodeBean).
         at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:573)
         at net.tnb.model.ReasonCodeEntityHome_Stub.create(ReasonCodeEntityHome_Stub.java:57)
         at net.tnb.model.EToGatewayBean.insertIntoTable(EToGatewayBean.java:223)
         at net.tnb.model.EToGatewayBean.processFunction(EToGatewayBean.java:166)
         at net.tnb.model.EToGatewayLocalLocalObjectImpl3_0.processFunction(EToGatewayLocalLocalObjectImpl3_0.java:175)
         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:324)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:277)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
         at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:260)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.ts.exceptions.BaseRollbackException: Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b] ).
         at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:236)
         at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:546)
         ... 15 more
    Caused by: java.lang.IllegalStateException: Xml for table ZREASON_CODE could not be analysed
         at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:100)
         at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:124)
         at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:87)
         at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTables(CheckColAndTabVisitor.java:299)
         at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:176)
         at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:169)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
         at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:472)
         at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:375)
         at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)
         at net.tnb.model.ReasonCodeEntityBean3_0Persistent.ejb_iInsert(ReasonCodeEntityBean3_0Persistent.java:306)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
         at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
         at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
         ... 16 more
    #1.5 #001A6467CDF4005900000051000018D8000459BB785F5FA9#1224561620123#System.err#sap.com/ESolutionsEGatewayEAR#System.err#J2EE_GUEST#0####95b74d409f2411dd86c4001a6467cdf4#SAPEngine_Application_Thread[impl:3]_20##0#0#Error##Plain###RemoteException insertOk=false#
    #1.5 #001A6467CDF4005900000052000018D8000459BB785F6094#1224561620123#System.err#sap.com/ESolutionsEGatewayEAR#System.err#J2EE_GUEST#0####95b74d409f2411dd86c4001a6467cdf4#SAPEngine_Application_Thread[impl:3]_20##0#0#Error##Plain###Tue Oct 21 12:00:20 SGT 2008 java.rmi.RemoteException: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Transaction system failure in method net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(net.tnb.model.ReasonCodeBean).
         at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:573)
         at net.tnb.model.ReasonCodeEntityHome_Stub.create(ReasonCodeEntityHome_Stub.java:57)
         at net.tnb.model.EToGatewayBean.insertIntoTable(EToGatewayBean.java:223)
         at net.tnb.model.EToGatewayBean.processFunction(EToGatewayBean.java:166)
         at net.tnb.model.EToGatewayLocalLocalObjectImpl3_0.processFunction(EToGatewayLocalLocalObjectImpl3_0.java:175)
         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:324)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:277)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
         at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:260)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.ts.exceptions.BaseRollbackException: Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b] ).
         at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:236)
         at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:546)
         ... 15 more
    Caused by: java.lang.IllegalStateException: Xml for table <TABLE> could not be analysed
         at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:100)
         at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:124)
         at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:87)
         at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTables(CheckColAndTabVisitor.java:299)
         at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:176)
         at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:169)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
         at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:472)
         at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:375)
         at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)
         at net.tnb.model.ReasonCodeEntityBean3_0Persistent.ejb_iInsert(ReasonCodeEntityBean3_0Persistent.java:306)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
         at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
         at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
         ... 16 more
    ; nested exception is:
         javax.transaction.RollbackException: com.sap.engine.services.ts.exceptions.BaseRollbackException: Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [031fffffff3ffffffb2005b] ).
         at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:236)
         at net.tnb.model.ReasonCodeEntityHomeImpl3_0.create(ReasonCodeEntityHomeImpl3_0.java:546)
         at net.tnb.model.ReasonCodeEntityHome_Stub.create(ReasonCodeEntityHome_Stub.java:57)
         at net.tnb.model.EToGatewayBean.insertIntoTable(EToGatewayBean.java:223)
         at net.tnb.model.EToGatewayBean.processFunction(EToGatewayBean.java:166)
         at net.tnb.model.EToGatewayLocalLocalObjectImpl3_0.processFunction(EToGatewayLocalLocalObjectImpl3_0.java:175)
         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:324)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:277)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
         at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:260)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.IllegalStateException: Xml for table ZREASON_CODE could not be analysed
         at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable(XmlCatalogReader.java:100)
         at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:124)
         at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable(BufferedCatalogReader.java:87)
         at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTables(CheckColAndTabVisitor.java:299)
         at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks(CheckColAndTabVisitor.java:176)
         at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:169)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
         at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:472)
         at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:375)
         at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)
         at net.tnb.model.ReasonCodeEntityBean3_0Persistent.ejb_iInsert(ReasonCodeEntityBean3_0Persistent.java:306)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
         at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
         at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
         ... 16 more

    Hi Stefan and Everyone,
    I have solved my problem. Just want to let everyone know if u have to install the SP's for WEB AS 6.30/6.40.
    You start from the installation from CD 6.30/6.40. Everything will be working at this point. You can login to Visual Admin, Config tool and SDM.
    Before you apply any SP's, do the following:
    a) Create an emergency user with the Administrator rights: Ref OSS Note:669848
    Try to follow this route for SP's:
    From CD 6.30/6.40 -> SP04 -> SP07
    Apply SP04 first before applying SP07 (Recommended Approach).
    Refer the installation guide: SAP Web AS Support Package Guide 630SP2 to 640SP4.
    Use JDK1.4.2_05 to install SP04. You must reference the following OSS Notes and apply to your system accordingly, this is the key to an error free installation:
    a) OSS Note: 697535
    b) OSS Note: 709140
    c) OSS Note: 716604
    d) OSS Note: 706378
    You have to be really careful with SP04 installation, because it changes the version from 6.30 -> 6.40.
    Once you are able to install SP04 without any problems, you can directly apply SP07 or the highest 6.40 SP.
    Kind Regards,
    Buddha.

  • Condtion based xml for each row of the table t-sql

    Hello ,
    i have below data.
    create table #students
    id int identity(1,1) primary key,
    student_id int not null,
    [s_m_cml] xml
    insert into #students
    student_id,
    [s_m_xml]
    values
    101,
    '<submarks><submark><subject>Arts</subject><marks>85</marks></submark><submark><subject>Science</subject><marks>95</marks></submark><submark><subject>maths</subject><marks>100</marks></submark></submarks>'
    ),(102,'<submarks><submark><subject>Arts</subject><marks>50</marks></submark><submark><subject>Science</subject><marks>75</marks></submark><submark><subject>maths</subject><marks>85</marks></submark></submarks>')
    select * from #students
    if all subjects- marks in s_m_xml marks > 80 then i select the row as promoted else as demoted. the exact output should look like below.
    student_id [status]
    101 promoted
    102 demoted
    what is the best way to achieve this using t-sql. Thanks in advance for any suggestions.

    You dont need to parse out the values from xml for this
    You can do the check inline
    see illustration below
    drop table #students
    create table #students
    id int identity(1,1) primary key,
    student_id int not null,
    [s_m_cml] xml
    insert into #students
    student_id,
    [s_m_cml]
    values
    101,
    '<submarks><submark><subject>Arts</subject><marks>85</marks></submark><submark><subject>Science</subject><marks>95</marks></submark><submark><subject>maths</subject><marks>100</marks></submark></submarks>'
    ),(102,'<submarks><submark><subject>Arts</subject><marks>50</marks></submark><submark><subject>Science</subject><marks>75</marks></submark><submark><subject>maths</subject><marks>85</marks></submark></submarks>')
    ,(104,'<submarks><submark><subject>Arts</subject><marks>92</marks></submark><submark><subject>Science</subject><marks>88</marks></submark><submark><subject>maths</subject><marks>98</marks></submark></submarks>')
    select *,
    case when [s_m_cml].exist('/submarks/submark[data(marks) < 80]')=1 then 'demoted' else 'promoted' end as status
    from #students
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Generate xml using FOR XML PATH from table with hierarchy

    I need to create xml from a table like:
    EL1 EL2 EL3 Attr01 Attr02 Attr03 Attr04
    E10,    ,    ,a,b,c,d
    E10,E1010,    ,a,b,c,d
    E10,E1010,E101010,a,b,c,d
    E10,E1010,E101020,a,b,c,d
    E10,E1010,E101030,a,b,c,d
    E10,E1020,    ,a,b,c,d
    E10,E1020,E102010,a,b,c,d
    E20,    ,    ,a,b,c,d
    E20,E2010,    ,a,b,c,d
    E20,E2010,E201010,a,b,c,d
    E20,E2020,    ,a,b,c,d
    E20,E2020,E202010,a,b,c,d
    E20,E2020,E202020,a,b,c,d
    The hierarchy is EL1--EL2--EL3, and the 3 columns should be elements of xml;
    The other for columns Attr01,Attr02,Attr03,Attr04 should be attributes of xml;
    The actual table could have more than 500 rows(there are many values for El1,EL2,and EL3). 
    The expected xml should like:
    <root>
      <E10 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
        <E1010 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
          <E101010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
          <E101020 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
          <E101030 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
        </E1010>
        <E1020 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
          <E102010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
        </E1020>
      </E10>
      <E20 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
        <E2010 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
          <E201010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
        </E2010>
        <E2020 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
          <E202010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
          <E202020 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
        </E2020>
      </E20>
    </root>
    I create a sample Src table:
    CREATE TABLE Src
    EL1 VARCHAR(10),
    EL2 VARCHAR(10),
    EL3 VARCHAR(10),
    Attr01 VARCHAR(10),
    Attr02 VARCHAR(10),
    Attr03 VARCHAR(10),
    Attr04 VARCHAR(10)
    GO
    INSERT INTO Src
    (EL1,EL2,EL3,Attr01,Attr02,Attr03,Attr04
     SELECT 'E10','','','a','b','c','d'
     UNION SELECT 'E10','E1010','','a','b','c','d'
     UNION SELECT 'E10','E1010','E101010','a','b','c','d'
     UNION SELECT 'E10','E1010','E101020','a','b','c','d'
     UNION SELECT 'E10','E1010','E101030','a','b','c','d'
     UNION SELECT 'E10','E1020','','a','b','c','d'
     UNION SELECT 'E10','E1020','E102010','a','b','c','d'
     UNION SELECT 'E20','','','a','b','c','d'
     UNION SELECT 'E20','E2010','','a','b','c','d'
     UNION SELECT 'E20','E2010','E201010','a','b','c','d'
     UNION SELECT 'E20','E2020','','a','b','c','d'
     UNION SELECT 'E20','E2020','E202010','a','b','c','d'
     UNION SELECT 'E20','E2020','E202020','a','b','c','d'
    GO
    I tried to use FOR XML PATH to generate xml for the sample data. When the records increase to a few hundreds, it's not a good idea.
    Here is my script:
    SELECT
    (SELECT Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E101010'
    FOR XML PATH('E101010'),TYPE
    ) AS 'node()'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E101020'
    FOR XML PATH('E101020'),TYPE
    ) AS 'node()'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E101030'
    FOR XML PATH('E101030'),TYPE
    ) AS 'node()'
    FROM Src
    WHERE EL2 = 'E1010' AND (EL1 <>'' AND EL3 ='')
    FOR XML PATH('E1010'),TYPE
    ) AS 'node()'--1010
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E102010'
    FOR XML PATH('E102010'),TYPE
    ) AS 'node()'
    FROM Src
    WHERE EL2 = 'E1020' AND (EL1 <>'' AND EL3 ='')
    FOR XML PATH('E1020'),TYPE
    ) AS 'node()'--1020
    FROM Src
    WHERE EL1 = 'E10' AND (EL2 ='' AND EL3 ='')
    FOR XML PATH('E10'),TYPE) 'node()'
    ,(SELECT Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E201010'
    FOR XML PATH('E201010'),TYPE
    ) AS 'node()'
    FROM Src
    WHERE EL2 = 'E2010' AND (EL1 <>'' AND EL3 ='')
    FOR XML PATH('E2010'),TYPE
    ) AS 'node()'--2010
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E202010'
    FOR XML PATH('E202010'),TYPE
    ) AS 'node()'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E202020'
    FOR XML PATH('E202020'),TYPE
    ) AS 'node()'
    FROM Src
    WHERE EL2 = 'E2020' AND (EL1 <>'' AND EL3 ='')
    FOR XML PATH('E2020'),TYPE
    FROM Src
    WHERE EL1 = 'E20' AND (EL2 ='' AND EL3 ='')
    FOR XML PATH('E20'),TYPE) AS 'node()'
    FOR XML PATH(''),ROOT('root')
    If I get a few hundreds of rows, how huge the script should be. Does anyone have better solution for this? Thanks.
    Tao

    wBob,
    Thanks! And sorry for late feedback.
    The XSD requires the xml structures like the following
    <Schools>
    <School01>Some school</School01>
    <School02>Some other school</School02>
    </Schools>
    I have to use the number in the element name. 
    Right now I just use the nested FOR XML PATH, although I have to write thousand lines code.
    Thanks anyway.
    Tao
    Tao

  • Generating an XML schema for a TABLE

    Hi,
    I know I can easily export DATA into an XML file, but Sql Developer can also generate an XML schema for a table LAYOUT. Does anyone know how this is done?
    I did it some time ago and have been unable to do it again.
    Thanks

    Hi Thanks for the response. Yes, what you say is the type of thing I mean. The snippet below was actually created using SqlDeveloper, but I just can't seem to be able to do it again :-(
    <?xml version='1.0' encoding='Cp1252' ?>
    <results>
         <row>
              <Column_Name><![CDATA[AD_UNIT_ID]]></Column_Name>
              <Data_Type><![CDATA[NUMBER(5,0)]]></Data_Type>
              <Nullable><![CDATA[Yes]]></Nullable>
              <Data_Default><![CDATA[]]></Data_Default>
              <COLUMN_ID><![CDATA[1]]></COLUMN_ID>
              <Primary_Key><![CDATA[]]></Primary_Key>
              <COMMENTS><![CDATA[]]></COMMENTS>
         </row>
         <row>
              <Column_Name><![CDATA[AD_UNIT_NAME]]></Column_Name>
              <Data_Type><![CDATA[CHAR(30 CHAR)]]></Data_Type>
              <Nullable><![CDATA[Yes]]></Nullable>
              <Data_Default><![CDATA[]]></Data_Default>
              <COLUMN_ID><![CDATA[2]]></COLUMN_ID>
              <Primary_Key><![CDATA[]]></Primary_Key>
              <COMMENTS><![CDATA[]]></COMMENTS>

  • SDDM 3.3.EA2 one xml file for each table?

    Dear Philip!
    We'd like to have xml-files for all of our tables. To be more precise one xml file for each table so we can check it in in our configuration management system (CCC Harvest)
    Is it possible to write such a transformation script and, I really believe that can be done, can you please point us in the right direction, how to do that?
    Thanks in advance
    Guenter

    Hi Gunter,
    if you want each table to be stored in separate XML file then you needn't to do anything. Each table is stored in separate file in design directory structure - foreign keys are not included, each FK is stored in separate file.
    The ID of the table is used as file name. Each table has presentation in each physical model so you'll find file with same name (table ID) in each physical model.
    Please elaborate on that if you want something else.
    Philip

  • Duplicate keys possible in qualified tables.

    Dear experts,
    In short; when defining a qualified table in a repository you can define one or more fields as key-fields. This only prevents you from adding a the reference twice to the pre-selection but still allows you create more than one instance of this key within the same main table record.
    For instance, if you have a material repository with material as key for the main table and you define a qualified table to represent the plant level data, you can still maintain more than one record for plant X in relation to material Y.
    This results in data duplication and is a serious risk when distributing the data to subscribing systems.
    The issue was reported through OSS and was explained to be a feature to allow multiple telephone number. etc to be maintained. No solution was provided.
    We found this issue in our MDM system (MDM 5.5 SP05). Can you help us find out whether or not this issue was encountered at other clients/projects and if there is a solution? If you have the same issue, can you please let me know what version and support pack youu2019re on?
    We would appriciate any help on this.
    Thanks in advance.

    Hi,
    You are right......... This how Qualified Table works.
    Check this:
    Re: Material master for same Sales Org
    Thanks,
    Maheshwari

Maybe you are looking for

  • How do i change my message settings so that when i get a text message only the phone number shows up - not the message?

    how do i change my message settings so that when i get a text message only the phone number shows up - not the message?

  • What's the difference between tax account in FTXP and OB40

    Hi all, There are two tax accounts link to same tax code in FTXP for different company codes, but in OB40 I only can assign one account to tax code. What's the difference between tax account in FTXP and OB40? Thanks in advance. babyyw Edited by: baby

  • Final Cut Pro markers

    I often use Final Cut to edit floorball games that I shoot in my spare time. These projects are quite long, rarely less than an hour. In order to make the DVD from a game user friendly, I add chapter markers for when things in the game occurs; scorin

  • Need Transport route for two systems(Urgent)

    Hi All, I have configured everthing like configuring domain controller and added to to domain controller. Now i need to do below steps I have Development (client) and Quality(client) in same system and Production as separate server. I want to configu

  • Help with audio/photo/subtitle

    Hello. What I've been trying to do is take a song, coordinate subtitles karaoke style, and add a slide show of photos and maybe a few video clips. Maybe unfortunately, I already added and synchronized the subtitles with the audio. Now I want to inser