Wednesday, September 22, 2010

How to remove a file on the presentation server

REPORT ZVENKATTEST.

parameters: p_file type rlgrap-filename .

at selection-screen on value-request for p_file .

CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_FILE'
IMPORTING
FILE_NAME = p_file
.
start-of-selection .


CALL FUNCTION 'GUI_DELETE_FILE'
EXPORTING
FILE_NAME = p_file
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.

write:/ 'the file' , p_file , 'removed successfully '.

No comments:

Post a Comment