Posts

Showing posts from January, 2021

Delete Suppress

Image
 Sometimes we get SUPPRESS entries which causes wrong results in the mapping. Below UDF can be used to remove those entries: for(int i=0; i<a.length; i++) { if(!a[i].equals(ResultList.SUPPRESS)) result.addValue(a[i]); }   ------------------------------------------------AMOR FATI----------------------------------------------

Senderport + Idoc number in Filename

Image
 Requirement is to place the file with the below naming convention: " senderport " + ORDERS + " IDoc Number " + .eof ex.  PRD ORDERS_ 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---------------------------------------------------

File to Mail (with static Filename)

Image
This can be useful for requirements when the user/business wants the payload file during testing or for other purposes. No ESR Objects involved. In ID, Create File/NFS/SFTP sender channel: Enable ASMA RECEIVER MAIL CHANNEL: OUTPUT MAIL: This will work for Text files or XML files at Sender side. For pdf's,  change content type to application/pdf  and filename =   sample.pdf For CSV files, FCC has to be used at the sender side along with the above module. For SFTP sender, Messagetransform bean module can be used for FCC as well as configuring the content type & disposition. Content - Disposition  response header is a header indicating if the  content  is expected to be displayed inline in the browser, that is, as a Web page or as part of a Web page, or as an attachment, that is downloaded and saved locally. The  Content - Type  entity header is used to indicate the media  type  of the resource. In responses, a  Content - Type...