* Be care this could not be undone.
REPORT z_hide_code. DATA: gt_code(72) TYPE c OCCURS 0, gv_code LIKE LINE OF gt_code, gt_code2(72) TYPE c OCCURS 0. PARAMETERS: program LIKE sy-repid. START-OF-SELECTION. READ REPORT program INTO gt_code. IF sy-subrc NE 0. MESSAGE e398(00) WITH 'Report' program 'not found.'. * ATTENTION: * READ REPORT on a hidden source code return SY-SUBRC=8 !!! ENDIF. "IF sy-subrc NE 0 READ TABLE gt_code INDEX 1 INTO gv_code. * append *special* 1st line to hide cource code APPEND '*@#@@[SAP]' TO gt_code2. LOOP AT gt_code INTO gv_code. APPEND gv_code TO gt_code2. ENDLOOP. INSERT REPORT program FROM gt_code2. MESSAGE 'Report was hidden' TYPE 'i'.