In case you want to create a directory from within SAP on the presentation server you can use the following function module.
GUI_CREATE_DIRECTORY
This function module creates a directory on the presentation server. You need to mention the complete path. Please find below some sample code.REPORT ZEX_CREATEDIRPRE .
Parameters: p_dirnm like RLGRAP-FILENAME.
CALL FUNCTION 'GUI_CREATE_DIRECTORY'
EXPORTING
DIRNAME = p_dirnm
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.
Parameters: p_dirnm like RLGRAP-FILENAME.
CALL FUNCTION 'GUI_CREATE_DIRECTORY'
EXPORTING
DIRNAME = p_dirnm
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.
No comments:
Post a Comment