cancel
Showing results for 
Search instead for 
Did you mean: 

Suppressing a segment in the target based on condition

Former Member
0 Kudos

Hi Guys,

Iam working on an interface which has a requirement in which we need to suppress the segment in the target XML file of the IDOC Structure, Based on the data coming from a particular field in the Source IDOC iam doing a java lookup, if the condition fails in the lookup it should suppress the segment in the target XML file of the IDOC.The occurance of the particular segment in the IDOC is 0 to 999999.

Kindly throw some light on the procedure in which this can be acheived.

Any sort of suggestions regarding this are appreciated.

Thanks in Advance.

Praveen.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Praveen,

I had a similiar problem some weeks ago. Please provide a boader view on the mapping and special the case on that the segements should be created or not. Do you need to compare some value or do some other checks?? How is your current way to create the segments... - this you will have to enhance!

It's not that easy but it's possible!

Regards

Matt

Former Member
0 Kudos

May be it help you:

(not so trivial solution)

Try to create Advanced User-Defined function (in mapping designer) with at least 2 parameters. (first - this segment, second - particular field) (check "Cache entire queue" option)

something like this:

public void Suppress(String[] a, String[] b, ResultList result, Container container){

String segment = a[0];

for(int i=0; i < b.length; i++) {

String data = b<i>;

if(data != null and data.equals('race conditions')) {

result.addValue(segment);

break;

}else {

//ignore.

//note: for empty segment - result.addSuppress()

}

}

}

}

Former Member
0 Kudos

Hi Praveen,

Check this thread for more information...

Regards

Anand

Former Member
0 Kudos

Hi

If you want to do into mapping itself then just go through this blog it will definetely solve your issue.

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

use node function 6 as listed out in blog.

Just make sure that target segment ocurence is 0 to1 or 0 to unbounded.

If you want that elemet should not be present in output then you have to go for conditional reciever.

Cheers

Regards

Piyush

Former Member
0 Kudos

Hi Praveen,

You should be able to do this in your mapping.

In your mapping you can use ifwithelse to decide wheather to map the target segment or not based on condition check. Apart from segment you need to suppress individual fields inside the segment as well.

Regards

Anand

Former Member
0 Kudos

Hi Anand,

I had already done that in my mapping.

Iam not so clear about what u are saying.

Can u elaborate me on this or else if u can suggest

some clear solution.

Thanks,

Praveen.

Former Member
0 Kudos

Hi

You can do this using conditional reciever.

But you have to use to services having to reciver channel having same parameters.

based on condition you select message mapping which is going to execute.

Cheers.

Regards

Piyush