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

API for creating a directory in the application server

Former Member
0 Likes
705

Hello,

Does anyone knows a way to create a directory in the application server? Something similar to

CL_GUI_FRONTEND_SERVICES but for managing files in the application server?

Thanks in advance

Diz IsMi

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
585

Actually, CL_GUI_FRONTEND_SERVICES=>Directory_Create works really good for me.



REPORT ZRICH_0001 .

data: path type string.
data: rc type sy-subrc.


path = '\172.52.72.651qfilesvr400S109XXXXusrsapTSTSYStest'.



CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_CREATE
  EXPORTING
    DIRECTORY                = path
  CHANGING
    RC                       = rc
  EXCEPTIONS
    DIRECTORY_CREATE_FAILED  = 1
    CNTL_ERROR               = 2
    ERROR_NO_GUI             = 3
    PATH_NOT_FOUND           = 4
    DIRECTORY_ACCESS_DENIED  = 5
    DIRECTORY_ALREADY_EXISTS = 6
    UNKNOWN_ERROR            = 7
    others                   = 8
        .
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,

Rich Heilman

Hello,

Does anyone knows a way to create a directory in the application server? Something similar to

CL_GUI_FRONTEND_SERVICES but for managing files in the application server?

Thanks in advance

Diz IsMi

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
586

Actually, CL_GUI_FRONTEND_SERVICES=>Directory_Create works really good for me.



REPORT ZRICH_0001 .

data: path type string.
data: rc type sy-subrc.


path = '\172.52.72.651qfilesvr400S109XXXXusrsapTSTSYStest'.



CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_CREATE
  EXPORTING
    DIRECTORY                = path
  CHANGING
    RC                       = rc
  EXCEPTIONS
    DIRECTORY_CREATE_FAILED  = 1
    CNTL_ERROR               = 2
    ERROR_NO_GUI             = 3
    PATH_NOT_FOUND           = 4
    DIRECTORY_ACCESS_DENIED  = 5
    DIRECTORY_ALREADY_EXISTS = 6
    UNKNOWN_ERROR            = 7
    others                   = 8
        .
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,

Rich Heilman

Read only

0 Likes
585

Is there something like CL_GUI_FRONTEND_SERVICES that you can use during background jobs? I'm looking for something that will allow me to move/rename files and create directories.

Davis