cancel
Showing results for 
Search instead for 
Did you mean: 

Data Type Category Mixed ?

Former Member
0 Kudos

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>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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 ?

GabrielSagaya
Active Contributor
0 Kudos

<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

<xsl:transform version="1.0" xmlns:xsl="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>

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

maybe you could use a attribute for your code?

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

Regards

Patrick

Former Member
0 Kudos

Thanks for you reply but the xml should be exactly as the above schema beacuse it is going to be sent to the target system

Former Member
0 Kudos

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