SAP – Automatically close a SAP client for changes

This simple report will close the client, make sure to create a variant with the specific client and schedule a job to run this program.

*&——————————————————————————-*
*& Report ZBC_CLOSE_CLIENT
*& Created by Miki Barzilay – 23 Mar 2016
*&——————————————————————————-*
*& This Report will close the client for modification (SCC4)
*& You can create a variant for the client and excute this report as a daily job
*&——————————————————————————-*

REPORT ZBC_CLOSE_CLIENT.
TABLES: T000. “Control of clients
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (15) Title1 FOR FIELD P_CLIENT.
PARAMETERS : P_CLIENT TYPE STRING.
SELECTION-SCREEN END OF LINE.

*Let’s update the table T000
UPDATE T000 SET CCNOCLIIND = ‘3’
CCCORACTIV = ‘2’
WHERE MANDT = P_CLIENT.
COMMIT WORK.

INITIALIZATION.
PERFORM SELECTION_SCREEN_TEXT.
FORM SELECTION_SCREEN_TEXT.
Title1 = ‘Client’.
ENDFORM.