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

Folder creation

Former Member
0 Likes
570

Hi all,

Is there any FM or class/method to create a folder in the C directory...

Pls help

I have a found class CL_GUI_FRONTEND_SERVICES->DIRECTORY_CREATE

i think it will create directory...i want only to create a folder in a directory..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
527

Directory and a Folder mean the same.

If you pass the DIRECTORY name as C:/Test/TEST/TEst, then it wil create a folder called TEST in a folder TEST in a folder TEST in the C drive.

Message was edited by:

Ravi Kanth Talagana

3 REPLIES 3
Read only

Former Member
0 Likes
528

Directory and a Folder mean the same.

If you pass the DIRECTORY name as C:/Test/TEST/TEst, then it wil create a folder called TEST in a folder TEST in a folder TEST in the C drive.

Message was edited by:

Ravi Kanth Talagana

Read only

0 Likes
527

Is it???

but when i write code as below it is giving error ::

CREATE OBJECT v_guiobj.

CALL METHOD V_GUIOBJ->DIRECTORY_CREATE

IMPORTING

VALUE = 'C:\PO PDFs'

CHANGING

RC = V_RETURN_CODE

EXCEPTIONS

DIRECTORY_CREATE_FAILED = 1

CNTL_ERROR = 2

ERROR_NO_GUI = 3

DIRECTORY_ACCESS_DENIED = 4

DIRECTORY_ALREADY_EXISTS = 5

PATH_NOT_FOUND = 6

UNKNOWN_ERROR = 7

NOT_SUPPORTED_BY_GUI = 8

WRONG_PARAMETER = 9.

Error as :: "" the field 'C:\PO PDFs' cannot be chnaged -""

Read only

0 Likes
527

This works like magic for me:

REPORT ZTEST.

data: v_subrc type i.

CALL METHOD cl_gui_frontend_services=>directory_create

EXPORTING

directory = 'C:/PO PDFs'

changing

rc = v_subrc

EXCEPTIONS

DIRECTORY_CREATE_FAILED = 1

CNTL_ERROR = 2

ERROR_NO_GUI = 3

DIRECTORY_ACCESS_DENIED = 4

DIRECTORY_ALREADY_EXISTS = 5

PATH_NOT_FOUND = 6

UNKNOWN_ERROR = 7

NOT_SUPPORTED_BY_GUI = 8

WRONG_PARAMETER = 9

others = 10

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards,

Ravi