on 07-18-2008 2:40 PM
Hi All,
I have an interface which is used for 2 different 3rd parties. The file formats, idoc etc are same for both the 3rd parties so using just the same interface. It is an File to IDOC interface. The only diff is that the incoming files are located in diff folders based on the 3rd party.
Requirement is that based on the file location we should be able populate a data filed in IDOC to help differentitate from where has the data come.
So if file is picked from folder A, then edidc-mescod = 'A'
else if the file is picked from folder 'B', then edidc-mescod = 'B'
Though I am using a single Message mapping but I am using 2 separate comm-channels for the 2 parties A,B involved. Appreciate if you could let me know if its possble to populate the IDOC field based on the file pickup location.
Regards
Shirin
Hi,
1. In the Sender File Communication Channel check the option Set Adapter-Specific Message Attribute and check the option Directory.
2. Use this UDF.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
String Directory = conf.get(key);
if (Dirrectory.equals("A"))
return "A";
else
return "B";
Test it only by posting the file and not in the Test tab.
Thanks
SaNv...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Adapter Configuration Guide:
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Thanks,
Boopathi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
String fileDir = conf.get(key);
if (fileDir.equals("A")){
return "A";
else
return "B"
//write if else as per your requirement
Map output of this UDF to edidc - mescod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I tried using the UDF you had provided, but it returns the value 'null'.
To put it into perspective,
when I click create UDF, I selected the radio-button 'Cache'. Removed the input argument 'a' and then inserted your code. Activated fine but it returned the value 'null' when used in real-time file transfer..
Any ideas where I might have done it wrong.
Many thanks
Shirin
Hey
write a UDF using dynamic configuration and either use Sender_party(if thats unique) or Sender_service(if thats unique).
http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm
Thanx
Aamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.