cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC to File scenario with multiple directories on same FTP.

Former Member
0 Kudos

The scenario is IDOC -- to FTP (Receiver file adapter). Based on the condition in the sender IDOC say if EIDKA01-BSART = Y than the directory path on FTP server is 'A' ELSE 'B'.

There is only one reciever service defined for the FTP server in the Integration Directory. Its not multiple receiver scenario.

How do we do this?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi !

Just create an UDF in graphical mapping and put this code inside:

-


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

//get Key of Directory

DynamicConfigurationKey keyD = DynamicConfigurationKey.create( URLFile, "Directory");

//Replace value of Directory

conf.put(keyD,dir);

-


where "dir" contains the destination path depending on the EIDKA01-BSART value. When this code executes, if the receiver file adapter has the adapter-specific attributes (directory) checked, then it will set the "directory" value to the one specified in the "dir" variable.

Regards,

Matias

Former Member
0 Kudos

Hi Matias,

In the ID while I configure the comunication chaneel the value in the Target directory should be %dir% or %directory% ? I dont have to set the variable substitution right?

Thanks

Former Member
0 Kudos

Hi !

You could leave it blank, because the value will be put by the UDF function, no variable substitution and no %xxxx% neither.

Just remember to set the adapter-specific message attributes and within them, the "Directory".

Regards,

Matias

Former Member
0 Kudos

Sachin,

In the receiver communication channel for directory just put any dummy name (because it is mandatory we have to fill this else this will not activate) and also check the directory checkbox in adapter specific attributes. With this checking you will get the directory name from the UDF.

Regards,

---Satish

Answers (1)

Answers (1)

Former Member
0 Kudos

thanks a lot guys it does work