cancel
Showing results for 
Search instead for 
Did you mean: 

File Receiver Adapter : ASMP Question

Former Member
0 Kudos

Hi all,

My requirement says i need to name my target file like this: <XYZ><YYYYMMDDHHMMSS>

Now i knw that i can achive this via the Adapter Specific msg parameter but don't know how to proceed.

i have done this so far,

After referin this thread:[;

In the mapping done a UDF:

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

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

String SourceFileName = conf.get(key);

String newfilename=SourceFileNamea; //Where a is a string that holds YYYYMMDDHHMMSS+

// change to new file name

conf.put(key, newfilename);

return "";

i have not done anything else apart from this UDF in the design, nothing in the Configuration, Which is why maybe i am not getting the desired result. My recv channel has this in the file name: XYZ

i get a file in the target directory like this: nullYYYYMMDDHHMMSS Don't knw y i get the null @ the beginning and don't know y it overrides the XYZ in the recv adapter File name tab.

Accepted Solutions (1)

Accepted Solutions (1)

former_member750652
Contributor
0 Kudos

Hi Hankovak,

Please do the following check list:

1. Map to any of the higher level node it can be top most message type node (eg.MT_Msg1).So that the modified name will be available on the target side ASMA.

2Check the syntax again by right clicking on the UDF and selecting QUEUE.

3.In the communication channels of both sender and receiver check the ASMA check box.

4.in the receiver side communication channel give * asterik in the receiver file name scheme. uncheck the add timestamp as well .your UDF might be using the time stamp from the communication channel reporting Null value in the file name.This will definitely solve your problem

Please refer the follwing blog on ASMA for more clearifications.

http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417700)ID0406368850DB01026224637153001718End...

Thanks,

Ram.

Former Member
0 Kudos

Thank u very much,

will try it out....

Just wanted to tell u that i have a SOAP> FILE scenario..

Do i have to chck the ASMP in the Sender adapter?? would that matter?

Your answers are very much appreciated.

Hank

former_member750652
Contributor
0 Kudos

Hi Hankovak,


Just wanted to tell u that i have a SOAP> FILE scenario..
Do i have to chck the ASMP in the Sender adapter?? would that matter? 

In general...we need to check them (If SP>=14) .Because you are modifying the Communication channel attributes(eg., File name,Time stamp etc) of sender or receiver. So as to make them available for mapping during run time, for modification you must check that particular attribute.By checking the same attribute on the receiver side .The modified file name will be active will be used .

But your case is different asz you are using SOAP as sender. .If at all your file name is a part of pay load just use that particular field that as one of the inputs to UDF and modify inside it.

Thanks,

Ram.

Former Member
0 Kudos

HI,

In your udf it is trying to get the filename from the sender adapter and adding timestamp and passing to the receiver adapter

as your sender is not having filename it is getting passed as null value ,so you need to element of your source structure in order to get the filename

so pass the filename as source parameter to your udf

HTH

Rajesh

Former Member
0 Kudos

Thnk u so much guys,

Rajesh your suggestion has solved my requirement. Just modified the UDF which will do the deed...

//write your code here

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

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

String SourceFileName = conf.get(key);

String newfilename="XYZ"+a; // XYZ expected filename and a is datetime stamp

// change to new file name

conf.put(key, newfilename);

return "";

DONE Deal.....In the receiver, just chck USE ASMP, FILE NME.. in the file name schema, give anythng, it overrides it anywys...

Cheers:)

Answers (0)