cancel
Showing results for 
Search instead for 
Did you mean: 

File Adapter - Only process filename without reading data

0 Kudos

Dear community,

I struggle with following requirement:

We have very big files in a shared folder and therefore we like to get the filenames of this files to write a protocol in ERP.

I am using the sender file adapter (7.3) and do know the ASMA. This only works if the adapter read the data of the files - then we get the filename in dynamic config.

Now I struggle in getting a clue how to just read the filename via file-adapter - without touching the data.

At the end, only the filename (e.g. 'default0101.xml') should be transfered in the target system.

Can somebody please give me a hand on this?!

Best regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Regarding your first requirement that how to get the filename.

You can achieve this by using asma parameter (filename) of channel.

And regarding your second requirement that you want only filename and not want to pick file.

You can try and select the processing mode as test.hopefully it should work.

Regards

NAVEEN

0 Kudos

Hi Naveen, thanks for your help.

Both of your ideas I used but now getting the follwing error:

com.sap.aii.utilxi.misc.api.BaseRuntimeException: Content is not allowed in prolog.


I have a mapping in the ICO where I only refer to the dynamic config parameters and put the filename via an UDF in a target field of the target interface. The UDF is correct and works for other scenarios too.


What kind of source interface do i need when for my requirement of not reading the data of the file?

Now I put some dummy-interface without any usage in mapping - because I just use the UDF.


Regards,

Jens

Former Member
0 Kudos

HI Jens,

For the error you are getting plz refer the kink below:

Here they have discussed about the same.

Regards

Naveen

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Jens,

By using the UDF code below and Sender file channel ASMA option checked , you can extract the source filename

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

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

String s = conf.get(key);

return s;

Regards,

Ramesh.

0 Kudos

Dear all,

emberassing to say but the problem is in front of the display. After re-configuring and checking all single options I was able to solve the problem - even with ASMA and the simple UDF.

Thanks for your investments,

regards Jens

praveen_sutra
Active Contributor
0 Kudos

hi Jens,

In order to read the file name dynamically u can use below link.

http://scn.sap.com/docs/DOC-58827

hope this helps.

thanks and regards,

Praveen T

iaki_vila
Active Contributor
0 Kudos

Hi Jens,

Does the problem appear with the small ones?. May be the files are not written completely, have you tried to use the option "Msecs to Wait Before Modification Check"?.

Regards.