Создаем и запускаем отчет с указанием нового владельца (SAP NOTE 709619)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
REPORT Z_SYSVAR_OWNER_CHANGE . TABLES: VARID, TRDIR. DATA: L_SUBRC LIKE SY-SUBRC. parameters: p_report like varid-report obligatory. select-options: s_varian for varid-variant. parameters: newusrid like varid-aename. CALL FUNCTION 'SUSR_USER_CHECK_EXISTENCE' EXPORTING USER_NAME = newusrid EXCEPTIONS USER_NAME_NOT_EXISTS = 1 OTHERS = 2 . IF SY-SUBRC <> 0. message i124(01) with newusrid. exit. ENDIF. SELECT SINGLE * FROM TRDIR WHERE NAME = P_REPORT. PERFORM AUTHORITY_CHECK(SAPLSVAR) USING L_SUBRC. IF L_SUBRC NE 0. MESSAGE I626(DB) WITH TRDIR-SECU. EXIT. ENDIF. SELECT * FROM VARID CLIENT SPECIFIED WHERE MANDT = '000' AND REPORT = p_report AND VARIANT in s_varian AND VARIANT LIKE 'CUS&%'. IF SY-SUBRC = 0. varid-aename = newusrid. update varid client specified. else. MESSAGE E268(DB) WITH P_REPORT. endif. ENDSELECT. write: / 'THE OWNERSHIP OF FOLLOWING VARIANTS ARE CHANGED '. SELECT * FROM VARID CLIENT SPECIFIED WHERE MANDT = '000' AND REPORT = p_report AND VARIANT in s_varian. write: / varid-report, varid-variant. ENDSELECT. |