cancel
Showing results for 
Search instead for 
Did you mean: 

File to IDoc

Former Member
0 Kudos

HI all,

I have the FILE-IDoc scenario.

my source structure is :

HEADER

--field1

--field2

--field3

ITEM

--field4

--field5

DETAIL

--field6

--field7

Target structure is:

HEADER

--field1

--field2

--field3

ITEM

--field4

--field5

--DETAIL

-


field6

-


field7

Hera my problem is, I have many Detail fields. All these fields should come under each Item. That is,

ITEM

--field4

--field5

--DETAIL

-


field6

-


field7

--DETAIL

-


field6

-


field7

--DETAIL

-


field6

-


field7

ITEM

--field4

--field5

--DETAIL

-


field6

-


field7

--DETAIL

-


field6

-


field7

--DETAIL

-


field6

-


field7

what mapping i should give for this???

thanks in advance

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

The target node is the subnode of item whereas in Source is was just subnode. I gotta doubt. So how do we achieve this in mapping ? Is it by context changing ?

Regards

Midhun

justin_santhanam
Active Contributor
0 Kudos

Shanthi,

Your source and target looks same! Could you please make sure that you gave us the correct structure? Also could you please show us an example?

raj.

Former Member
0 Kudos

HI,

My source and target is not same. You just see the target node DETAIL, it is the subnode of ITEM. AS it was not the subnode in SOURCE.

Thanks in advance

justin_santhanam
Active Contributor
0 Kudos

Shanthi,

Apologize, it's my visual mistake :-). If u don't mind cud u plz giv an example?

raj.

Former Member
0 Kudos

Hi Raj,

I am sending data as,

1 field1 field2 field3

2 field4 field5

3 field6 field7

3 field6 field7

2 field4 field5

3 field6 field7

3 field6 field7

This is my text file.

And in my IDoc i need,

Header

field1

field2

field3

ITEM

--field4

--field5

--DETAIL

--field6

--field7

--DETAIL

--field6

--field7

ITEM

--field4

--field5

--DETAIL

--field6

--field7

--DETAIL

--field6

--field7

Former Member
0 Kudos

HI EXPERTS,

Pls give solution soon.

thanks in advance

full points will be awarded.

justin_santhanam
Active Contributor
0 Kudos

Shanthi,

We will happy to assist you! But still I didn't got the reqd information. I want you to fill out some sample data in the XML structure for Source and target and reply here. Coz it's ur structure is confusing a bit.

Thanks for ur understanding!

raj.

Former Member
0 Kudos

hi,

<?xml version="1.0" encoding="utf-8"?>

<ns:MT_SALESRECEIPT xmlns:ns="http://XXXXXX_SalesPerReceipt">

<SR01>

<POSKREIS>5412</POSKREIS>

<KASSID>0080076832839360</KASSID>

<VORGDATUM>31.10.2008</VORGDATUM>

<VORGZEIT>225443</VORGZEIT>

<BONNUMBER>SK311008420</BONNUMBER>

<KASSIERER>80076832</KASSIERER>

</SR01>

<SR02>

<VORGANGART></VORGANGART>

<ARTNR>S0104038</ARTNR>

<VORZEICHEN>-</VORZEICHEN>

<QUALARTNR>ARTN</QUALARTNR>

<MENGE>0.025</MENGE>

<VERKAEUFER></VERKAEUFER>

</SR02>

<SR03>

<KONDITION>PN10</KONDITION>

<KONDVALUE>3219.56</KONDVALUE>

</SR03>

<SR03>

<KONDITION>ZMKC</KONDITION>

<KONDVALUE>215.99</KONDVALUE>

</SR03>

<SR03>

<KONDITION>ZSTC</KONDITION>

<KONDVALUE>1000.45</KONDVALUE>

</SR03>

<SR03>

<KONDITION>ZOTH</KONDITION>

<KONDVALUE>99.22</KONDVALUE>

</SR03>

<SR04>

<FLDNAME>CHARG</FLDNAME>

<FLDVAL>08X70003</FLDVAL>

</SR04>

<SR02>

<VORGANGART></VORGANGART>

<ARTNR>S0900199</ARTNR>

<VORZEICHEN>-</VORZEICHEN>

<QUALARTNR>ARTN</QUALARTNR>

<MENGE>0.0025</MENGE>

<VERKAEUFER></VERKAEUFER>

</SR02>

<SR03>

<KONDITION>PN10</KONDITION>

<KONDVALUE>5261.77</KONDVALUE>

</SR03>

<SR03>

<KONDITION>ZMKC</KONDITION>

<KONDVALUE>100.5</KONDVALUE>

</SR03>

<SR03>

<KONDITION>ZSTC</KONDITION>

<KONDVALUE>1500.55</KONDVALUE>

</SR03>

<SR03>

<KONDITION>ZOTH</KONDITION>

<KONDVALUE>90.5</KONDVALUE>

</SR03>

<SR04>

<FLDNAME>CHARG</FLDNAME>

<FLDVAL>08X70004</FLDVAL>

</SR04>

<SR05>

<RABATTART>ZRDF</RABATTART>

<RABVALUE>0.43</RABVALUE>

<TAXCODE>ZVAT</TAXCODE>

<TAXVALUE>114.89</TAXVALUE>

<ZAHLART>OGDP</ZAHLART>

<SUMME>1500</SUMME>

<KARTENNR></KARTENNR>

<BANKLZ></BANKLZ>

<ZUONR>OGDP0001</ZUONR>

<KONTOINH></KONTOINH>

</SR05>

<SR05>

<RABATTART></RABATTART>

<RABVALUE></RABVALUE>

<TAXCODE></TAXCODE>

<TAXVALUE></TAXVALUE>

<ZAHLART>ADVP</ZAHLART>

<SUMME>1500</SUMME>

<KARTENNR></KARTENNR>

<BANKLZ></BANKLZ>

<ZUONR>ADVP0001</ZUONR>

<KONTOINH></KONTOINH>

</SR05>

</ns:MT_SALESRECEIPT>

This is my XML file generated by TEXT file.

Former Member
0 Kudos

Hi Shanthi

Just map all the source node to target as it is with detail as given below and give it a try

detail(source) -> splitbyvalue -> detail (target)

Thanks

Gaurav

Former Member
0 Kudos

This was my source structure

<SR01>

--<POSKREIS>5412</POSKREIS>

--<KASSID>0080076832839360</KASSID>

--<VORGDATUM>31.10.2008</VORGDATUM>

--<VORGZEIT>225443</VORGZEIT>

--<BONNUMBER>SK311008420</BONNUMBER>

--<KASSIERER>80076832</KASSIERER>

</SR01>

<SR02>

--<VORGANGART></VORGANGART>

--<ARTNR>S0104038</ARTNR>

--<VORZEICHEN>-</VORZEICHEN>

--<QUALARTNR>ARTN</QUALARTNR>

--<MENGE>0.025</MENGE>

--<VERKAEUFER></VERKAEUFER>

</SR02>

<SR03>

--<KONDITION>PN10</KONDITION>

--<KONDVALUE>3219.56</KONDVALUE>

</SR03>

<SR03>

--<KONDITION>ZMKC</KONDITION>

--<KONDVALUE>215.99</KONDVALUE>

</SR03>

<SR03>

--<KONDITION>ZSTC</KONDITION>

--<KONDVALUE>1000.45</KONDVALUE>

</SR03>

<SR04>

--<FLDNAME>CHARG</FLDNAME>

--<FLDVAL>08X70003</FLDVAL>

</SR04>

<SR02>

--<VORGANGART></VORGANGART>

--<ARTNR>S0900199</ARTNR>

--<VORZEICHEN>-</VORZEICHEN>

--<QUALARTNR>ARTN</QUALARTNR>

--<MENGE>0.0025</MENGE>

--<VERKAEUFER></VERKAEUFER>

</SR02>

<SR03>

--<KONDITION>PN10</KONDITION>

--<KONDVALUE>5261.77</KONDVALUE>

</SR03>

<SR03>

--<KONDITION>ZMKC</KONDITION>

--<KONDVALUE>100.5</KONDVALUE>

</SR03>

<SR04>

--<FLDNAME>CHARG</FLDNAME>

--<FLDVAL>08X70004</FLDVAL>

</SR04>

Here SR03 and SR04 nodes are under SR02 segment in the target structure(IDoc). I am sending the structure as above.

What mapping i hav to give in MM.

justin_santhanam
Active Contributor
0 Kudos

Shanthi,

There you are! It's pretty clear , I will give you the solution shortly.

raj.

Former Member
0 Kudos

Hi Shanthi

based on your previous message

Source


<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_TstSource xmlns:ns0="http://Test">
   <header>
      <field1>1</field1>
      <field2>2</field2>
      <field3>3</field3>
   </header>
   <item>
      <field4>1</field4>
      <field5>2</field5>
   </item>
   <item>
      <field4>1</field4>
      <field5>2</field5>
   </item>
   <detail>
      <field6>1</field6>
      <field7>2</field7>
   </detail>
   <detail>
      <field6>5</field6>
      <field7>6</field7>
   </detail>
</ns0:MT_TstSource>

target


<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_TstTarget xmlns:ns0="Test">
<header>
<field1>1</field1>
<field2>2</field2>
<field3>3</field3>
</header>
<item>
<field4>1</field4>
<field5>2</field5>
<detail>
   <field6>1</field6>
   <field7>2</field7>
</detail>
</item><item>
<field4>1</field4>
<field5>2</field5>
<detail>
   <field6>5</field6>
   <field7>6</field7>
</detail>
</item>
</ns0:MT_TstTarget>

Works just implementing Splitbyvalue at the detail node.

Try it

Thanks

Gaurav

Edited by: Gaurav Bhargava on Nov 1, 2008 5:10 AM

Former Member
0 Kudos

Hi Gaurav,

I checked with what u have said, but i am getting only one DETAIL segment under the ITEM segment.

Any other mapping needed????

Former Member
0 Kudos

Hi ,

I worked it with your suggestion but i am getting only one value if i use

splitbyvalue.

justin_santhanam
Active Contributor
0 Kudos

Shanthi,

Plz don't mind that I'm asking too much question. Did you created your source Data type? Could you please let me know the structure with occurrence? If possible could you please take the screenshot of Source Data type and upload in flickr.com?

Thanks!

raj.

Former Member
0 Kudos

Yes, i hav created DATATYPE. In that i had given everything 0...unbounded.

The structure is same what i sent above. i just copied the source payload and pasted.

thanks in advance

Former Member
0 Kudos

HI Shanthi

You have created data type for source also? You can create source and target same ? will it not work for you. Above mapping using standard mapping is tough .. i think we need to look XSLT or Java mapping now.

What exactly is the file you are trying to load i got a doubt in that.

You said you want to send

1 field1 field2 field3

2 field4 field5

3 field6 field7

3 field6 field7

2 field4 field5

3 field6 field7

3 field6 field7

I think the source data type need to be revisited. As you want to pass item and detail ...if you create subnode in source itself i think you will be able to do it.

Share the file you are trying to read may be this will help.

Thanks

Gaurav