on 01-12-2010 9:49 AM
Hi experts,
we r facing the problem in idoc inbound scenario, while to generate multiple idoc's.
we need to generate the idoc's based on two fields, Location_code and Date. If any of the field is changing we need to generate the new idoc.
below is the sender payload :
<row>
<Date>20100111</Date>
<Sign>+</Sign>
<Tender_Code>ZSHT</Tender_Code>
<Tender_Amount>1890.30</Tender_Amount>
<Location_Code>0000001000</Location_Code>
</row>
<row>
<Date>20100112</Date>
<Sign>+</Sign>
<Tender_Code>ZSHT</Tender_Code>
<Tender_Amount>1890.30</Tender_Amount>
<Location_Code>0000001000</Location_Code>
</row>
<row>
<Date>20100112</Date>
<Sign>+</Sign>
<Tender_Code>ZSHT</Tender_Code>
<Tender_Amount>1890.30</Tender_Amount>
<Location_Code>0000001001</Location_Code>
</row>
<row>
<Date>20100112</Date>
<Sign>+</Sign>
<Tender_Code>ZSHT</Tender_Code>
<Tender_Amount>4532.32</Tender_Amount>
<Location_Code>0000001001</Location_Code>
</row>
for the above payload ,we need 3 idocs as below
idoc1:
Location_code>1000 Date->20100111
idoc2:
Location_code>1000 Date->20100112
idoc3:
Location_code>1001 Date->20100112
under the third idoc fourth row should get repeated.
at present we have the following mapping which is generating multiple idocs bsased on only location code, it's like
Location_code-->removecontext-->sort-->splitbyvalue(valuechange)-->collapsecontext--->idoc
rgds
selvam
Hi Selvam,
Try this
date-------------->concat-->SplitByValue(Value change)-->Collapsecontext-->SplitbyValue---target
location_code-->
PS: If required you may use sortbyKey after concat.
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks Suraj , logic has worked but there is a simple issue , LOCATION_Code is mapped with SNDRPRN and RCVPRN of the EDI_DC40 segment when i m execuiting the payload it throws error for the second idoc generated , when the LOCATION_CODE changes this should also get updated to that field. Mapping for SDNPRN has been done like this.
LOCATION_CODE --->removecontext-->|
formatbyexample--->SNDRPRN
idoc mapping logic---------------->|
pl suggest...
rgds
selvam
Hello,
Try using below mentioned udf.
a = location
b = input
for( int i=0;i<a.length;i++)
{
if(i== 0){
result.addValue(a<i>);
result.addContextChange();
}
else
{
if(a<i>.equals(a[i-1]) || b<i>.equals(b[i-1])) {
}
else{
result.addValue(a<i>);
result.addContextChange();
}
}
}
BR,
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.