Skip to Content

File Adapter - Only process filename without reading data

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 05, 2015 at 10:20 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2015 at 10:40 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 05, 2015 at 12:47 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2015 at 01:33 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 06, 2015 at 11:16 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded