Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting physical path from logical path

Former Member
0 Kudos

Hi,

I am using the FM FILE_GET_NAME to get the physical path for a given logical path which I have specified within the FILE transaction.

The code works fine when I run the program in foreground but it doesn't work when I run it in background.

Can anyone advise on why this is and how I can get this to work correctly in background aswell as foregroud.

The ultimate goal is to be able to poll a directory on the SAP server (which could be windows or unix) and to process the files in there.

Thanks,

Ruby

2 REPLIES 2

Former Member
0 Kudos

You canot activate FILE_GET_NAME in background mode, it requires user's interrupt.

Activate it according to sy-batch (eq X at background mode), meaning that if sy-batch is empty activate it and if it equals X initilize the file path with a default file without any user's interuction.

0 Kudos

Thank-you.

I would prefer to to use a default path if possible. The reason I defined a logical path was so that this could be defined outside the program.

Are you saying I cannot use this FM in background at all?

Is there another FM which will do the same thing but will work in background?

What I am trying to do is create a program which will run in the background polling a particular directory and then process the files in this directory if it finds any.

Do you know how I could achieve this using logical paths rather than using hardcoded paths?