cancel
Showing results for 
Search instead for 
Did you mean: 

UDF "getProperty("SAPSYSTEMNAME");"

Former Member
0 Kudos

Hi all,

I have to do a runtime check wether I am running on D, Q or P.

In that context i have created a UDF with the following code:

 String a = System.getProperty("SAPSYSTEMNAME");

return a; 

I get this error when I try to activate: "Mapping not sufficiently defined"

So my guess is that the UDF is not correctly defined, since the UDF-box in my mapping-overview is yellow.

Do I need to import a package? or is the coding wrong?

Thanks!

/Thomas

Accepted Solutions (1)

Accepted Solutions (1)

FarihaKazi
Active Contributor
0 Kudos

I guess there is a mandatory field in the target structure which was not mapped by you ....

Former Member
0 Kudos

Yes - The return of the UDF is mapped to a mandatory field. But if the UDF is not correct, the mapping fails.

FarihaKazi
Active Contributor
0 Kudos

Have you given any input parameter to the UDF?

Check ur UDF for any input arguments taken by you but not mapped..

FarihaKazi
Active Contributor
0 Kudos

delete the input argument that comes by default when creating an UDF.

If the mapping is still yellow. just remove the mapping from that UDF and reassigning the mapping /or take new UDF from the tools.

Answers (1)

Answers (1)

aashish_sinha
Active Contributor
0 Kudos

Hi,

Did you tried something like this

String systemID = java.lang.System.getProperty("SAPSYSTEMNAME");

try this logic in a UDF and assign the values to the target nodes;

// Get the system name

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

if(sysName.equals("<XIDEVSERVER>")){

//your logic

}

else if(sysName.equals("<XIQASERVER>)){

//your logic

}

Regards

Aashish Sinha

PS : reward points if helpful