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

Regarding Function Module

Former Member
0 Likes
1,151

Hi to all,

Can anybody tell me how to use the following function module

CL_GUI_FRONTEND_SERVICES=>DIRECTORY_CREATE

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
882

hi,

check out the below sample code


DATA RC TYPE I.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_CREATE
EXPORTING
DIRECTORY = 'C:\teste'
CHANGING
RC = RC
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. 

5 REPLIES 5
Read only

Former Member
0 Likes
883

hi,

check out the below sample code


DATA RC TYPE I.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_CREATE
EXPORTING
DIRECTORY = 'C:\teste'
CHANGING
RC = RC
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. 

Read only

Former Member
0 Likes
882

Hi,

Please refer the code:


DATA RC TYPE I.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_CREATE
EXPORTING
DIRECTORY = 'C:\teste'
CHANGING
RC = RC
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.

WRITE RC.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
882

Hi abhijeet,

CL_GUI_FRONTEND_SERVICES is a class, not a FM

and creaet a object for the class like

data: o_service type reft to CL_GUI_FRONTEND_SERVICES.

and call the method DIRECTORY_CREATE using the object o_service.

go to se24 and give the calss name, u wil gind the method, and place the curson on the method DIRECTORY_CREATE

and click attributes tab then u can find the attrictues required for the method.

Hope this will help you,

Regards,

Sriram

Read only

Former Member
0 Likes
882

Its used to create folder in presentation server.

DATA: W_RC TYPE I.

CALL METHOD cl_gui_frontend_services=>directory_create

EXPORTING

directory = 'C:/RRR'

changing

rc = W_RC.

Read only

Former Member
0 Likes
882

Hi,

it is not a function module.

CL_GUI_FRONTEND_SERVICES is a class and DIRECTORY_CREATE is a method in that class.


DATA:ret_code TYPE I,
     dir TYPE string value 'C:\test1'."ur directory path
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_CREATE
  EXPORTING
    DIRECTORY                = dir
  CHANGING
    RC                       = ret_code.

rgds,

bharat.