Skip to Content
0

Mapping logic required

Jul 11, 2017 at 11:23 AM

179

avatar image

Hello Friends,

The scenario is IDOC to JDBC.

In IDOC I have a segment,

ZE1KNA1 cardinality 0:9999

I have field - ZTYPE under this. If ZTYPE has atleast 1 occurance of value 'Z1' then I have to supress all IDOC. Target message should not be generated.

Kindly suggest what kind of mapping logic need to be applied.

Thanks in advance.

Hari

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Evgeniy Kolmakov Jul 11, 2017 at 11:34 AM
1

Hi Hari!

Try this:

ZTYPE->RemoveContexts->FixValues("Z1" - 1; Default 0)->Sum->equalsS(0)->createIf->Target_Message_Root_Node.

Regards, Evgeniy.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks it worked out well. Have a good day. Cheers

0
Patrick Weber Jul 11, 2017 at 11:32 AM
2

Hi Hari,

If I get the requirement not to generate a target message under certain circumstances, my first thought usually is to sort out the unwanted messages during receiver determination already and not even let them go to the mapping. You can send those filtered out IDocs to a dummy receiver, so you can later on easily see that they were filtered.

Regards,
Patrick

Show 5 Share
10 |10000 characters needed characters left characters exceeded

Hi Patrick!

Unless we have several IDOCs within one message :-).

Regards, Evgeniy.

0

Yes, of course :-)

0

Thanks Patrick for the response. Can I apply this logic in receiver determination, since the segment ZE1KNA1 has multiple occurrences in the IDOC. ZTYPE can take values Z1, A1, A2. If I come across Z1 then I have to supress the IDOC.

0

Yes, you can use the EX operator and reference the field as /path/to/ZE1KNA1[ZTYPE="Z1"].
As Evgeny commented, sorting IDocs out during receiver determination is only viable if you're processing them one by one.

0

Yes, I agree with Patrick, but don't forget about "not" condition.

0