on 07-06-2015 3:35 PM
On the ESB in Message Mappings I am moving a Constant value to USERID field e.g. USR01. This is the user we want for Dev, however on Quality system we want to use userid USR02, and on Production USR03.
My question is how do we cater for this in the Message Mapping section of ESB? Bear in mind that none of the other fields in our structure contain the system details. Are there system variables we can use, like in ABAP? If so, then how?
Hi Glen,
No need for UDF, just use mapping parameters (string category) and enter the value in integration directory.
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Glen,
Yes, this is possible without coding. In the signature tab, just add an importing parameter of string type like the one in this blog
Mapping importing parameters can be read in a message mapping by using a constant e.g
Where mode is an importing parameter of string type
PS: You also need to bind the mapping parameters in an OM, otherwise it will not appear in integration directory.
Regards,
Mark
But I don't have any importing parameters that can be read?
I have to determine which system I am on, and then based on this pass a USERID. For example if i am on QAS system then I should pass 'USR02' to field USERID.
At the moment I have a constant i.e. I have put 'USR03' as a constant to USERID and transported this to Production because in Production USERID is USR03.
Then I changed the constant in Dev to 'USR02' and transported this only to QA system.
Then on Dev I changed this to USR01 without transporting.
So I have on all 3 systems 3 different constant values but of course this is not best practice, and every time when this message mapping changes I have to make sure that this USERID field constant is corrected and transported to relevant system.
Hi Glen,
The idea is to create an importing parameter for your user and then configure its value in integration directory accordingly. If you are in QAS system, all you have to do is to open the interface determination and just replace the value of user to USR02.
The value of user can be passed to USRID by using this mapping (with importing parameter User):
constant: $User$ -> USRID
By using the parameterized mapping approach, you only have to change the value of the users in integration directory.
Regards,
Mark
Hi Glen,
You can start with Venkat code and link to practice with UDF PI concept. However, i recommend don't hardcode the DEV, QUA and PRO environments directly on the UDF. You can take only the machine name and later use a value-mapping (Value mapping - Process Integration - SCN Wiki). The benefits to use value mapping are the value are configurable on the ID, if tomorrow you basis team change the machine name you won't need to change your ESR in all your environments, you only need to change this value directly in the ID. Summing up, Configurable values should be in the ID and not in the ESR.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Glen,
Here is the sample code for your reference.
// Assume XID is Dev, XIQ is QA etc
String sysName = (String) System.getProperty("SAPSYSTEMNAME");
if(sysName.equals("XID"))
{
//your logic here
}
else if(sysName.equals("XIQ"))
{
//your logic here
}
else
{
// your logic
}
You can pass the values dynamically after determining type of the system (DEV/Quality/PROD) if required.
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Glen,
You can take the system name form java code Find physical machine name in Java - Stack Overflow
and with value-mapping or any lookup to set if that machine is dev, qua or pro.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Glen,
You can write an UDF for achieving your requirement.
UDF Execution Type - Context and Queue. - Process Integration - SCN Wiki
Regards
Venkat
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.