on 08-01-2008 1:46 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Receiver target put occurance 1..1, it will divide automaticlly or we can go with multi mapping
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi br,
you have to use a multi-mapping.
Search the blog or threads for multi mapping.
Regards Mario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
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.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.