cancel
Showing results for 
Search instead for 
Did you mean: 

Enhanced Receiver determination

Former Member
0 Kudos

Hi,

I am using enhanced receiver determination..is there any settings should be made in interface mapping..

In my scenario there are two receivers..i created two message mapping..i also check the blog about enhaned receiver determination..i got confused in creating interface mapping..

Can any one give clear idea for creating interface mapping..

Regards

Prakash

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

check my wiki for this.. go to wiki>xi>step by step guide>enhanced receiver determination

Former Member
0 Kudos

Hi Ranjeet,

I check ur wiki..i followed same procedure..but error is coming in sxmb_moni as i mentioned already...Kindly check my code and procedure which i followed and provide the solution.

Regards

Prakash

Answers (2)

Answers (2)

Former Member
0 Kudos

HI,

U CHECK THE BLOG CAREFULLY ONC AGAIN, U WILL SET IT.

REGARDS,

KEERTHI

Former Member
0 Kudos

Hi Keerthi,

Can u explain in detail..i created one data type and one message type..

As source structure and receiver structure is same..

i created three message interface..one for source and two for receiver..

I created message mapping for each receiver and message mapping for determining receivers..

Whether in interface mapping i need to mention three message mapping program or not..

Explain in detail,,

Regards

Prakash

former_member614185
Contributor
0 Kudos

Hi Prakash,

Take this exaple scenario u will get to know about enhanced receiver determination.

Soure Message: A_Msg

Based on the data in one of the field in A_Msg You are sending this message to two receivers.

Target Message: B_Msg1, B_Msg2

There should be two message mapping like A_MsgToB_Msg1 and A_MsgToB_Msg12.

Also Two interfaces for these Message mappings ok.

To determine the receivers dynamically you need to have one more message mapping, for that Soure message is A_Msg and targat message is <b>Receivers</b> From SAP BASIS Sofware component.

And inetrface mapping for the above Message mapping. for that use ReceiverDetermination Interface from SAP BASIS.

Use this interface mapping in ur Enahnced receiver determination.

Other configurations are same.

Former Member
0 Kudos

Prakash,

what is your requirement? based on the data, do you need to have respective mappings(3) has to be triggered or need to go to different receivers? or need to get different mesages from one single message?

if one of the first two is the requirement then you need to go with Xpaths with standard interface determination ,if third is the requirement then you need go for Multimapping with enhanced interface determination.

can you give more idea about the requirement,may I am able to help you.

thank you,

Babu sri

Former Member
0 Kudos

Hi Prabhu,

I followed ur steps and completed IR side.i also finished ID part..when the scenario is executed i got some error in sxmb_moni as "Receiver could not be determined".

How to rectify the error..In ID part, i created

Two Business service for each receiver

One Business service for sender

While creating Receiver determination after selecting type of receiver as extended..i specified one interface mapping name..then i created two interface determonation and two receiver aggreement..

Whether above procedure is correct or any thing else should be done.

Regards

Prakash

former_member614185
Contributor
0 Kudos

Well Prakash,

The problem is you didn't mention the receiver service in ur mapping between ur source message and <b>receivers</b> message type

Explain ur mapping.

Make sure that whether you have mapped ur receiver services to service field of receivers message type

Former Member
0 Kudos

Hi Prabhu,

I created three message mapping...two mapping for each receiver and one mapping for determining receiver.In this mapping i used target message type as "Receivers",.I wrote user defined function based on employee category receiver should be selected...this is the code

int i;

int A=0;

int B=0;

for(i=0; i<a.length;i++)

{

if( a<i>.equals("A") && A==0)

{

result.addValue("BS_Cat_A");

A=1;

}

if( a<i>.equals("B") && B==0)

{

result.addValue("BS_Cat_B");

B=1;

}

}

</textarea>

My source structure is

MT_EmpCat

>Emp_info

EmpId

EmpCat

EmpDep

Both receiver structure is same as source..

Check whether the code is correct..Also message type from SAP Basis "Receivers" the occurence of service is specified as 1..whether the occurence to be changed..

Regards

Prakash

former_member614185
Contributor
0 Kudos

>>>>Check whether the code is correct.

I think code is correct, test ur mapping and check Queues of ur UDF.

>>>>SAP Basis "Receivers" the occurence of service is specified as 1..whether the occurence to be changed..

No need to chande the occurence, since the message will be sent to one receiver based on ur condition.

Former Member
0 Kudos

Hi Prabhu,

I checked queue..it is coming as

"Compilation of MM_F2F_EnhRec_Basis successful

Executed successfully"

whether we need to change any context in mapping,,,Can u give me detail steps..

Regards

Prakash

former_member614185
Contributor
0 Kudos

Did did u use splitbyvalue function after ur UDF.

Former Member
0 Kudos

Hi,

S i used that function...But in display queue window no values are displaying.?

Regards

Prakash

former_member614185
Contributor
0 Kudos

As i said the problem is in ur mapping, check ur UDF. If u get the Values in Service field definitely ur scenario will work.

So change ur code and get the output from UDF.

Former Member
0 Kudos

Hi,

Can u give me the code...as i mapped EmpCat from source to target "Service"..

Regards

Prakash

former_member614185
Contributor
0 Kudos

I think u refered this blog, /people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16

go ahead with the same code with some changes according to the input value of ur EmpCat field.

Former Member
0 Kudos

Hi,

I followed same blog as u mentioned..i also used the code which is given in that blog..and i changed according to my requirements..as i already posted that code also..

Kindly check it and help me in rectifying the error.

Regards

Prakash

Former Member
0 Kudos

Hi

I feel something is wrong with the code of your scenario, that is why you are not able to get the desired output.

Please use this and see and check..

int i;

int A=0;

int B=0;

for(i=0; i<a.length;i++)

{

if( a<i>.equals("A") && A==0)

{

result.addValue("BS_Cat_A");

A=1;

}

if( a<i>.equals("B") && B==0)

{

result.addValue("BS_Cat_B");

B=1;

}

}

Thanks

Former Member
0 Kudos

I am sorry use this

You need to use the array index i with a.That is not there in your code.

Message was edited by:

Monika

Former Member
0 Kudos

Hi,

This code which i used along with array index

int i;

int A=0;

int B=0;

for(i=0; i<a.length;i++)

{

if( a<i>.equals("A") && A==0)

{

result.addValue("BS_Cat_A");

A=1;

}

if( a<i>.equals("B") && B==0)

{

result.addValue("BS_Cat_B");

B=1;

}

}

</textarea>

Regards

Prakash

former_member614185
Contributor
0 Kudos

Hi use this code in array index,

Hi try this code

int i;

int A=0;

int B=0;

for(i=0; i<a.length;i++)

{

if( a<i>.substring(0,1).equals("A") && A==0)

{

result.addValue("BS_Cat_A");

A=1;

}

if( a<i>.substring(0,1).equals("B") && B==0)

{

result.addValue("BS_Cat_B");

B=1;

}

}

Former Member
0 Kudos

Hi

I feel your code is fine.Here substring wont help because the scenario is not such

Just use a of i i.e. write a open square brackets the write i then close square brackets.The way you loop around an array.

Because you are using the loop with index and not using it.

Thanks

Former Member
0 Kudos

Hi Prabhu,

While creating UDF..there are three options coming under

Cache: 1.Value 2.Context 3.Queue.

Which one option should be selected...i kept as "Queue".

Regards

Prakash

Former Member
0 Kudos

Hi

You should not take as Queue

Thanks

Former Member
0 Kudos

Hi

Your function definition should be like

public void funcName(String[] a, ResultList result, Container container)

Thanks

Former Member
0 Kudos

Hi Monika,

My code

public void Service_Det(String[] EmpCat,ResultList result,Container container){

int i;

int A=0;

int B=0;

for(i=0; i<EmpCat.length;i++)

{

if( EmpCat<i>.equals("A") && A==0)

{

result.addValue("BS_Cat_A_IB");

A=1;

}

if( EmpCat<i>.equals("B") && B==0)

{

result.addValue("BS_Cat_B_IB");

B=1;

}

}

</textarea>

}

I given as EmpCat slong with array index 'i' in the code

Based on Employee category receiver should be determined..So i mapped EmpCat to target service in message mapping based on the blog..

I kept cache as "Context" and BS_Cat_A_IB,BS_Cat_B_IB are two receivers service

Can u check it still i am facing the error Receiver could not be determined

Regards

Prakash

Former Member
0 Kudos

Hi

Is mapping getting executed successfully!!Also check the mapping using the payload of the inbound message.

Thanks

Former Member
0 Kudos

Hi Monika,

Based on condition, receiver got selected..Now my requirement is contents of source is to be transferred to both receivers (i.e) there is no condition.I changed the UDF

int i;

int m=0;

int n=0;

for(i=0; i<a.length; i++)

{

if( !a<i>.equals(" ") && m==0)

{

result.addValue( "BS_Cat_A_IB" );

m=1;

}

if( !a<i>.equals(" ") && n==0)

{

result.addValue( "BS_Cat_B_IB" );

n=1;

}

}

But file is going to one receiver...is anything to be changed in UDF

Regards

Prakash

Former Member
0 Kudos

Hi

What do you mean receiver got selected.

In ID how many objects you created..

Thanks

Former Member
0 Kudos

Hi Monika,

My first requirement is working

Based on some condition i moved data from source to corresponding receivers using enhanced receiver determination..its working fine..

Second requirement is

I need to move all data from source to all receivers (no conditional based ) using enhanced receiver determination...there are two receivers.. I changed UDF which i posted earlier..

I need clarification whether i need to change only UDF or any thing alse..

Regards

Prakash

Former Member
0 Kudos

Hi

Can you tell me how did your files started going to the other Receiver.You said its going to just one receiver.

Thanks

Former Member
0 Kudos

Hi Monika,

I modified UDF which i used in first scenario...to move data from source to all receivers..but its not moving ..So i need clarification regarding UDF for my second scenario..

Regards

Prakash

Former Member
0 Kudos

Hi

Just wanted to confirm because..when you said the UDF is not working i gave it a try..In my case it is always going to only one Receiver.If the 1st record is ms then it goes to Service 2 and doenst go to Service 1 for second record of Mr and visa versa.

For your second req i need to prepare the UDF and try it out..

Thanks

Former Member
0 Kudos

Hi

Use this, keep the code same.

result.addValue("ReceiverService1");

result.addValue("ReceiverService2");

result.addValue("ReceiverService3");

.

.

.

mr++;

ms++;

mt++;

Thanks

Former Member
0 Kudos

hi,

we hav create an mapping for RECEVIER DETERMINATION....