cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Message Mapping Logic ...!

Former Member
0 Kudos

Hi Experts ,

I am working on the the below requirement JDBC to IDoc scenarion in the mapping i need the below logic

based on the existence of the Transaciton ID . the idoc followed by the segments should be created . for ex

If Interface_Trasaction_ID= 456 THEN Idoc 1 followed by Segments and line items

E1BPACHE09,

E1BPACCR09

E1BPACCR09,

E1PACEXTC .

Field value=456

If Interface_Transaction_ID =457 THEN Idoc 2 followed by Segments and line items

E1BPACHE09,

E1BPACCR09

E1BPACCR09,

E1PACEXTC .

Field value=457

To satisfy the above logic i have mapped Transaction id > SplitByValue->CollapseContext--->Idoc

But the same Mapping Logic is not working when Sender payload is triggred having Repeated Transcation_Id value ias given below if Transaction ID= 456 ,

Transaction ID= 457,

Transaction ID= 457,

Transaction ID= 456 .

then output should have only 2 Idoc Followed by segments where Field Value will be 456, 457

I have mapped Transaction id -->Field Value .

let me know how can achive the above logic ...!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try the following mapping to remove the duplicate entries.

Transaction ID>Sort>SplitBYvalue(Value changed)>Collapsecontext> Target

Keep context of Transaction ID at the root level.

Regards

Former Member
0 Kudos

thanks for helping out ...!!

Answers (2)

Answers (2)

former_member854360
Active Contributor
0 Kudos

Hi Aziz,

you can use UDF

Transaction IDRemoveContext-->sortUDF- SplitByValue->CollapseContext--->Idoc

public void removeDuplicate(String[] Value, ResultList result, Container container) throws StreamTransformationException{
String temp = Value[0]; 

result.addValue(Value[0]); 
 for(int i=0;i<Value.length;i++) 
{
   if(!(Value<i>.equals(temp))) 
   {
        result.addValue(Value<i>); 
   }
   temp=Value<i>; 
}
}

Former Member
0 Kudos

Hi Aziz,

Do Transaction ID>SplitBYvalue>Collapsecontext>Splitby value> Target

Hope this helps.

Thanks,