on 12-29-2009 7:03 AM
Hi,
Can anyone tell me how to do 1:n multimapping wherein, depending upon one key node of the input file , it has to be posted to different receivers?
Input FILE
<main data>
</main data>
<local data>
<key1>key</key1>
<data1></data1>
<data2></data2>
</localdata>
<local data>
<key2>KEYS</key2>
<data1></data1>
<data2></data2>
</localdata>
OutputFile
<local data>
<key1>key</key1> -
> Receiver1
<data1></data1>
<data2></data2>
</localdata>
And
<local data>
<key2>KEYS</key2>
<data1></data1> -
>Receiver2
<data2></data2>
</localdata>
Please suggest.
Thanks & Regards,
Suishama
> depending upon one key node of the input file , it has to be posted to different receivers?
One more question, as you said in the begining that based on key node it has to be posted to different receivers, So do you know how may different keys can be there in your input file? Because as per the blog for each different key you have to create a new mapping.
Now coming to your second question
>Also, the blog 3343 is good for 2 receivers. But, there can be more than 2 receivers. So, i cant put ifelse condition?
>Should i create UDF for that also?
You can modify the same UDF to get multiple receivers like this..
Let's say I need to get 3 receivers based on my key values so you can modify the code as mentioned below..
int i;
int key1=0;
int key2=0;
int key3=0;
for(i=0; i<a.length;i++)
{
if( a<i>.substring(0,4).equals("key1") && key1==0)
{
result.addValue("key1Service");
key1=1;
}
if( a<i>.substring(0,4).equals("key2") && key2==0)
{
result.addValue("key2Service");
key2=1;
}
if( a<i>.substring(0,4).equals("key3") && key3==0)
{
result.addValue("key3Service");
key3=1;
}
}
Regards,
Sarvesh
Edited by: Sarvesh Singh on Dec 30, 2009 2:52 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarvesh,
This UDF refers to receiver determination::
int i;
for(i=0; i<var1.length;i++){
if( var1<i>.equals("ACHP") )
{
result.addValue( "BS_54_MDM_QAD_RECEIVER");
}
if(var1<i>.equals("HBO"))
{
result.addValue( "BS_54_MDM_QAD_RECEIVER2");
}
}
But, we need to create one more UDF for handling the functionality, i.e checking the condition(by key field)?
Since, the blog talks about only 2 values(mr or ms).
I have slightly modified the UDF, since the substring part I wasn't clear with.
Thanks & Regards,
Sushama
> But, we need to create one more UDF for handling the functionality, i.e checking the condition(by key field)?
Your UDF for determining the receivers looks good.
Now for other mappings (for different keys) you can write an UDF or you can also use std function. (I am not very clear here what exactly you are looking for?)
Hi Sarvesh,
I am talking about the condition check i.e. If keyvalue=X then send value to Local node, else send other value=y to local node.
Similar to the one: if string finds"mr" assign the value to Name else assign "ms" to name.
They have done this using graphical mapping since there are only 2 possibilities: mr or ms. But, here the keyvalue may be of say 10 types in that case we need to mention the condition in udf?
T & R
Sushama
Sushama,
Have you red the line "Similarly mapping for u201CMsu201D is also created." just abvoe point no 5.
Tthis means if you have 10 key fileds then you have to create 10 different mappings.
If you see my previous reply, I asked you "do you know how many key fields can be there in your incoming message?" So first confirm the number of key fields and their values.
Now suppose if you have 10 key fileds then create 10 different mappins and use graphical mapping, no need to create UDF.
I hope I have not misunderstood your question.
Regards,
Sarvesh
Hi Sushama,
I think you got confused with interface mapping for receiver determination and the interface mapping for creating target message.
1st interface mapping is used to determine receivers only.
2nd interfaces mappings will be used for target message creation. you have to create as mappings related to each receiver and while configuring just use the related mappings with each interface determination.
Please update with the status.
Regards,
Nutan
int i;
for(i=0; i<var1.length;i++){
if( var1<i>.equals("ACHPD") )
{
result.addValue( "BS_54_MDM_QAD_RECEIVER");
}
if(var1<i>.equals("HBO"))
{
result.addValue( "BS_54_MDM_QAD_RECEIVER2");
}
}
I have tested the above udf and it is working fine. Make sure you are passing the ACHPD & HBO in same case as you mentioned in UDF becaue it is case sensitive.
If you have same structure for both the receivers then it can be done without multimapping
You can specify a condition in receiver determination and route it to appropriate receiver
If condition 1 then receiver1
If condition 2 then receiver 2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sushama,
I am able to understand that you want to split the input message as per the value of Key field and at the same time you need to determine receievers also on based of those key field values.
Please follow the extended receiver determination. First problem is to determine receiver and after that interfaces related to that receiver.So, if all the receivers interfaces are having different structure then kindly create different mappings for all those receivers related interfaces.
Check this out.
Regards,
Nutan
> The requirement is similar. But, the Udf is throwing error:Some class or interface expected, stream transformation error.
Make suer you have selected cache as QUEUE while creating the UDF. I mean you have to create an advanced UDF.
> Also, do we need to specify the actual receiver service or a parameter?
YES, so just be careful here coz if you hardcode the receiver service in UDF then it will create a problem when you tranasport it to QA or Production. Try to pass the receiver service names to UDF in a generic way.
Regards,
Sarvesh
> How to get the service in a generic way?.
Create an UDF for this as mentioned below.
Note: Do not declare any argument while creating the UDF i.e. this UDF will not take any input, so just delete the default argument "a" while creating the udf.
String SystemID = null;
SystemID = System.getProperty("SAPSYSTEMNAME");
return SystemID;
Probably you can do like this..
UDF --->FixedValue table ---> Target node.
Note: In FixedValue table you can hardcode the service name e.g.
Key Value
====== =======
DEV BS_Dev
QA BS_QA
PRD BS_PRD
P.S. Above solution is just an hint. It is not necessary that you use FixedValue table. Based on your exact requirement use your own logic.
Regards,
Sarvesh
Hi Sushama,
As per your query, I believe at runtime if you have to decide the receivers then kindly use extended receiver determination.
Steps:
1.> Define Message Mapping between Outbound Message Type and Standard Message Type u201CReceiversu201D which is as Inbound message type and which is in the SAP BASIS --> http://sap.com/xi/XI/System
2.> Define Interface Mapping:Assign the message mapping or mapping program to the interface mapping
3.>Receiver Determination: While defining receiver determination, chose the u201Cextendedu201D option button. Now select the Interface Mapping created in Integration repository.
Then do the other common steps.
Regards,
Nutan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> Can anyone tell me how to do 1:n multimapping wherein, depending upon one key node of the input file , it has to be posted to different receivers?
Go through this blog..
/people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Please check main idea for your scenario in your Integration Repository SAP Basis-> SAP Basis <release number> -> namespace http://sap.com/xi/XI/System/Patterns next integration processes BpmPatternMulticastSequential and BpmPatternMulticastParallel.
You also have to add transformation step with Message Mapping from one input message to many output. In Message Mapping on Message Tab change occurancy for output message type from 1 to 0..unbounded.
Additional info http://help.sap.com/saphelp_nwpi71/helpdata/EN/11/13283fd0ca8443e10000000a114084/frameset.htm.
BR,
Dzmitry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>Can anyone tell me how to do 1:n multimapping wherein, depending upon one key node of the input file , it has to be posted to different receivers?
Hi Suishama,
In Message mapping, go to "Messages" tab and change the occurance as "o..Unbounded". Map the key to both node <local data> and <key> so that the output will be generated based on key value. This will solve your problem and will create multiple messages on target side.
Regards,
Madan Agrawal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.