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

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.