Hi here is the best example for deleting the program using the function modules.
REPORT zdelete.
parameters:p_prog type sy-repid .
CALL FUNCTION 'RS_DELETE_PROGRAM'
EXPORTING
program = p_prog
SUPPRESS_CHECKS = ' '
SUPPRESS_COMMIT = ' '
SUPPRESS_POPUP = ' '
MASS_DELETE_CALL = ' '
WITH_CUA = 'X'
WITH_DOCUMENTATION = 'X'
WITH_DYNPRO = 'X'
WITH_INCLUDES = ' '
WITH_TEXTPOOL = 'X'
WITH_VARIANTS = 'X'
SKIP_PROGRESS_IND = ' '
FORCE_DELETE_USED_INCLUDES = ' '
EXCEPTIONS
ENQUEUE_LOCK = 1
OBJECT_NOT_FOUND = 2
PERMISSION_FAILURE = 3
REJECT_DELETION = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
Else.
Write:/ ‘the program’, p_prog , ‘ was deleted successfully ‘ .
ENDIF
No comments:
Post a Comment