FUNCTION zps_get_username.
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" VALUE(I_UNAME) TYPE SY-UNAME
*" EXPORTING
*" VALUE(E_USERNAME) TYPE NAME_TEXT
*"----------------------------------------------------------------------
DATA: l_department TYPE ad_dprtmnt,
l_addrnumber TYPE ad_addrnum,
l_persnumber TYPE ad_persnum,
l_uname TYPE sy-uname,
l_name_first TYPE ad_namefir,
l_name_last TYPE ad_namelas.
SELECT SINGLE persnumber addrnumber INTO
(l_persnumber, l_addrnumber)
FROM usr21
WHERE bname = i_uname.
IF sy-subrc = 0.
SELECT SINGLE name_first name_last INTO (l_name_first,l_name_last)
FROM adrp
WHERE persnumber = l_persnumber.
IF sy-subrc = 0.
CONCATENATE l_name_last l_name_first INTO e_username.
CONDENSE e_username NO-GAPS.
ENDIF.
ENDIF.
ENDFUNCTION.
阅读(971) | 评论(0) | 转发(0) |