report test_bapi_user_unlock.
*---types and data
data: lt_return like bapiret2 occurs 0,
ls_return like bapiret2.
data: l_message(200).
*---selection screen
parameter: p_name like bapibname-bapibname .
*---start-of-selection
start-of-selection.
if not p_name is initial.
call function 'BAPI_USER_UNLOCK'
exporting
username = p_name
tables
return = lt_return.
else.
message 'Name is initial!' type 'S'.
leave list-processing.
endif.
if lt_return[] is initial.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
message 'Unlock Successfully!' type 'S'.
else.
*---返回错误或警告消息
loop at lt_return into ls_return.
concatenate l_message ls_return-message into l_message.
endloop.
message l_message type 'S' display like 'W'.
endif.
评论