Skip to Content
avatar image
Former Member

flat file to idoc MATMAS05 - mapping

Hi,

I want to create 2 Idocs from one recordset.

Can any one tell me how do I map this Recordset to an Idoc?

Example source and target IDOC structures:

Source:-

<Recordset>

<SA010>

<IDENTS>1234</IDENTS>

<BEZ>Dummytxt</BEZ>

</SA010>

<SA088>

<IDENTS>1234</IDENTS>

<MARC1>010</ MARC1>

<MARC2>020</MARC2>

</SA088>

</Recordset>

Target:-

<MATMAS05>

<IDOC BEGIN="1">

<E1MARAM SEGMENT="1">

<MATNR>1234</MATNR>

<E1MARCM SEGMENT="2">

<WERKS>010</WERKS>

</E1MARCM>

</E1MARAM>

</IDOC>

</MATMAS05>

<MATMAS05>

<IDOC BEGIN="1">

<E1MARAM SEGMENT="1">

<MATNR>1234</MATNR>

<E1MARCM SEGMENT="2">

<WERKS>020</WERKS>

</E1MARCM>

</E1MARAM>

</IDOC>

</MATMAS05>

Thanks and Regards,

Eren

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

8 Answers

  • Best Answer
    Oct 09, 2007 at 04:38 PM

    Ok Eren,

    Sorry for late reply, had gone for dinner 😊

    Now in your mapping, right click on your IDOC topmost node and select duplicate subtree

    Now for the 1st IDOC map WERKS from MARC1

    and for 2nd IDOC map WERKS from MARC2

    Please tell me if it works while you test your mapping

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 09, 2007 at 03:21 PM

    Eren,

    Check this weblog for changing the occurance attribute on the IDOC

    <a href="/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change:///people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change

    After that you can map the <SA010> and <SA088> node to the IDOC node and that should give you two IDOCs.

    regards,

    -Hashim

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 09, 2007 at 03:26 PM

    Sarac,

    Change the occurrence of Idoc to 1..unbounded and map Marc to Idoc. So you map for every occurrence of Marc you need to have an idoc.

    Regards,

    ---Satish

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 09, 2007 at 03:32 PM

    Hi

    if you want to create the two idoc at the receiver side then you have to put the occurence for the idoc as 0..unbounded .

    Thanks

    Rinku

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 09, 2007 at 03:42 PM

    Thanks for the quick answer,

    I change the occurence to 0..unbounded .

    How do I map the SA088 Elements to get 2 IDocs?

    <SA088>

    _____<IDENTS>1234</IDENTS>

    _____<MARC1>010<>

    _____<MARC2>020</MARC2>

    </SA088>

    Thanks and Regards,

    Eren

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 09, 2007 at 03:59 PM

    Eren, I have a small doubt...

    while populating the two IDOCS, where do you pick the MATNR field from??

    More specifically, is this value populated in both the IDOCS from the same source node??

    And if yes, which node is that

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 09, 2007 at 04:13 PM

    Hello Varun,

    My flat structure:

    <Recordset>

    <b><SA010></b>

    <i><IDENTS>1234</IDENTS>

    <BEZ>Dummytxt</BEZ></i>

    <b></SA010></b>

    <b><SA088></b>

    <IDENTS>1234</IDENTS>

    <i><MARC1>010<>

    <MARC2>020</MARC2></i>

    <b></SA088></b>

    </Recordset>

    The MATNR field is <IDENTS>. I can pick the value from node <SA010> or <SA088>.

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 10, 2007 at 08:15 AM

    Hello Varun,

    thank you. You solved my problem.

    Add comment
    10|10000 characters needed characters exceeded