cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the XI System ID in Module Adapter based on Development, QA and Pro

Former Member
0 Kudos

Hi,

I am implementing a custom Module adapter to chcek the incoming file for certain value and then renaming the file name with that value so that the file can be put into different folders.

However, the target dircetory in which the file is going to be placed is same for the dircetory path except that the system ID differes for Dev, QA and production.

Currently, the module code contains the below dircetory path and it works fine in Dev-

/usr/feeders/interfaces/XD1/payments

However, when the code is running on QA and production the system ID should change to reflect XQ1 and XP1.

How do I do this?

Can someone please give me the code to extract this system id or even the server name as that can give me the correct system ID?

Regards,

Archana

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

Just have a look here..

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

String user_login_id = System.getProperty("user.name");

Regards,

Sunil.

former_member200962
Active Contributor
0 Kudos

It should be SAPSYSTEMNAME ... refer:

Update:

Since you need to use the same UDF for all the three environments use the if - elseif logic as mentioned here:

Regards,

Abhishek.

Edited by: abhishek salvi on Sep 16, 2009 4:28 PM

Former Member
0 Kudos

You Guys are fantastic.

Thanks for the information.

I have implemented the below code, and as I cannot check just now in all the system I would liek to know if it is OK before I get the module deployed in Dev.

The 3 system id are as given below:

XI dev - XD1

XI QA - XQ1

XI production - XP1

The 3 directory folders should reflect the system ID as below depending on which system the module adapter is running:

/usr/feeders/interfaces/XD1/payments

/usr/feeders/interfaces/XQ1/payments

/usr/feeders/interfaces/XP1/payments

My code is given below:

Decalarion at the start:

private String TARGET_DIRECTORY = "";

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

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

if (sysNam.equals("XD1")) {

TARGET_DIRECTORY = "/usr/feeders/interfaces/XD1/payments";

} else if (sysNam.equals("XQ1")) {

TARGET_DIRECTORY = "/usr/feeders/interfaces/XQ1/payments";

} else if (sysNam.equals("XP1")) {

TARGET_DIRECTORY = "/usr/feeders/interfaces/XP1/payments";

}

Can ypou please advise?

Regards,

Archana

Former Member
0 Kudos

If you can do it using UDF and populate the SYS ID into a dummy feild to the target.

A simple variable substituion(from the dummy feild) functionality of file adapter will do the job for you...

where TARGET_DIRECTORY = "/usr/feeders/interfaces/%var%/payments"

var --> payload:MT_Target,1,Records,1,Dummy,1 (for example)

You can acheive using generic approach No need of hardcoding

Regards,

Sunil.

Former Member
0 Kudos

Hi,

The code cannot be made in the UDF as the incoming binary file is being placed on the target location in the server without any mapping in between and there is no struture.

The codeing is required in the module adapter that is being deployed.

I have made the change and will give the results short while later.

I would have liked to avoid the hardcoding but if i can make this work, this will be a big step for me.

Thanks you guys,

Regards,

Archana

Former Member
0 Kudos

Hi All,

The solution is working fine now.

Thanks to all.

I have awarded the points.

Regards,

Archana

Answers (0)