on 09-16-2009 11:12 AM
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
Hi ,
Just have a look here..
/message/686478#686478 [original link is broken]
String user_login_id = System.getProperty("user.name");
Regards,
Sunil.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.