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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.