on 11-06-2009 3:39 AM
Dear friends,
Kindly explain me what the following code is doing in mapping:
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
a=a+".txt";
conf.put(key,a);
return a;
This code is reading the FileName of the input file and then appending ".txt" to it....so ifname of the input file is Renu then the output of this UDF will be Renu.txt
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1) Suppose in case I get a requirement to change the name of my output file based on some value in the input payload or input filename
OR
2) I need to read the name of the input file and then pass it to some field on target for business need
In both the above cases I will use Dynamic Configuration concept.
This will be enabled when we select Adapter Specific Message Attribute checkbox in the communication channel
Both Help and SDN have good documents and blogs on this topic....just make a search with Dynami Configuration and you will get the details.
Can you ask the person, who created the mapping, as to why is he/ she concatenating Constant(PO) and Date and then passing it to the UDF?
f we go by the logic then the output of the UDF will never be PO.txt (if you say some constant PO is passed to the UDF)
The output will be decided at runtime!
Regards,
Abhishek.
HI Abhishek,
In runtime when i check the paylaod after mapping in Techical routing step it is coming as PO20091105.txt in the Target filed - Filename.
In runtime it is not taking any file this udf simply adding only .txt.
My question is can we remove this udf if the above one is my requirement? If so how will i add .txt for it.
I dont think that the UDF is doing any job (ASMA is not enabled in CC)
My question is can we remove this udf if the above one is my requirement? If so how will i add .txt for it.
Use the below mapping logic:
Constant(PO)
----> Concat1(TextFunction)----->
CurrentDate(DateFunction)
----------> Concat2(TextFunction) ----> target Field
Constant(.txt) ---------------------->
Update:
Please note that depending on the format of date you may need to use DateTransform function just after the CurrentDate function in the above mentioned logic (all the functions mentioned are standard functions available in message mapping)
Regards,
Abhishek.
Edited by: abhishek salvi on Nov 6, 2009 9:58 AM
Hi Abhishek,
Thank you for your quick response. Your logic will work. I have one quick question what is this following code will exactly do:
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
Kindly tell me abhishek
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
It will help pull the name of the input file and put in a dynamic variable --> key (any name can be given here instead of key)
DynamicConfigurationKey is actually a class name and is accessed using dynamic (runtime) constant --> DYNAMIC_CONFIGURATION
FileName is a variable name present in the Message Header
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.