Tuesday, January 26, 2021

Senderport + Idoc number in Filename

 Requirement is to place the file with the below naming convention:


"senderport" + ORDERS + "IDoc Number" + .eof


ex. PRDORDERS_1192934631.EOF


Here, the sender port is   SAPPRD


To achieve this:


Use a UDF 








Use FORMATNUMBER function to remove the leading zeroes.




















UDF Code:


String name = null;

name =  a + "ORDERS_" + b + ".EOF";


DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);


if(conf!=null)

{

DynamicConfigurationKey filename = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");

conf.put(filename, name);

}


return a;

 


--------------------------------------------------AMOR FATI---------------------------------------------------









No comments:

Post a Comment