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

Function module to get desktop path

Former Member
0 Likes
5,718

Hi All,

Is there any function module to get the desktop path?

I have tried using CL_GUI_FRONTEND_SERVICES=>GET_DESKTOP_DIRECTORY, but it is not returning any value.

I can't hardcode "C:\Documents and Settings\<<<user-name>>>\Desktop" as some users have their desktop in "D:\Documents and Settings\<<<user-name>>>\Desktop".

Thanks in advance.

Regards,

Arun Mohan

1 ACCEPTED SOLUTION
Read only

Former Member
2,193

Hello

No problem:


data: str TYPE string.

CALL METHOD cl_gui_frontend_services=>GET_DESKTOP_DIRECTORY
  changing
    DESKTOP_DIRECTORY     = str
  EXCEPTIONS
    cntl_error            = 1.
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=>UPDATE_VIEW.

WRITE: str.

2 REPLIES 2
Read only

Former Member
2,194

Hello

No problem:


data: str TYPE string.

CALL METHOD cl_gui_frontend_services=>GET_DESKTOP_DIRECTORY
  changing
    DESKTOP_DIRECTORY     = str
  EXCEPTIONS
    cntl_error            = 1.
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=>UPDATE_VIEW.

WRITE: str.

Read only

0 Likes
2,193

Thanks Dzed Maroz,

It solved the issue.

Arun