cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver Determination-Condition not working

Former Member
0 Kudos

Hi all,

It is simple iDoc to File scenario. I have two receivers based on a condition in the receiver determination. I am getting all data into both receivers without executing the condition.

Below is the condition. Any idea why this is not being executed? Thanks for your help.

(/ZGENERIC_OUTBOUND01/IDOC/Z1GENERIC_SDATA/SDATA = '1C')

(/ZGENERIC_OUTBOUND01/IDOC/Z1GENERIC_SDATA/SDATA = '1B')

Accepted Solutions (0)

Answers (3)

Answers (3)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

in the receiver determination>Receiver Determinarin>condition Editor--> do you have a prefix for the namespace??

for example p1:urn:xxxx.xxx:xxxx:xxxx

the Xpath have to be: p1:/ZGENERIC_OUTBOUND01/IDOC/Z1GENERIC_SDATA/SDATA

do you define the value in the Xpath or in the previous screen? if you define it in the Xpath you must put the quotes if you define it in the previous screen you dont.

it doesnt work for any system or work for one o no for the other??

thanks

Former Member
0 Kudos

I have not given any expression. I just selected the filed name from the XPATH list given and put the value. I thought about the same after looking into other postings, I am getting p1... when I use user defined data types, but not on the imported idocs.

to answer your question, No, there is no prefix. It is like below.

(/ZGENERIC_OUTBOUND01/IDOC/Z1GENERIC_SDATA/SDATA = '1C')

Edited by: rao.potti on Mar 26, 2009 8:04 PM

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

you cannot have the same condition for the same IDOC. thats never will work because you are checking the whole values of the segment and the receiver determination check just the first.

its no necessary have another mapping just put the condition separatly.

Former Member
0 Kudos

+you cannot have the same condition for the same IDOC. thats never will work because you are checking the whole values of the segment and the receiver determination check just the first.+

+its no necessary have another mapping just put the condition separatly.+

+also try deleting one condition.+

Hi Rodrigo,

what do you mean by putting condition separately.

I already have two separate conditions, one for each receiver. But based on the discussion, seems like it will not work. Please explain.

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

i understant this:

if you have the condition separatly it has to work but if you have the condition togheter it doest, because the receiver determination check the first value and cannot determinate if the the second condition because you have AND operator.

try put it in the previous screen (i dont remember the name of the screen). i think your Xpath spression is wrong.

thanks

Former Member
0 Kudos

> (/ZGENERIC_OUTBOUND01/IDOC/Z1GENERIC_SDATA/SDATA = '1C')

> (/ZGENERIC_OUTBOUND01/IDOC/Z1GENERIC_SDATA/SDATA = '1B')

May be stupid question, but are you putting 1C & 1B inside single quotes e.g. '1C' & '1B'. If yes then please remove the quotes and put like 1C & 1B then it will work.

Regards,

Sarvesh

Former Member
0 Kudos

removing the quotes did not help..

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi,

open SXI_MONI>select message> inbound message>Main Document>right buttom-->view source and check in there is any blank space.

this segment is unbounded?? if yes. the receiver determination will take the first value

those are two different condition or just one. check the logical operator is OR,AND

thanks

Rodrigo

Edited by: Rodrigo Alejandro Pertierra on Mar 26, 2009 3:38 PM

Former Member
0 Kudos

I just rechecked, there are no spaces. Values are IB and IC.

Yes, this segment is unbounded. The condition is on a field of that segment which is 0..1

I assume the condition is executed on each row (segment occurance), doesn't it work that way?

Former Member
0 Kudos

They are two different conditions. Each condition is for separate receiver.

prateek
Active Contributor
0 Kudos

I assume the condition is executed on each row (segment occurance), doesn't it work that way?

No. It would be executed only once. It would take either the value of the first segment or the last segment.

Regards,

Prateek

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi

I assume the condition is executed on each row (segment occurance), doesn't it work that way?

no, the condition is executed on first row.please check coutes for the values.

could you paste an example of outbound message??

thanks

Former Member
0 Kudos

Here is the outbound idoc from R/3. I have two receiver systems. If SDATA=1B, it should go to receiverA and if SDATA=1C, it should go to receiverB.

<?xml version="1.0" encoding="UTF-8" ?>

- <ZGENERIC_OUTBOUND01>

- <IDOC BEGIN="1">

- <EDI_DC40 SEGMENT="1">

<TABNAM>EDI_DC40</TABNAM>

-


-


</EDI_DC40>

- <Z1GENERIC_SDATA SEGMENT="1">

<SDATA>1C</SDATA>

</Z1GENERIC_SDATA>

- <Z1GENERIC_SDATA SEGMENT="1">

<SDATA>1C</SDATA>

</Z1GENERIC_SDATA>

- <Z1GENERIC_SDATA SEGMENT="1">

<SDATA>1B</SDATA>

</Z1GENERIC_SDATA>

</IDOC>

</ZGENERIC_OUTBOUND01>

prateek
Active Contributor
0 Kudos

Instead of conditions in receiver determination, I would suggest to use 2 mappings. There you may simply put the condition to map to target structure only when the field value = 1B or 1C.

Regards,

Prateek

Former Member
0 Kudos

If I do like that, I am getting empty file to receive when I dont' have any satisfying records. We don't want empty file..

Former Member
0 Kudos

> <?xml version="1.0" encoding="UTF-8" ?>

> - <ZGENERIC_OUTBOUND01>

> - <IDOC BEGIN="1">

> - <EDI_DC40 SEGMENT="1">

> <TABNAM>EDI_DC40</TABNAM>

> ......

> ......

> </EDI_DC40>

> - <Z1GENERIC_SDATA SEGMENT="1">

> <SDATA>1C</SDATA>

> </Z1GENERIC_SDATA>

> - <Z1GENERIC_SDATA SEGMENT="1">

> <SDATA>1C</SDATA>

> </Z1GENERIC_SDATA>

> - <Z1GENERIC_SDATA SEGMENT="1">

> <SDATA>1B</SDATA>

> </Z1GENERIC_SDATA>

> </IDOC>

> </ZGENERIC_OUTBOUND01>

You cannot have both the conditions in same IDOC at the same time. Like here in the above example you have 1C & 1B both, so in this situation it will not work.

Just for testing either remove 1C or 1B and then test. I am sure it will work.

You cannot send the same payload at the same time based on two different conditions to 2 different receivers except you put 'OR' in your conditon for 1C & 1B. But in this situation message will go to both of the receivers which you don't want here.

Regards,

Sarvesh

Former Member
0 Kudos

How can I split this into two files, each file going to separate receiver based on the filed value?

prateek
Active Contributor
0 Kudos

Do what I suggested in my last reply.

Regards,

Prateek

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

see my last reply

Former Member
0 Kudos

how to avoid emply file with just namespace coming in?

If I put the condition in mapping, I am still getting a file with just namespace init OR after content conversion I am getting empty file. User doesn't want to see any file if there is no data.

prateek
Active Contributor
0 Kudos

I am still getting a file with just namespace init

Then your mapping could be incorrect. If you have correct source payload as seen in your post above, then you must receive appropriate results too. Check the context of the nodes. You may need to use collapseContext in your map.

Regards,

Prateek

Former Member
0 Kudos

Yes, My mapping was incorrect. It was context issues, I corrected now, it is working.

Thanks..RP

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

Cheers.

please, points to correct users please.

thanks