SAP用户的名字保存在usr21和adrp中,
简单代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
REPORT ztest_fullname. DATA:g_persnumber TYPE usr21-persnumber, g_name_first TYPE adrp-name_first, g_name_last TYPE adrp-name_last. SELECT SINGLE persnumber INTO g_persnumber FROM usr21 WHERE bname = sy-uname. IF sy-subrc = 0. SELECT SINGLE name_first "First name. name_last "Last name FROM adrp INTO (g_name_first,g_name_last) WHERE persnumber = g_persnumber. IF sy-subrc = 0. WRITE: g_name_first , g_name_last . ENDIF. ENDIF. |
以上。
发表评论