My program simply put the locks on users if the 'LOCK' checkbox is selected.
Everything works and the users records are updated in the USR02
. When this change occurs I want that it also be reflected in IT_USR02
, i.e. DB table USR02 and itab it_usr02
should be identical.
SELECT-OPTIONS: USER_ID FOR USR02-BNAME.
START-OF-SELECTION.
SELECT BNAME
USTYP
UFLAG
FROM USR02
INTO TABLE IT_USR02
WHERE BNAME IN USER_ID.
LOOP AT IT_USR02 INTO ST_USR02.
IF LOCK = 'X'.
CALL FUNCTION 'BAPI_USER_LOCK'
EXPORTING
USERNAME = ST_USR02-BNAME
TABLES
RETURN = I_BAPI_RETURN.
MOVE-CORRESPONDING IT_USR02[] TO IT_ZATO_LOCK_UNLOCK[].
MODIFY ZATO_LOCK_UNLOCK FROM TABLE IT_ZATO_LOCK_UNLOCK.
ENDIF.
ENDLOOP.
Essentially after BAPI_USER_LOCK
function is called I want that change to be made in the IT_USR02 table as well. From there I copy the contents of IT_USR02
to my custom table ZATO_LOCK_UNLOCK
.
Everything here seems to work fine I just can't figure out how to update my internal table. Any help would be appreciated.