on 11-27-2006 2:08 PM
Hi
I am doing file to file scenario , i want to find the directory path at receiver dynamically on the basis of sender business service name
for eg if the file is coming from business service X101 then the file should go in folder X101
Any ideas
Regards
Swatantra
Hi,
This would be possible using Adapter Specific Identifiers and access to the runtime variables.
In your mapping , use the following code to read the Sender Business Service and then set the directory.
Just ensure that in your receievr file adapter Adapters Sepecific Identifiers --> Directory is selected.
java.util.Map map;
// get runtime constant map
map = container.getTransformationParameters();
//get Sender Business Service
String SenderService=(String) map.get("SenderService");
//Set file Directory to Sender Service.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
conf.put(key,SenderService);
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jai,
This code can be used inside the Message Mapping in any UDF or in the Intilization Section of Java Section to get the Sender Business Service and then set it against the filename using the Adapter Specific Identifiers.
All the explanation for this code willbe on these 2 links,
http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
The advantage of using this code is that the configuration remains the same.
But, Vijay would need only one receiver File Communication channel and the Directory name would be used dynamically from the mapping in the run time.
Regards,
Bhavesh
Hi,
Is your scemario contains different sender services ? If so , it is like different scenarios.
But if you want to dynamically put the file into folders, based on the some field in the payload, then using variable substitution option, you can handle it.
Regards,
moorthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>if the file is coming from business service X101 then the file should go in folder X101
I am not getting this. If the sender service differs, then obvoiusly you need to have different scenarios one for each sender service.
In run time, a receiver will be found out, only with the sender information. Sender Info means
1. Sender Service
2. Sender Interface
3. Sender Interface name space.
So even, if any one of the above varies, oyu will need a completely new scenario or else you will get an error in SXMB_MONI "NO RECIVER FOUND"
Regards,
Jai Shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your outbound communication channel, can you define parameters in the variable substitution field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Swatantra,
Refer to Variable Substitution sub heading from the below link:-
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Regards.
Praveen
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.