Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Introduction: 

This small piece of code help to create and delete folder on Presentation Server.

Code:  

*&---------------------------------------------------------------------*

*& Report ZKC_dir

*&---------------------------------------------------------------------*

*&Programmer: Krishna Chauhan (SPARTA Consulting)

*&How to create/delete directory on Presentation Server

*&---------------------------------------------------------------------*

REPORT ZKC_DIR.

*---function module to create folder on presentation server

CALL FUNCTION 'TMP_GUI_CREATE_DIRECTORY'

EXPORTING

dirname = 'C:\kc_test1'

NO_FLUSH = ' '

EXCEPTIONS

FAILED = 1

OTHERS = 2

.

IF sy-subrc <> 0.

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

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

ENDIF.

*---function module to delete folder on presentaion server

*---Uncomment the code if require to delete the folder

*CALL FUNCTION 'TMP_GUI_REMOVE_DIRECTORY'

* EXPORTING

* dirname = 'C:\kc_test'

* EXCEPTIONS

* FAILED = 1

* OTHERS = 2

* .

*IF sy-subrc <> 0.

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

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

*ENDIF.