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: 

Function module to get the file path in the system for TEMP folder

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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,

0 Kudos

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