Skip to Content
avatar image
Former Member

How determine Value based on file pickup location/folder

Hi All,

I have an interface which is used for 2 different 3rd parties. The file formats, idoc etc are same for both the 3rd parties so using just the same interface. It is an File to IDOC interface. The only diff is that the incoming files are located in diff folders based on the 3rd party.

Requirement is that based on the file location we should be able populate a data filed in IDOC to help differentitate from where has the data come.

So if file is picked from folder A, then edidc-mescod = 'A'

else if the file is picked from folder 'B', then edidc-mescod = 'B'

Though I am using a single Message mapping but I am using 2 separate comm-channels for the 2 parties A,B involved. Appreciate if you could let me know if its possble to populate the IDOC field based on the file pickup location.

Regards

Shirin

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Aug 06, 2008 at 11:22 AM

    Hi,

    1. In the Sender File Communication Channel check the option Set Adapter-Specific Message Attribute and check the option Directory.

    2. Use this UDF.

    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    
    String Directory = conf.get(key);
    
    if (Dirrectory.equals("A"))
    return "A";
    else
    return "B";

    Test it only by posting the file and not in the Test tab.

    Thanks

    SaNv...

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 18, 2008 at 01:44 PM

    Hey

    write a UDF using dynamic configuration and either use Sender_party(if thats unique) or Sender_service(if thats unique).

    http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm

    Thanx

    Aamir

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Thanks for the reply. Do you have a sample UDF for this requirement. I unfortunately do not have any Java skills.

      Appreciate if you could help.

      Many thanks

      Shirin

  • avatar image
    Former Member
    Jul 21, 2008 at 10:16 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 21, 2008 at 09:40 AM

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

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

    String fileDir = conf.get(key);

    if (fileDir.equals("A")){

    return "A";

    else

    return "B"

    //write if else as per your requirement

    Map output of this UDF to edidc - mescod

    Add comment
    10|10000 characters needed characters exceeded