cancel
Showing results for 
Search instead for 
Did you mean: 

Get PI/Sending system SID

Former Member
0 Kudos

i need to determine a tag on the target system based upon the SID of either PI or the sending ECC system.

i have done UDFs that use message_id and sendtime before, but am unsure the best way to get the SID of either the send or PI system

I looked here.. http://help.sap.com/saphelp_nw04/helpdata/EN/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm and no fields are obvious...

any pointers gratefully received.....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please refer the following threads-

/message/686478#686478 [original link is broken]

As mentioned in the threads, use the method

System.getProperty("SAPSYSTEMNAME"); in udf.

Former Member
0 Kudos

How annoying that the you cannot search for words 2 characters long....

these did not come back in my search for System ID or SID!

thank you!

Answers (2)

Answers (2)

Former Member
0 Kudos

when i map the code to the field it is blank...

so it is not working....

Shabarish_Nair
Active Contributor
0 Kudos

it has to work during runtime;

sample code

// 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
}

Former Member
0 Kudos

so i cannot pass the value out?

i have the UDF mapped to a mandatory field and when i test the mapping locally, it fails as the mandatory field is not populated.

are you saying that the message mapping test tool will not work like this now?

former_member200962
Active Contributor
0 Kudos
are you saying that the message mapping test tool will not work like this now?

SYSTEMNAME will be populated during runtime ...concept similar as Dynamic configuration....testing in IR wont be able to pull the system name.

Did you try executing the scenario end-to-end?

Former Member
0 Kudos

I have not tested end to end due to the length of time it takes to complete the data in the portal. there is no quick way of testing this process - so wanted to test my mapping first...

i wanted to run some baseline tests before testing end to end...

Shabarish_Nair
Active Contributor
0 Kudos

guess you will have to do an end to end testing.

use the RWB -> Test Message tab to help you.

former_member181985
Active Contributor
0 Kudos

>>String sysName = (String) System.getProperty("SAPSYSTEMNAME");

This code works in standalone mapping as well.

I think you are doing something wrong in the mapping.

Can you paste the exact error in standalone mapping.

Shabarish_Nair
Active Contributor
0 Kudos

yep, thats correct. it works in standalone (jst did a test to confirm)

i used the code;

String sysName = (String) System.getProperty("SAPSYSTEMNAME");
return sysName;

try creating a simple UDF

Former Member
0 Kudos

the error i am getting is this:

Cannot create target element /positions/position/HideFE. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD com.sap.aii.mappingtool.tf7.IllegalInstanceException:

Cannot create target element /positions/position/HideFE. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD

i am trying to populate a mandatory field with this value...

Former Member
0 Kudos

It is working now...


String sysName = System.getProperty("SAPSYSTEMNAME");
// is system name is = PIP then flag the job to be viewed in search engine
if(sysName.equals("PIP"))
{
result.addValue(0);
}
else 
// else hide the posting from the public.
{
result.addValue(1);
}

thanks for everyone's input...

Shabarish_Nair
Active Contributor
0 Kudos

easiest way is as below;