Skip to Content
author's profile photo Former Member
Former Member

Regarding Message Mapping Logic ...!

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 ...!!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jul 20, 2011 at 09:07 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 20, 2011 at 09:00 AM

    Hi Aziz,

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

    Hope this helps.

    Thanks,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 20, 2011 at 09:02 AM

    Hi Aziz,

    you can use UDF

    Transaction ID RemoveContext -- >sort UDF - 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>; 
    }
    }

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.