cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping logic required

former_member229310
Active Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member190293
Active Contributor

Hi Hari!

Try this:

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

Regards, Evgeniy.

former_member229310
Active Participant
0 Kudos

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

Answers (1)

Answers (1)

weberpat
Contributor

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

former_member190293
Active Contributor
0 Kudos

Hi Patrick!

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

Regards, Evgeniy.

former_member229310
Active Participant
0 Kudos

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.

weberpat
Contributor
0 Kudos

Yes, of course 🙂

weberpat
Contributor
0 Kudos

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.

former_member190293
Active Contributor
0 Kudos

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