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: 

How can I use abap/4 to get local computer disk drives?

former_member311833
Participant
0 Kudos

Hi expert,

Currently, I can get the folders or files in disk drive c:\ or d:\ by FM : TMP_GUI_DIRECTORY_LIST_FILES.

But I can't get how many disk drive in user computer. Is there any FM or Object can get disk drive information in user computer?

Just like follow picture, I want to get disk drive a:\, c:\, g:\, e:\, f:\.

best regards,

Eric

4 REPLIES 4

ramakrishnappa
Active Contributor
0 Kudos

Hi Eric,

Use the method DIRECTORY_BROWSE of class CL_GUI_FRONTEND_SERVICES. Also check other methods which can be useful for you.

Hope this helps you.

Regards,

Rama

0 Kudos

Dear Ramakrishnappa,

I had tried the method CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE. The method just popup screen. Is there any method can return the disk drive list.

DATA: L_PATH TYPE STRING.

CLEAR L_PATH.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE

EXPORTING

WINDOW_TITLE = 'TEST TITLE'

INITIAL_FOLDER = L_PATH

CHANGING

SELECTED_FOLDER = L_PATH

EXCEPTIONS

CNTL_ERROR = 1

ERROR_NO_GUI = 2

NOT_SUPPORTED_BY_GUI = 3

others = 4.

Best regards,

Eric

Former Member
0 Kudos

Hi Eric

What is the business requirement for this scenario?

Regards

Arden

0 Kudos

He Arden,

There is a user requirement for upload file to our SAP UNIX server. We have to add authorization management & encryption for user choose file.

The GUI like follow picture.

C:\

  windows

  test.txt

D:\

  user_folder

  test.xlsx

Maybe the file in user USB drive. So I have to get the disk drive from current user computer and set disk drive as root node.

Best regards,

Eric