cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Errors Log file to be sent via FTP

Former Member
0 Kudos

Hi All,

Functional specs of a file to file scenario require to create an aditional log file containing the file name, creation date and a list with the lines were a problem occurred with an error description and then send it to R3 via FTP.

Does anyone know if it's possible or not? and if it's possible, how could I do that?

Thanks in advance.

Cheers.

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Daniel,

This is possible.

1. To get the Source File name and and appned the date to it, you can use Adapter Specific Identtifers -- File Name in the Sender and receiver file adapter and in the message mapping, set the file name using this code,

2. Rest of error handling can error record creation for the error file can be handled via the mapping itself.

String newfilename="";
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
 
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
// Get Sourcefilename
String oldfilename=conf.get(key);
//get the date
java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
dateformat.format( new java.util.Date() );
 
//append source+date+L
String nwfilename=oldfilename+dateformat;
conf.put(key, newfilename);

Regards,

Bhavesh

Answers (1)

Answers (1)

former_member206604
Active Contributor
0 Kudos

Hi,

Yes it is possible, you can use the code given by Bhavesh for getting the file details. To do this you need to use BPM and here are the steps

1. Receive

2. Transformation (Split valid and Error records)

3. Send the valid records to the target

4. Send the error detail like record number, error description thru FTP (Get the file details as Bhavesh said)

Thanks,

Prakash