Skip to Content
author's profile photo Former Member
Former Member

Data Type Category Mixed ?

Hi

I need to create a Data Type Category Mixed , which means that element LO_CODE> has a value and also a subelement LO_NUMBER. The only type data i can create is complex(includes a subelement LO_NUMBER but without LO_CODE having value 15701906) and simple is just an element with out includes

<LO_CODE>

15701906

<LO_NUMBER>

<REPAIR_GROUP>15</REPAIR_GROUP>

<TASK>19</TASK>

<INDEX>06</INDEX>

</LO_NUMBER>

</LO_CODE>

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 01:45 PM

    Thanks Swarup,

    You gave me a tip that i should create the xml in UDF ,which make sense as i cannot do it builting the Data Type . How can i In UDF create the XMl structure for as below

    <LO_NUMBER>

    <REPAIR_GROUP>15</REPAIR_GROUP>

    <TASK>19</TASK>

    <INDEX>06</INDEX>

    </LO_NUMBER>

    Do you have any example ?

    Add a comment
    10|10000 characters needed characters exceeded

    • <LO_CODE>15701906 </LO_CODE> ==>

      <LO_NUMBER>

      <REPAIR_GROUP>15</REPAIR_GROUP>

      <TASK>19</TASK>

      <INDEX>06</INDEX>

      </LO_NUMBER>

      You can use XSLT mapping to get the desired output

      Here is your xsl file please check it

      http://www.w3.org/1999/XSL/Transform">

      <xsl:template match="/">

      <LO_NUMBER>

      <REPAIR_GROUP><xsl:value-of select="substring(LO_CODE,1,2)"/></REPAIR_GROUP>

      <TASK><xsl:value-of select="substring(LO_CODE,5,2)"/></TASK>

      <INDEX><xsl:value-of select="substring(LO_CODE,7,2)"/></INDEX>

      </LO_NUMBER>

      </xsl:template>

      </xsl:transform>

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 01:00 PM

    Hi,

    maybe you could use a attribute for your code?

    http://help.sap.com/saphelp_nw04/helpdata/en/3b/d2a3f7a166514abb8cf5635b71974f/frameset.htm

    Regards

    Patrick

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      HI,

      Please don't mind but I am still doubtful about having the Value this way in XML scema without any tags to identify it.

      In XML scema, all the fields or values will be represented under XML scemas.

      So if you wish to create the schema in exactly the same way.then either pass all the values as single line

      as below logic

      In UDF, create the XMl structure for as below

      <LO_NUMBER>

      <REPAIR_GROUP>15</REPAIR_GROUP>

      <TASK>19</TASK>

      <INDEX>06</INDEX>

      </LO_NUMBER>

      Then pass the 15701906 + Udf formated above string -


      ><LO_CODE>

      And consider <LO_CODE> as simple data type with string.

      So finally in target side the structure will be as below

      <LO_CODE>

      15701906

      <LO_NUMBER>

      <REPAIR_GROUP>15</REPAIR_GROUP>

      <TASK>19</TASK>

      <INDEX>06</INDEX>

      </LO_NUMBER>

      </LO_CODE>

      This could resolve your purpose.

      Thanks

      swarup

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 01:00 PM

    Hi,

    I believe you are trying to create the XML data field as dynamicaly based on the value. These are treated as XMl tags so I am not sure if you can do this.

    You can use the fix name as an element or atrribute along with including the another data type

    LO_NUMBER is create as seperate Data type and then include it in the Data type LO_CODE,.

    Thanks

    swarup

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.