cancel
Showing results for 
Search instead for 
Did you mean: 

Condition In Receiver Determination Not Working

Former Member
0 Kudos

I have given the following conditions in receiver determination.

/p1:MT_JDBC_Request/row[PLANT = 1000] EX for receiver1

/p1:MT_JDBC_Request/row[PLANT = 1111] EX for receiver2

The scenario is executing successfully. But it is not giving the results properly.

I am getting records with plant values 1000 and 1111 at both the receivers.

Can anyone please suggest what should be done to resolve this?

yoppy_santoso
Participant
0 Kudos

I have same problem, how did u finish it?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

for the error "no receiver could be found" look at the 33rd page of this file.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/2f2a9fa2-0a01-0010-32ac-d28...

Former Member
0 Kudos

Hi,

My problem is actually with the segregation of data based on the condition.

The error "no receiver determination" came as it was not accepting the condition

when i tested the scenario by giving the values in "" and ' '.

Regards,

Linsy

Former Member
0 Kudos

Hi,

Can anyone please suggest a solution for my problem.

I did all u have suggested ..but still the result is not getting properly.

Even I tried with a single condition and a single receiver. But still I am

getting all the records present in the table in the target file.

Regards,

Linsy

Former Member
0 Kudos

Hi Linsy

>>>But the thing is that, it is giving the error "no receiver could be found" if i give value in "" or ' ' .

I believe you are getting values other than what you specified in the condition as input. That is why you are getting the no receiver found exception

regards

krishna

Former Member
0 Kudos

Hi Lincy,

<i>/p1:MT_JDBC_Request/row[PLANT = 1000] EX for receiver1

/p1:MT_JDBC_Request/row[PLANT = 1111] EX for receiver2</i>

This is your incoming message ..right..

Go to Receiver Determination Condition Editor...

On the Left Operand -- Select the plant field by doing F4 help.

Select the OP as EQ.

In the Right Operand enter the plant as 1000.

Will work for sure..

Regards,

Sumit

justin_santhanam
Active Contributor
0 Kudos

Linsy,

In your condition is the <b>row</b> occurrences is unbounded?

/p1:MT_JDBC_Request/row[PLANT = 1000] EX for receiver1

Can u please confirm it?

Best regards,

raj.

Message was edited by:

Raj

Former Member
0 Kudos

Hi,

Thank you for the reply...

I have tried all these...still not working

Regards,

Linsy

justin_santhanam
Active Contributor
0 Kudos

Linsy,

Can u please show us the sample payload on which u have to determine ur condition, also have a look at my previous reply.

Best regards,

raj.

Former Member
0 Kudos

Hi Raj,

The occurrence for row is 1...unbounded...

The payload...

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

- <ns0:MT_FIle_Response xmlns:ns0="http://abc.com/lins/newCBR">

- <MaterialDetails>

<MaterialNo>1</MaterialNo>

<MaterialType>roh</MaterialType>

<Desc>xxx</Desc>

<Plant>1111</Plant>

<Qty>1</Qty>

<Price>1</Price>

<Flag>1</Flag>

</MaterialDetails>

- <MaterialDetails>

<MaterialNo>2</MaterialNo>

<MaterialType>roh</MaterialType>

<Desc>xxx</Desc>

<Plant>1000</Plant>

<Qty>1</Qty>

<Price>1</Price>

<Flag>1</Flag>

</MaterialDetails>

- <MaterialDetails>

<MaterialNo>3</MaterialNo>

<MaterialType>roh</MaterialType>

<Desc>xxx</Desc>

<Plant>2000</Plant>

<Qty>1</Qty>

<Price>1</Price>

<Flag>1</Flag>

</MaterialDetails>

</ns0:MT_FIle_Response>

And My condition is (/p1:MT_JDBC_Request/row[PLANT =1000] EX )

In o/p I need the details of plant with value=1000. But it s giving all the 3 records..

Regards,

LInsy

Message was edited by:

LINSY SCARIA

justin_santhanam
Active Contributor
0 Kudos

Linsy,

Thanks for the response, as I thought, see how come the receiver determination XPATH will determine if you have unbounded messages, u know wht is happening? It will look for the first occurrence and will decide. See in your payload the plant is 1111 as first occurrence so receiver 2 will be chosed and it will send all the materials, similarly change the Plant to 1000 ( as first occurrence) receiver 1 will be chosed and it will send all messages.

I think i'm not wrong,please give me ur feedback.

Also if you want your case to be simulated , i'll suggest you to slpit the message using BPM - For Each(Material Details) and send to receiving system.

Please provide your feedback.

Best regards,

raj.

Former Member
0 Kudos

Hi Lincy,

what i can understand from the payload is that you are trying to determine the receiver based on target payload.

You can only determine the receiver from the incoming message(:MT_JDBC_Request) to XI not the message which is going out of XI(:MT_JDBC_Response).

Regards,

SUmit

ps : reward points if that solved your problem.

Message was edited by:

Sumit Khetawat

Former Member
0 Kudos

Hi Sumit,

I am sorry, i gave the wrong payload...

I am determining the receiver based on the incoming message to XI only.

Regards,

Linsy

Former Member
0 Kudos

Hi Lincy,

Can you paste the incoming payload.

Regards,

Sumit

Former Member
0 Kudos

Hi Raj,

Ya..you are correct.

Before posting this question i used multi-mapping and enhanced interface determination as i wanted to avoid bpm. But that was also giving the same

result. so i dropped that and tried with a single receiver.

I dont exactly know where i went wrong..

Regards,

Linsy

Former Member
0 Kudos

Hi,

This s my incoming payload..

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

- <ns:MT_JDBC_Request xmlns:ns="http://abc.com/lins/newCBR">

- <row>

<MNO>1</MNO>

<MTYPE>roh</MTYPE>

<DES>xxx</DES>

<PLANT>1111</PLANT>

<QUANTITY>1</QUANTITY>

<PRICE>1</PRICE>

</row>

- <row>

<MNO>2</MNO>

<MTYPE>roh</MTYPE>

<DES>xxx</DES>

<PLANT>1000</PLANT>

<QUANTITY>1</QUANTITY>

<PRICE>1</PRICE>

</row>

- <row>

<MNO>3</MNO>

<MTYPE>roh</MTYPE>

<DES>xxx</DES>

<PLANT>2000</PLANT>

<QUANTITY>1</QUANTITY>

<PRICE>1</PRICE>

</row>

</ns:MT_JDBC_Request>

Regards,

Linsy

Message was edited by:

LINSY SCARIA

justin_santhanam
Active Contributor
0 Kudos

Linsy,

Do u want to use BPM for this or not? I think without BPM its hard, i'm not sure whether i'm not aware of it or not. But using BPM its simple task. Decide and reply back..

Best regards,

raj.

Former Member
0 Kudos

Hi Lincy,

what i understand from the incoming payload is that you want to send messages to plant 1000 or 1111 based on <row>/plant.

One way is to use BPM ...not the best way..

I dont think enhanced interface determination will solve your purpose.

What you can possibly do is..........

Have 2 sender jdbc adapter. In the first one write the query to read records for plant 1000 and in the second one write the query to read records for plant 1111.

Then it becomes simple or use BPM.

Regards,

Sumit

udo_martens
Active Contributor
0 Kudos

Hi Linsy,

can you check following:

left field: X-Path Expression on PLANT with F4 plus condition on PLANT =1000 (should be: /p1:MT_JDBC_Request/row[PLANT = '1000']/PLANT )

Operator EQUAL

right field: 1000

I think the X-Path is choosing now only the right PLANT. Of coz is the comparing a little bit strange, if the field was found, it can ONLY be true.

Regards,

Udo

Former Member
0 Kudos

Hi Raj/Sumit

The thing is that i should not use bpm and also i should use only one sender, that too Jdbc sender.How can this be made possible?

Regards,

Linsy

Former Member
0 Kudos

Hi Lincy,

Do you have control over the table which you are reading? as in is it possible for you to change the table structure ?

Regards,

Sumit

Former Member
0 Kudos

Hi Sumit,

I have access to the table.

What change should i make in the table structure?

Regards,

Linsy

Former Member
0 Kudos

Hi Udo,

I didnt understand this codition which you gave..

(/p1:MT_JDBC_Request/row[PLANT = '1000']/PLANT ) .

How that slash came in between..ie.. = '1000']/PLANT )

Regards,

Linsy

udo_martens
Active Contributor
0 Kudos

Hi Linsy,

your problem is, that row is unbounded. So you have to select that PLANT field, where value is 1000. You can do that in X-Path by a condition on row: row[PLANT='1000']. But you cant compare row, coz there is no value, it is a complex type. So you choose just the PLANT of row (others would work as well): row/PLANT. That field has now to be compared with the value on the right side. All together the comparing would look like

row[PLANT='1000']/PLANT EQ 1000

Why dont you test that?

Regards,

Udo

Former Member
0 Kudos

Hi Udo,

I tried the condition u have given..But it s giving same error.

If I use = instead of EX as operator..then i am getting error.

This is what i am getting in the condition in the cofigured receivers.

(/p1:MT_JDBC_Request/row[PLANT='1000']/PLANT = 1000)

Is this the condition U asked me to test?

Have i given it in the right way or am i wrong?

Regards,

Linsy

udo_martens
Active Contributor
0 Kudos

Hi Linsy,

what kind of error, can you describe?

the expression should be:

left: /p1:MT_JDBC_Request/row[PLANT='1000']/PLANT

op: EQ

right: 1000

If that not works, may be coz of wrong addressing the namespace in root element, plz check out:

left side: //row[PLANT='1000']/PLANT

op: EQ

right: 1000

Regards,

Udo

Former Member
0 Kudos

Hi,

It is the same condition...which i gave..

But if i give anything(like 😃 other than EX(expression) in the condition,

it s giving error as "no receiver cud be identified".

IF i use EX it will execute successfully. but the o/p will contain all values.

Regards,

Linsy

justin_santhanam
Active Contributor
0 Kudos

Linsy,

Did u solved the issue? I think u might have solved the issue, please share with us the same. Today I tried ur scenario with enhnaced receiver determination its working perfect.

I'm sharing the same, If you have any doubts kindly reply back.

Please keep the blog as reference: /people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16

As for as your scenario is concerned its like File -XI- JDBC, based on the Plant value from the source if its 1000 it has to go to one receiver , if its 1111 it has to go to other receiver am I right?.

<i><b>Design Part.</b></i>

Create one source data type, message type and aynch outbound interface.

Create two target data type,message type and aynch outbound interface.[Even though both the target structure are same , I request you to create with two different names , u will get the flow below]

Create three Message Mappings and 3 Interace mappings

Mapping 1:

Source --> Target 1

The logic is map if the source values has Plant value =1000

Please refer : http://www.flickr.com/photo_zoom.gne?id=572921073&size=o

Mapping 2:

Source --> Target 2

The logic is map if the source values has Plant value =1111

Please refer :http://www.flickr.com/photo_zoom.gne?id=572921095&size=o

Mapping 3:

Source --> Receiver Determination[Available in SAP Basis]

Please refer : http://www.flickr.com/photo_zoom.gne?id=572921149&size=o

Please refer: http://www.flickr.com/photo_zoom.gne?id=572921161&size=o

UDF [Decide Receiver]

Create Advanced UDF [Queue, with one input parameter -Plant]

int cnt = Plant.length;

int party1=0,party2=0;

for(int i=0;i<cnt;i++)

{

if(Plant<i>.equals("1000") && party1==0)

{

party=1;

result.addValue("Party1000");

}

else if(Plant<i>.equals("1111") && party2==0)

{

party=1;

result.addValue("Party1111");

}

}

Create three Interface mappings for the above 3 message mappings.

<b>Directory Part</b>

Create three services ,one for file sender , one for JDBC receiver1[Party1000] , one for JDBC receiver2[Party1111].

Create sender agreement --> File sender

Create receiver determination --->Choose extended and choose mapping program 3rd defined in IR.

Please refer :http://www.flickr.com/photo_zoom.gne?id=572505270&size=o

Create 2 Interface determination. [Bcoz we have created 2 inbound interfaces and choose the corresponding mappings]

Create 2 Receiver agreements.

Please refer here to check whether you have all the objects : http://www.flickr.com/photo_zoom.gne?id=572921171&size=o

Thats it you are done!!!

In SXMB_MONI u must get like refer here : http://www.flickr.com/photo_zoom.gne?id=572921167&size=o

Please see the below sample source and target messages.

http://sapient.xi.googlepages.com/home

I hope it helps you!!!

Best regards,

raj.

Former Member
0 Kudos

Hi Raj,

First of all thanks to all the replies.

My problem has been solved.

I will surely share with you how i did that.

But give me some time.

i will also award points to all.

Regards,

Linsy.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi linsy,

Put your values within double quotes.

Shabarish_Nair
Active Contributor
0 Kudos

try;

/p1:MT_JDBC_Request/row[PLANT = '1000'] EX for receiver1

/p1:MT_JDBC_Request/row[PLANT = '1111'] EX for receiver2

or

/p1:MT_JDBC_Request/row[PLANT = "1000"] EX for receiver1

/p1:MT_JDBC_Request/row[PLANT = "1111"] EX for receiver2

More : ref-

/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

Former Member
0 Kudos

Hi Shabarish,

Thank you for the reply.I tried giving the value in "" by referring your blog before and now i tried giving it in ' ' . But the thing is that, it is giving the error "no receiver could be found" if i give value in "" or ' ' .

Regards,

Linsy