DevOps and System Administration Discussions
Dive into SAP DevOps and system administration. Join discussions to collaborate on optimizing workflows, share knowledge, and leverage resources effectively.
cancel
Showing results for 
Search instead for 
Did you mean: 

Close System via Report (SCC4 and SE06)

florian_lamml2
Explorer
0 Kudos

Hello,

can the following report be used safely to automatically lock a system? In general it works, but is there any concern or a better approach to automatically close a system?

It is important to ensure that the opening of the system is not forgotten.

*&---------------------------------------------------------------------*
*& Report Z_BC_CLOSE_SYSTEM
*&---------------------------------------------------------------------*
*& 
*&---------------------------------------------------------------------*
REPORT Z_BC_CLOSE_SYSTEM.
 
* Update T000 (SCC4)
TABLES: T000.                     " SCC4 Control Table
UPDATE T000 SET CCNOCLIIND = '3', CCCORACTIV = '2', CCCOPYLOCK = 'L'.
 
* Update SE06 Software Components
TABLES: DLV_SYSTC.                " Software Components
UPDATE DLV_SYSTC SET CHANGEABLE ='N'.
 
* Update SE06 Namespaces
TABLES: TRNSPACE.                 " Namespaces
UPDATE TRNSPACE SET EDITFLAG = ' '.
 
* Update SE06 Global Status
TABLES: TADIR.                    " System Change
UPDATE TADIR SET EDTFLAG = 'N' WHERE PGMID = 'HEAD' AND OBJECT = 'SYST' AND OBJ_NAME = ''.
 
COMMIT WORK.
 
IF sy-subrc <> 0.
  MESSAGE 'Error occurred' TYPE 'E' DISPLAY LIKE 'I'.
  RETURN.
ENDIF.
 
MESSAGE 'SYSTEM CLOSED' type 'I'.

Regards

2 REPLIES 2

hariom_garg
Active Participant
0 Kudos

Hi Florian,

If this report is full filling your purpose then fine. But if will consider the audit points in to consideration then i think go with standard tcodes Scc4 and SE06 since client open and close is a critical and sensitive activity so perform the same with some process with incident and approvals in place.

so you can easily find out the logs with process evidences.

Regards

Hariom

florian_lamml2
Explorer
0 Kudos

Hello,

clear normal everything via SE06 and SCC4. The report is only for security reasons, in case somebody forgets to close the system that this happens in any case (e.g. every day at 24:00).

Regards