cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically determine the Remote Directory of FTP File locations in SAP Data Services

SandeshK
Participant
0 Kudos

Hello,

In SAP Data Services, I have setup a file location of FTP protocol. The FTP destination has more than 10 directories under the root directory and each directory has its own directories inside. I would need to dynamically determine the directory location inside this FTP destination and place a flat file in it.

Initially I thought this is easy to solve by using a global variable in the 'Remote Directory' and I can write a script to determine the remote directory location and place it in the global variable.

However Data services do not allow me to use variable in the Remote directory setting of the file location. So I need to use a static location which does not solve my problem I have.

I cannot create multiple file locations for all the directories because there are hundreds of them.

Do you have any pointers on how to determine the remote directory dynamically?

Thanks,
Sandesh

0 Kudos

Hi Sandesh,

I am also having the same scenario to be handled in my project.

Just wanted to check if you have got any solution to handle the multiple directories using same file location object by parameterizing it through Global variables?

Thanks,

Kamlesh Arya

SandeshK
Participant
0 Kudos

Hi Kamlesh,

Unfortunately we cannot use global variables in the file location properties. So I had to find a workaround by using batch scripting to achieve it.

Thanks,
Sandesh

0 Kudos

Thanks Sandesh for your response.

Would it be possible for you to guide on how you handled it using batch script?

Like copied files from SFTP location to your local location and consumed it or directly consumed it from SFTP location.

Any pointer on the batch script will be really helpful.

Regards,

Kamlesh Arya

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member187605
Active Contributor

You cannot use a Global Variable in a File Location definition.

jmuiruri
Product and Topic Expert
Product and Topic Expert
0 Kudos

Greetings sreeecenan & kumark_tib87 ,

Please see an example solution of how you can achieve this using bash script

KBA 3217756 contains a workaround script for both powershell and bash, this is just an example, you can extend the script further based on your requirements.

Best Regards,

Joseph

former_member598107
Participant
0 Kudos

sreeecenan

Regards

Arun Sasi

SandeshK
Participant
0 Kudos

Meanwhile before I received replies on this post, I have also raised the same question with SAP and they have taken up it as a feature for future release to include this possibility to determine the file location dynamically.

sreeecenan
Discoverer
0 Kudos

Hi Team,

Any updates on dynamic root directory in bods file locations. I am also facing the same issue and i want to check if there is any alternate solution to send remote directory name dynamically.

Thanks & Regards,

Sreekanth Gollaprolu.

0 Kudos

hi,

I have the same requirement, any solution?