Tuesday, March 9, 2021

Common SFTP channel errors/issues

 

Dangling Meta character issue :


Solution for Dangling Meta character issue :

Follow the below SAPNote.   Basically this issue occurs due to filenaming convention scheme.

Like file adapter, in SFTP * does not mean that it will accept all files.

In SFTP,    .*  is equal to * (as in FTP)


Cannot create target directory: Limit operation failed



Resolution:

This issue too is related to file naming convention in the receiver channel.

By putting a Tilde operator (~) in the beginning we can resolve this issue.

~ operator represents the Home directory for the user used in the channel configuration.

Ideally, without ~ operator too it should work but in some cases, we get the limit operation error.

Faulty path:  /To_FM

Corrected path:  ~/To_FM



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
























Tuesday, January 26, 2021

Delete Suppress

 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

 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---------------------------------------------------









File to Mail (with static Filename)

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 header tells the client what the content type of the returned content actually is. ... In requests, (such as POST or PUT ), the client tells the server what type of data is actually sent.





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













Monday, September 7, 2020

Xml to Json conversion issue in REST

 I had a requirement to convert XML to JSON format using rest receiver channel.

I wanted to remove the root JSON tag in the receiver channel.


My DT was

DT_Company

 Record

   Field

     field1

     field2

   Field3

   Field4

   Field5   


Refer note - 

2743939 - XML Payload to JSON Conversion in REST receiver adapter


I used setIgnoreElements and provided value Records to remove JSON tag in Module configuration

 and checked Strip out element in the receiver channel 













This works fine for single record.

Note ->

But in case of multiple records, this doesn't work.

I also haven't explored on this part yet, but seems that this can be sorted out using XML JSON Conversion Rules.

Helpful link - 

https://blogs.sap.com/2016/01/13/rest-adapter-in-sap-pipo-enhanced-xmljson-conversion/



AMOR FATI - LOVE OF FATE


Unable to see response message for SOAP Synch. setup

 I was able to get the response in SOAP UI but was not able to see any response message in message monitoring.


Steps taken to resolve the issue - 

Enable logging and staging in ICO









If want the response before mapping, then  add BI=3 like this 

BI=3,MS=3,AM=3


https://help.sap.com/viewer/6dbe2ddcde6a4087858c533f8032445b/7.31.25/en-US/48cbb487cea80783e10000000a42189d.html




AMOR FATI - LOVE OF FATE



SFTP sender channel not picking up files

 Recently for one of the interfaces configured, my Sender sftp channel was not picking up the files. 

FCC was configured for this channel (via module)

Initially, was getting dangling meta character error in the channel.

Filename pattern configured was   *.*








After that, changed it to only    .*


faced the below issue then -> channel was not picking file yet








referred note 2763483 - SFTP Sender Channel Issue : File Not getting picked up

After including parameter ignoreIncompleteFields as YES in FCC, issue was Resolved.




AMOR FATI - LOVE OF FATE