cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PI 7.0 Dynamic Configuration Receiver File Adapter Invalid FileName

Former Member
0 Kudos

Hello,

I searched through all the blogs and forums but I still cannot find the error for my configuration.  Keep in mind that I tried using FileZilla with the requested file name, and it was transferred successfully.

We have a request for a specific file name in "OC_RRD_NORSKE_Purchase Order_Timestamp.xml". As such I used ASMA. 

I also ticked the following attributes in ASMA:

1. Use ASMA

2. Fail if Adapter-Specific Message Attributes Missing

3. File Name

Below is my UDF

UDF: where a = Purchase Order and b = currentDate

String filename = new String("");

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

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

filename = "OC_RRD_NORSKE_"+a+"_"+b+".xml";

conf1.put(key1,filename);

 

return filename;

-------------

Here is the error log in the Runtime Workbench:

25.07.2012 15:24:59 Success The message was successfully retrieved from the receive queue.

25.07.2012 15:25:00 Success Write to FTP server "10.111.2.34", directory "\test\out", -> file "OC_RRD_NORSKE_00201/12001772/OP_20120725150238.xml"

25.07.2012 15:25:00 Success Transfer: "BIN" mode, size 11825 bytes, character encoding -

25.07.2012 15:25:00 Error Attempt to process file failed with com.sap.aii.adapter.file.ftp.FTPEx: 550 Unexpected reply codeFilename invalid

25.07.2012 15:25:00 Success Acknowledgement creation triggered for type: SystemErrorAck

25.07.2012 15:25:00 Success Acknowledgement creation triggered for type: AckNotSupported

25.07.2012 15:25:00 Error Exception caught by adapter framework: Unexpected reply codeFilename invalid

25.07.2012 15:25:00 Success Acknowledgement sent successfully for type: SystemErrorAck

25.07.2012 15:25:00 Success Acknowledgement sent successfully for type: AckNotSupported

25.07.2012 15:25:00 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Unexpected reply codeFilename invalid: com.sap.aii.adapter.file.ftp.FTPEx: 550 Unexpected reply codeFilename invalid

25.07.2012 15:25:00 Error Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Unexpected reply codeFilename invalid: com.sap.aii.adapter.file.ftp.FTPEx: 550 Unexpected reply codeFilename invalid.

25.07.2012 15:25:00 Error The message status set to NDLV.

-----------

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bryan,

Do you set the adapter specific parameters in the adapter file?  In follow the example:

In de follow the example code:

Regards

Marcelo Macedo

Former Member
0 Kudos

Here is my Receiver Adapter Configuration

Here is my UDF

I still get the same error

former_member181985
Active Contributor
0 Kudos

>>OC_RRD_NORSKE_00201/12001772/OP_20120725150238.xml

you are getting extra slashes (/) from your code.

check dynamic configuration header in moni after mapping pipeline step.

Former Member
0 Kudos

Hello,

Here is my filename during the routing step in the pipeline:

Former Member
0 Kudos

Here is the Purchase Order provided; which is the basis for my Variable a

former_member181985
Active Contributor
0 Kudos

>>filename = "OC_RRD_NORSKE_"+a+"_"+b+".xml";

We can not have / or \ as part of file names

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Are you creating the directory path or just filename? If it's filename then it is wrong.

zameerf
Contributor
0 Kudos

If you have to put the purchase order(variable a) in your file name, then since it has / you cannot create a file name with / and you would get the error

Unexpected reply codeFilename invalid: com.sap.aii.adapter.file.ftp.FTPEx: 550 Unexpected reply codeFilename invalid.


May be you can replace / with _ before passing the variable a to UDF with the help of replace string function.

Answers (4)

Answers (4)

Former Member
0 Kudos

Thank you for all your answers.  Character "/" was indeed not allowed in the filename for FTP.

Solution used:

PO number -> replaceString -> UDF

Kr,

Bryan

former_member184681
Active Contributor
0 Kudos

Hi Bryan,

Let me provide a summary of the discussion so far, and my point of view on the problem. Based on the CC monitor log you provided and the configuration screens, it looks like your configuration is OK - I think that's good news . The problem is that some special characters are not accepted by particular operating systems, as part of file names. In your case, it is the "/" character inside the PO number, that causes the problem. You can try to get rid of such special characters for instance with the following statement in your UDF code, just before you the conf1.put statement:

filename.replaceAll("[\\/:*?\"<>|]", "_"); //you can use your own replacement character instead of "_"

Also, you must know that creating a valid file name still has some factors that are not verified by this regular expression. See more detailed discussion on this topic here:

http://stackoverflow.com/questions/754307/regex-to-replace-characters-that-windows-doesnt-accept-in-...

Regards,

Greg

gagandeep_batra
Active Contributor
0 Kudos

Hi Bryan,

Following link might help you.

http://www.saptechnical.com/Tips/XI/ASMA/Index.htm

Regards

Gagandeep

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Use filename declaration as follows

String filename="";

You dont need to do forward slashes with quote here.

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

Change as below.

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

Make sure you pass purchase order and current date as string format.

Check whether that helps.

Former Member
0 Kudos

Still waiting for the corrected UDF to be transported to PIT.  Will inform you after

Former Member
0 Kudos

Same error persists:

Time Stamp Status Description

25.07.2012 17:31:24 Success Acknowledgement creation triggered for type: AckNotSupported

25.07.2012 17:31:24 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Unexpected reply codeFilename invalid: com.sap.aii.adapter.file.ftp.FTPEx: 550 Unexpected reply codeFilename invalid

25.07.2012 17:31:24 Success Acknowledgement creation triggered for type: SystemErrorAck

25.07.2012 17:31:24 Error Attempt to process file failed with com.sap.aii.adapter.file.ftp.FTPEx: 550 Unexpected reply codeFilename invalid

25.07.2012 17:31:24 Error Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Unexpected reply codeFilename invalid: com.sap.aii.adapter.file.ftp.FTPEx: 550 Unexpected reply codeFilename invalid.

25.07.2012 17:31:24 Error The message status set to NDLV.

25.07.2012 17:31:24 Success Acknowledgement sent successfully for type: SystemErrorAck