2010 Mar 08 10:25 AM
Hi All,
I know the Logical file and Logical path name, i can see the complete path also from logical path name i.e. the physical file address through transaction FILE, e.g. /USR/TMP/ , but i want to display this path in one of the report output,
so please help me with the table or the function module which can give me the complete physical file path.
I checked the the table ADMI_FILES but it contains the file name or the Logical path name but the complete physical file address e.g /USR/TMP?, like this is not available. More over i tried function module file_get_name, still the physical address is not correct one, it is giving same address for all logical paths.
Kindly Guide me for this
Regards,
Nikesh Kumar
2010 Mar 08 11:02 AM
try sth like this:
CALL FUNCTION 'FILE_GET_NAME_AND_LOGICAL_PATH'
EXPORTING
LOGICAL_FILENAME = LDS_NAME
IMPORTING
FILE_NAME = sfile
LOGICAL_PATH = pth
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 = pth.
replace '<FILENAME>' with space into expth.
concatenate expth '/' sfile into sfile.
open dataset sfile for output in text mode encoding default.
A.
2010 Mar 08 10:27 AM
2010 Mar 08 10:29 AM
2010 Mar 08 10:43 AM
Hi Gautham,
I already checked the view V_FILEPATH but it contains the only the Logical Path name, not the whole physical path.
For physical path we have to got to transaction FILE, then select the physical path and then Physical address.
But i want the exact file path, e.g. /USR/TMP/
2010 Mar 08 10:45 AM
Did you check the finction module: FILE_GET_NAME ?
[http://help.sap.com/saphelp_nw04/helpdata/en/9f/db95e635c111d1829f0000e829fbfe/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/9f/db95e635c111d1829f0000e829fbfe/content.htm]
BR,
Suhas
2010 Mar 08 10:48 AM
2010 Mar 08 10:48 AM
Hi Suhas,
yes i checked this function module but the problem is that, for all logical path it is giving same file nam /usr/sap/SBD/SYS/global/tempfile. But when i go in trasaction file and check the path provided in physical file address is entirely different. But this function module is giving this path only for all logical paths.
BR,
Nikesh
2010 Mar 08 10:51 AM
Did you check the SAP help documentation for the func. module ?
You have to pass the logical filename & not the logical filepath
Alternatively for filepath you can use the view V_PATH.
BR,
Suhas
2010 Mar 08 10:54 AM
Hi Gautham,
I check this view V_PATH as well, but how can we extract the data from it and disply in the report?
2010 Mar 08 10:58 AM
Yes Suhas,
You are right we need to give Logical file name but the problem is that it is giving the same physical path for all file names which is different when we see in the trasanction FILE.
e.g. if i run for file name WORKFILE_TEMPORARY_DATA then the FM gives /usr/sap/SBD/SYS/global/tempfile as file path but if i go and check in transaction file then it is different
2010 Mar 08 11:08 AM
Hello,
Excerpt from the SAP documentation:
Suppose we have a logical file name EMPTY with the physical file name TEST, connected to a logical path that has no specification of a physical path. ...
Call the FM: FILE_GET_NAME ....
The system created an emergency file name, whose path depends on the installation of the current R/3 System.
I think this might be the cause for this behavior. Check if the physical path of the logical path has been defined correctly & actually exists in the app server.
BR,
Suhas
2010 Mar 08 11:02 AM
try sth like this:
CALL FUNCTION 'FILE_GET_NAME_AND_LOGICAL_PATH'
EXPORTING
LOGICAL_FILENAME = LDS_NAME
IMPORTING
FILE_NAME = sfile
LOGICAL_PATH = pth
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 = pth.
replace '<FILENAME>' with space into expth.
concatenate expth '/' sfile into sfile.
open dataset sfile for output in text mode encoding default.
A.
2010 Mar 08 11:35 AM
@andreas, You are genious, Points awarded. Thanks a lot
@Suhas and Gautham thanks a lot, points awarded, your answer was helpful
Edited by: nikesh kumar on Mar 8, 2010 12:39 PM