03-31-2011 2:03 PM
Hi All,
Is there any function module that I can use to get the file path in the system for TEMP folder.
I mean, i am supposed to give only TEMP as the input for that function module and I need to get the path of that in the system as the output.
I am unsing 4.0 version.
Please advice.
Regards
Ramesh
03-31-2011 2:19 PM
In Higher versions, we can use the below code:
-
call method CL_GUI_FRONTEND_SERVICES=>ENVIRONMENT_GET_VARIABLE
exporting
VARIABLE = 'TEMP'
importing
VALUE = LV_TMP
exceptions
CNTL_ERROR = 1
others = 2.
if SY-SUBRC <> 0.
message id SY-MSGID type SY-MSGTY number SY-MSGNO
with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call method CL_GUI_CFW=>FLUSH
exceptions
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
others = 3.
if SY-SUBRC <> 0.
Error handling
endif.
concatenate lv_tmp '\' into folder_path.
-
But need to know in the lower versions like 3.1h and 4.0,
03-31-2011 2:26 PM
Look at old now (obsolete) FM WS_QUERY
CALL FUNCTION 'WS_QUERY'
EXPORTING
environment = 'TEMP'
query = 'EN'
IMPORTING
return = lv_tmp
EXCEPTIONS
inv_query = 1
no_batch = 2
frontend_error = 3
OTHERS = 4.
Regards,
Raymond