‎2010 Jul 15 11:03 AM
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
‎2010 Jul 15 11:07 AM
‎2010 Jul 15 11:11 AM
‎2010 Jul 15 11:16 AM
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
‎2010 Jul 15 11:21 AM
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
‎2010 Jul 15 12:15 PM
‎2010 Jul 15 12:43 PM
‎2010 Jul 15 12:50 PM
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.