Skip to Content
avatar image
Former Member

Dynamic configuration for Filepath using Javamapping for Passthrough

Hello Experts,

I am trying to create a dynamic filepath through java mapping .
I am using a FTP receiver adapter .

I have written the follwoing java code


private static final DynamicConfigurationKey KEY_FILEPATH =
       DynamicConfigurationKey.create(
           "http://sap.com/xi/XI/System/File",
           "Directory");
  

  
   private static final DynamicConfigurationKey KEY_FILENAME =
       DynamicConfigurationKey.create(
           "http://sap.com/xi/XI/System/File",
           "FileName");

String FileName = conf.get(KEY_FILENAME);

String dir = "XXXX"+"/"+FileName.substring(2,5)+"/"+"/XXX/"+"/";

conf.put(KEY_FILEPATH, dir);

FTP receiver adapter will have the connection details.

I am getting the below error :

"FTPEx: 550 Unexpected reply codeCreate directory operation failed.. For details, contact your FTP server vendor".

However, I find there is no issue connecting to FTP server, when I tried connecting without dynamic configuration, it works good.

thanks for your inputs and help

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Aug 18, 2015 at 02:55 AM

    Rama,

    Seems FTP user does not have access to create folder (try to give 666 access to folder where you are creating dynamic folder). Please use FileZilla to test FTP user access.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 18, 2015 at 01:40 AM

    can you add "/" at the beginning and see if that helps

    String dir = "/"+"XXXX"+"/"+FileName.substring(2,5)+"/"+"/XXX/"+"/";

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Hareesh,

      I tried with

      String dir = "/" +"XXX"+"/"+FileName.substring(7,9)+"/"+"Global"+"/";

      conf.put(KEY_FILEPATH, dir);

      conf.put(KEY_FILENAME, FileName);

      Still it dint work.

      Thanks for your inputs

  • Aug 18, 2015 at 01:58 AM

    Rama,

    Your directory path format looks wrong.

    String dir = "XXXX"+"/"+FileName.substring(2,5)+"/"+"/XXX/"+"/";

    It should be

    String dir = "XXXX"+"/"+FileName.substring(2,5)+"/"+"XXX"+"/";

    No escape sequence is required for "/".

    Try giving the complete path that you use in the FTP receiver adapter.

    Also make sure that

    String FileName = conf.get(KEY_FILENAME);

    is returning value.

    Regards,

    Arun

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 18, 2015 at 02:34 AM

    Hi,

    Aside from Hareesh's suggestion, have you checked in the receiver cc if the Create Target Directory is ticked?

    Regards,

    Mark

    Add comment
    10|10000 characters needed characters exceeded