Skip to Content
avatar image
Former Member

File name in mapping

Hello,

How can I get file name in mapping.

Regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Apr 25, 2007 at 03:04 PM

    HI,

    See the below link

    Dynamic Configuration of Some Communication Channel Parameters using Message Mapping -

    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping

    Dynamic folder - in payload Multiple Comm Channels to 1 Receiver, all same interface & mappings

    Regards

    Chilla

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 25, 2007 at 10:14 AM

    1. In the sender file adapter , select Adapter Specific Attributes --> FileName.

    2. Use the code in this link to read the filename inside a UDF in your mapping.

    DynamicConfiguration conf = (DynamicConfiguration) container

    .getTransformationParameters()

    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

    DynamicConfigurationKey key = DynamicConfigurationKey.create(

    “http://sap.com/xi/XI/System/File”,

    “FileName”);

    String filename = conf.get(key);

    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm

    Regards

    Bhavesh

    Add comment
    10|10000 characters needed characters exceeded

    • I understand henrique, there is never any offence taken..it was just a light hearted comment...

      After all we are here to learn from others experience here and what better way to learn than make mistakes ( you never forget the lessons learnt from your mistakes )..

      I appreciate your correcting me if I am wrong, I would rather make a mistake here on the XI forum than at a client's location and design a incorrect solution..

      Regards

      Bhavesh

  • Apr 25, 2007 at 10:20 AM

    Apart from Bhavesh's reply, well you can refer this blog by Mike which explains the whole flow - /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14 😊

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 02, 2007 at 12:04 PM

    I am working on a similar problem. In my case the problem seems to be the following. When I use this UDF with a proper xml-file it works, with a non-xml file it does not work.

    I think it is not possible to put a UDF into a mapping if you are working with non-xml content.

    Are you working with xml or non-xml content?

    Add comment
    10|10000 characters needed characters exceeded