To activate objects programmatically

To activate objects programmatically

The below code can be used to activate any object programmatically.

PARAMETERS p_object type e071-obj_name.

CALL FUNCTION 'REPS_OBJECT_ACTIVATE'
  EXPORTING
    OBJECT_NAME        = p_object
   OBJECT_TYPE        = 'REPS'
 EXCEPTIONS
   NOT_EXECUTED       = 1
   OTHERS             = 2
          .
IF SY-SUBRC = 0.

  Message 'Objects ACtivated' Type 'I'.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

The value 'REPS' is passed for the field  'OBJECT_TYPE'  in the function module which would accept only Report names as inputs. Hence this sample code can be used to activate only other report programs. By changing that value other types of objects can also be activated.

Labels

activate activate Delete
program program Delete
'reps_object_activate' 'reps_object_activate' Delete
function function Delete
module module Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.