Application Development and Automation 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: 
Read only

Get logical path

Former Member
0 Likes
3,301

Hi,

i need to create a new file on Application server, so i would like to get the physical name path of the logical path.

For example i would like to create a file named 'Z_20100405.txt'' into the logical folder DIR_TRANS (physical name : 'r:\usr\sap\D38\DVEBMGFDS') so at the end the file string will be like that : 'r:\usr\sap\D38\DVEBMGFDS\Z_20100405.txt'. After i can execute the command 'OPEN DATASET...'

Thanks

Cheers

7 REPLIES 7
Read only

Former Member
0 Likes
1,887

Hi,

Use function module "FILE_GET_NAME".

Reards

Vinod

Read only

0 Likes
1,887

Sorry but how can i use it ?

Read only

0 Likes
1,887

Hi,

Call the FM by passing the Logical Path name & and operating system (sy-opsys). Output parameter FILE_NAME will have the physical path. Concatenate the physical path & file name and use the same in OPEN DATASET.

Regards

Vinod

Read only

0 Likes
1,887

Ok,

it's not my need, i don't have logical filename ; i would like to create one or more files into a folder logical, so i need to get the physical name of it. The FM FILE_GET_NAME is good when you use a logical filename.

For my need i found the following code :

DATA: BEGIN OF searchpoints OCCURS 10,
dirname(75) TYPE c, " name of directory.
sp_name(75) TYPE c, " name of entry. (may end with *)
sp_cs(10) TYPE c, " ContainsString pattern for name.
END OF searchpoints.
CALL 'C_SAPGPARAM' ID 'NAME' FIELD 'DIR_RSYN'
ID 'VALUE' FIELD searchpoints-dirname.
WRITE :/ searchpoints-dirname.

DIR_RSYN is the logical path name available on my system.

Cheers

Edited by: ToraTora on Jul 15, 2010 12:21 PM

Read only

0 Likes
1,887

Check table PATH, it should solve the purpose.

Read only

0 Likes
1,887

Thanks Sheetal. This is a new point for me..

Read only

0 Likes
1,887

try sth like this:

 

    call function 'FILE_GET_NAME_AND_LOGICAL_PATH'
      exporting
        logical_filename = lds_name
        parameter_1      = xnor
      importing
        file_name        = sfile
        logical_path     = path
      exceptions
        file_not_found   = 01.
    if sy-subrc ne 0.
      message e300(bd) with lds_name.                         " TODO MG
    endif.
                                                                                select single pathextern from path into expth
           where pathintern = path.
    ...

grx

A.