cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver File CC error

Former Member
0 Kudos

Dear All

I am using Java mapping to change the filename dynamically. I am getting follwoing error in my receiver file communication channel.

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.exception.standard.SAPIllegalArgumentException: The parameter "argument" has the value "remote:///PI/OUTPUT//", so it contains the character "remote:///PI/OUTPUT//" which is not allowed

I am passing follwoing values as file access arguments

Target Directory: /PI/OUTPUT/

File Name Scheme: *

Please let me know why this error is coming as I have no other argument to pass other than this.

Regards

Sourabh

Accepted Solutions (1)

Accepted Solutions (1)

former_member187339
Active Contributor
0 Kudos

Hi Sourabh,

I guess the star in the directory path is the problem, why do you require FileName Schema?

Regards

Suraj

Former Member
0 Kudos

I need to remove the timestamp from incoming file and insert the current timestamp.

For this purpose I need the file name schema.

former_member181985
Active Contributor
0 Kudos

post ur dynamic configuration code;

Former Member
0 Kudos

Hi Praveen

this is my code in Java mapping program:

try

{

//The following is for the FileName in the File Adapter

DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");

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

String MyFileName = dynamicconfiguration.get(key);

MyFileName=MyFileName.substring(0,(MyFileName.length())-15);

// Date format

SimpleDateFormat Sdate = new SimpleDateFormat("yyyyMMddHHmmSS");

String currentdate=Sdate.format(new Date());

//end

MyFileName=MyFileName.concat(".").concat(currentdate);

MyFileName=MyFileName.concat(".BAD");

dynamicconfiguration.put(key, MyFileName);

}catch(Throwable t)

{ t.printStackTrace(); }

former_member187339
Active Contributor
0 Kudos

Hi Sourabh,

the code looks ok, and you are changing the filename. But in the question you are specifying about the target directory. So if you want to place the file in some random target directory the you need to change the same in the udf itself.

or am i missing something here!!

Regards

Suraj

Former Member
0 Kudos

Dear Suraj

The error which I pasted in my question is from communication channel where I am passing the specific target directory name"/PI/OUTPUT/"

and file name as "*" because as seen in the code I am altering the file name.

Please tell if you need any other info

Sourabh

former_member187339
Active Contributor
0 Kudos

Hi Sourabh,

Since you are edititng the filename using udf. Pass %FileName% as the Filename in the channel (so that the dynamic values can come there in runtime)

Also select Adapter specific identifiers in the recever channel

Regards

Suraj

Former Member
0 Kudos

Dear Suraj

I have passed %FileName% as the File Name Schema, the following error is comming in the communication channel

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.exception.standard.SAPIllegalArgumentException: The parameter "argument" has the value "remote:///PI/OUTPUT//%FileName%", so it contains the character "remote:///PI/OUTPUT//%FileName%" which is not allowed

Sourabh

former_member187339
Active Contributor
0 Kudos

Hi Sourabh,

Don't use star's ( i used them to make FileName bold in SDN)

Regards

Suraj

Former Member
0 Kudos

Hi Suraj

Thanks for the correction, I added %FileName% in file name schema and now a file is created by "%FileName%". (Some Progress)

How can I get the name which I am passing from the Java Mapping program?

Sourabh

former_member187339
Active Contributor
0 Kudos

Hi Sourabh,

Have you selected adapter specific identifiers in the receiver channel and filename? I guess not. Please recheck

Regards

Suraj

Former Member
0 Kudos

Hi Suraj

I have checked the adapter specific message attributes and checked

1. Use adapter specific Message attribute

2. File Name

Still the error is coming as

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.exception.standard.SAPIllegalArgumentException: The parameter "argument" has the value "remote:///PI/OUTPUT//", so it contains the character "remote:///PI/OUTPUT//" which is not allowed

When I check option "Fail if Adapter Specific Message AttributeMissing" I get follwoing error

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but was not supplied in the XI Message header

former_member187339
Active Contributor
0 Kudos

Hi Sourabh,

This means your udf was not called and the possible reason are:

1. Target node may not be created or

2. The sender Adapter specific identifier->Filename was not selected

It is always advisable to use this udf during the creation of the root node of the target xml structure (because its occurrence is 1..1 and it will always be created).

Where have you used!!!

Regards

Suraj

Former Member
0 Kudos

Hi Suraj

I am using Java mapping and not a graphical one

My requirement is to create a flat file without any xml tags. Please see the follwoing code for Java mapping:

public class JMapWorkOrderNRealTime extends DefaultHandler implements StreamTransformation

{

private Map map;

private OutputStream out;

private Map param;

String lineEnd = System.getProperty("line.separator");

private String Data;

public JMapWorkOrderNRealTime()

{

}

public void setParameter(Map map)

{

param = map;

if(param == null)

param = new HashMap();

}

public void execute(InputStream in, OutputStream out)throws com.sap.aii.mapping.api.StreamTransformationException

{

try

{

//The following is for the FileName in the File Adapter

DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");

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

String MyFileName = dynamicconfiguration.get(key);

MyFileName=MyFileName.substring(0,(MyFileName.length())-15);

// Date format

SimpleDateFormat Sdate = new SimpleDateFormat("yyyyMMddHHmmSS");

String currentdate=Sdate.format(new Date());

//end

MyFileName=MyFileName.concat(".").concat(currentdate);

MyFileName=MyFileName.concat(".BAD");

dynamicconfiguration.put(key, MyFileName);

}catch(Throwable t)

{ t.printStackTrace(); }

try

{

String line = null;

String lineEnd = System.getProperty("line.separator");

BufferedReader bin = new BufferedReader(new InputStreamReader(in));

StringBuffer buffer = new StringBuffer();

while((line=bin.readLine())!=null)

{

out.write(line.getBytes());

out.write(lineEnd.getBytes());

}

}catch(Throwable t)

{

t.printStackTrace();

}

}

former_member181985
Active Contributor
0 Kudos

Open the message in MONI and check the DynamicConfiguartion header under SOAP header.

If it contains fileName exactly what you are expecting as per java program, It should reflect in the file system.

Enable ASMA(with FileName checked) in the Receiver File channel and activate the channel. Send a new message and check.

Former Member
0 Kudos

Dear Praveen

The Dynamic configuration tag is not containing "FileName" instead it is

<SAP:Record namespace="http://sap.com/xi/XI/Message/30/general" name="senderAgreementGUID">

I have enabled ASMA with File Name checked...

former_member187339
Active Contributor
0 Kudos

Hi Sourabh,

>>I have enabled ASMA with File Name checked...

Enable In both sender and receiver adapters

Check these:

1. In inbound message are you seeing the Filename in dynamic configuration? I think atleast this should be visible

2. After request message mapping is the Filename having the value as you expected? (I guess you are facing problem in this)

3. Try to add some trace infor to see what the parameters like Filename etc is having values during different operations like substring, by using the trace commands.

check this wiki pages for the usage of trace with java mapping

http://wiki.sdn.sap.com/wiki/display/XI/SampleJAVAMappingcodeusingPI7.1+API

Regards

Suraj

Former Member
0 Kudos

Thanks Suraj

This has solved the problem

Sourabh

0 Kudos

Hi Suraj,

Right now I am facing same issue.

Can you pls help to fix this issue.

Answers (1)

Answers (1)

former_member181985
Active Contributor
0 Kudos
  • is wild card entry which we use basically for a particular selection

You cannot use * as filename for receiver file channle. It shuld be specific name.