on 09-25-2012 6:36 AM
Hi experts,
I am a kind of stuck with target file name, The interface is Idoc to XML
I want my target file name like shown below
Company.I.yyyymmddINVNO.xml
INVNO is the invoice number from source Idoc.
Can any one please help me in accomplishing the above.
Thanks,
Sridhar
Hi Sridhar ,
In communication channel -> adapter specific attributes check file name also and use the following udf .
public String Dynamic(String FileName, String Date,String invo, Container container) throws StreamTransformationException{
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
String myFileName = "" ;
myFileName = FileName + "_" + Date +invo+".xml";
conf.put(key, myFileName);
return myFileName;
}
1st parameter for this UDF is constant(i.e, Company.I. ).
2nd parameter is Date (use current date function and specify date and time format )
3 rd parameter invoice number from Input payload.
Don't forget to map udf to any node , then only ur dynamic configuration will work.
Let me know the result.
Regards
Hari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sridhar,
To get the dynamic file name you could use a variable substitution too if you have the parameter in the header or in payload.
Check Former Member blog
To acces to payload only need to put in the table for example:
var1 payload:root_element,1,second_tag,1
You build the path to reach the tag that contains the desired value.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is very basic Question , u need to check SCN before posting this kind of Basic Question anyhow refer below logic:
Company.I.yyyymmddINVNO.xml
if company is not a field
Conatant(Company.I.) + currentdate (standard date function) -> Concat -> invoice source field + concat -> constant(.xml) + Concat -> dynamicconf udf -> Target node .
dynamicConf udf:
public String dynamicConf(String a, Container container) throws StreamTransformationException{
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
conf.put(key,a);
return "";
oi ID on receiver communication channel:
Enable ASMA Properties on Advance tab and
Enable File name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sankar,
I know this is a basic question but i have a problem here, I have mentioned above. Sorry i thing i was not clear.
I will explain it clearly;
I have already got a Dynamic configuration applied for Target node.
The Dynamic configuration is meant to redirect the target file to different folder whenever line items are missing from the source Idoc.
Now my question is how do i apply the new dynamic configuration.
Please refer the below blog and achieve your file name with dynamic configuration.
Check Code the Dynamic Configuration part, particularly point 3 Q &A and points to remember.
Hope this would help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>I have already used dynamic configuration to redirect the message to another folder when line items are missing from source Idoc,
Do you have some condition in mapping to execute your current dynamic configuration code only when line items are missing?
And whether the new requirement for file name is only when you have line items?
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.