cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue

Former Member
0 Kudos

Hi, well i open a new thread on this.

I have following source IDoc:

<ZBC0>

<IDOC BEGIN="">

<EDI_DC40 SEGMENT="">

<ZBC0 SEGMENT=""> 0...9999

<No>1</No>

<TYPE>1B20-6</TYPE>

<SPEC>152J</SPEC>

</ZBC0>

<ZBC0 SEGMENT="1">

<No>2</No>

<TYPE>1B20-6</TYPE>

<SPEC>152J</SPEC>

</IDOC>

</ZBC0>

the target will be three files with different contents, depending on the value in field <No>.

Target structure:

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

<MT_TYPSCH> 1..1

<TYPSCHRecordSet> 1..1

<TYPSCHDetailsStruc> 1..unbounded

<FELD1/> {represents content of <No>}

<FELD2/>

<FELD3/>

</TYPSCHDetailsStruc>

</TYPSCHRecordSet>

</MT_TYPSCH>

Make sure that we recieve IDoc with several ZBC0 and depending on the value in <No> it should be seperated in different target messages!!

How to achive this?!

br

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Trying using a fork/split based on the value in field number. to write to a file. I believe this should take care of your problem

Former Member
0 Kudos

hi ,

you can go for enhanced receiver determination.

write a UDF whice will determine the receiver according to the field valye in message mapping.

UDF may be of type

if (no==1)

{

result.addvalue("receiver1");

else

result.addvalue("receiver2");

}

regards,

navneet

former_member192295
Active Contributor
0 Kudos

HI,

Receiver target put occurance 1..1, it will divide automaticlly or we can go with multi mapping

Former Member
0 Kudos

Hi br,

you have to use a multi-mapping.

Search the blog or threads for multi mapping.

Regards Mario

Former Member
0 Kudos

Hi Mario, well i did with multi mapping.

I have changed the occurance of target in message tab but now i stuck with the filed mapping.

i did the following:

message 1:

/ns0:Messages/ns0:Message1/MT_TYPSCH/TYPSCHRecordSet/TYPSCHDetailsStruc=SplitByValue([type=Value changed]/ns0:Messages/ns0:Message1/ZBC21/IDOC/ZBC21/KENNU=)

message 2:

/ns0:Messages/ns0:Message2/MT_TYPSCH/TYPSCHRecordSet/TYPSCHDetailsStruc=SplitByValue([type=Each value]/ns0:Messages/ns0:Message1/ZBC21/IDOC/ZBC21/KENNU=)

but when i have this input/source:

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

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

<ns0:Message1>

<ZBC21>

<IDOC BEGIN="">

<ZBC21 SEGMENT="">

<EPANR>1</EPANR>

<TYPE/>

<SPEC/>

</ZBC21>

<ZBC21 SEGMENT="">

  • <EPANR>2</EPANR>*

<TYPE/>

<SPEC/>

</ZBC21>

</IDOC>

</ZBC21>

</ns0:Message1>

</ns0:Messages>

The result is, that i receive this:

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

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

<ns0:Message1>

<MT_TYPSCH>

<TYPSCHRecordSet>

<TYPSCHDetailsStruc>

<FELD1>1</FELD1>

<FELD2/>

<FELD3/>

</TYPSCHDetailsStruc>

</TYPSCHRecordSet>

</MT_TYPSCH>

</ns0:Message1>

  • <ns0:Message2>*

<MT_TYPSCH>

<TYPSCHRecordSet>

<TYPSCHDetailsStruc>

<FELD1>1</FELD1>

<FELD2/>

<FELD3/>

</TYPSCHDetailsStruc>

</TYPSCHRecordSet>

</MT_TYPSCH>

</ns0:Message2>

</ns0:Messages>

can u help me in this - even also in german?!

br

Former Member
0 Kudos

Sorry i forgot to mention that these messages should all be posted to different file(names).

Former Member
0 Kudos

Do you want the details the segments ZBC21 with same EPANR in one file?

Try this:

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

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

<ns0:Message1>

<ZBC21>

<IDOC BEGIN="">

<ZBC21 SEGMENT="">

<EPANR>1</EPANR>

<TYPE/>

<SPEC/>

</ZBC21>

<ZBC21 SEGMENT="">

  • <EPANR>2</EPANR>*

<TYPE/>

<SPEC/>

</ZBC21>

</IDOC>

</ZBC21>

</ns0:Message1>

</ns0:Messages>

MT_TYPSCH =ZBC21/IDOC/ZBC21/EPANR--> remove context --> split by value (value changed)

---> collapse context

TYPSCHDetailsStruc = ZBC21/IDOC/ZBC21/EPANR--> remove context --> split by value (value changed)

Use enhanced interface determination in ID.

Thanks,

Beena.

Former Member
0 Kudos

Hello Beena,

thanks to your response. Your suggestions runs well.

But now that i have several messages i want them to be written to different file(names)

And also i have the problem that i want to collect all data from e.g. <EPLAN>1</EPLAN> to one file.

The mappang does only divide but don't collect. For example when item occurs with EPLAN = 1 and also a second one, both should be collected in one Message and finally written to one file!

can you/someone help?!

br

Former Member
0 Kudos

Hi,

If the location is the same (same communication channel) you can use split on adapter engine.

/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

But you cannot use that when you would like to make a routing on that messages.

/wg

Former Member
0 Kudos

MT_TYPSCH =ZBC21/IDOC/ZBC21/EPANR--> remove context --> split by value (value changed)

---> collapse context

TYPSCHDetailsStruc = ZBC21/IDOC/ZBC21/EPANR--> remove context --> split by value (value changed)

There should be one message with multiple TYPSCHDetailsStruc when EPANR =1 .

You can set the filename and directory in mapping or variable substitution if you are posting all files to same ftp.

Thanks,

Beena.