on 06-20-2012 11:46 AM
Hi All,
I have a SFTP Receiver communication channel and I need to concatenate the "Plan number" to the filename (the last 5 digits of plan number). The interface is Proxy to File scenario and the source data type has "Plan Number" as field. I searched and found some documents but couldn't able to move further as I am new to pi, can anybody explain me with screen shots or documents if possible. Is there anyway to achieve this by without any coding because I used graphical mapping.
Eg: Filename = Payroll(+Plan Number last 5 character).txt
Plan Number = '123456'.
The result should be --> Filename = Payroll23456.txt
Thanks in advance,
Vichu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
One more thing. The UDFs above won't work correctly with SFTP adapter, until you change the Dynamic Configuration Key namespace from:
http://sap.com/xi/XI/System/File
to:
http://advantco.com/xi/XI/SFTP
Also, don't forget to enable use of Adapter-Specific Message Attributes in the receiver Communication Channel.
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
I tried with Name space http://advantco.com/xi/XI/SFTP
still I was not successfull .I am getting MP: exception caught with cause javax.resource.ResourceException: 4:
Because I have given * as the filename in receiver SFTP channel.I have also enable ASMA attributes in receiver sftp channel.
Regards
Advit
Hi,
you can try putting this UDF in the message mapping, the field "Number" should be input to the mapping.
public String getFileName(String Number,Container container)
{
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("'http://advantco.com/xi/XI/SFTP","FileName");
String s="payroll"+Number.substring(Number.length()-5)+".txt" ;
conf.put(key, s);
return " ";
}
Map this UDF to root element or any dummy field in target XML.
In Receiver CC you need to set these
1. Receiver Comm Channel has ASMA , file name and "fail if ASMA missing" ticked.
2. in receiver communication channel -> File access parameters-> File name scheme -
> put any value say "*". This step is not compulsory.
3. In target directory of receiver CC put the name of the directory where you need the file to be formed.
Hope this solves your problem.
Hi Greg,
Thanks for the helpful information . Updated the UDF.
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Eg: Filename = Payroll(+Plan Number last 5 character).txt
Plan Number = '123456'.
Constant (Payroll) + paln number + substring(1,5)(if 6 digits only) -> concat -> costant(.txt) -> concat -> udf-> target root node
refer below screen:
udf:
String a = "";
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 "";
and in comm.channel, enable ASMA properties.
and regfer below thread:
http://wiki.sdn.sap.com/wiki/display/XI/Combining+three+different+aspects+of+PI+in+one+shot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vichu
Following link might help u
http://www.saptechnical.com/Tips/XI/ASMA/Index.htm
Regards
Gagandeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
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.