根据工号获取姓名

逻辑很简单,就是去标准表中关联取值,源代码如下:

DATA: w_firstname TYPE adrp-name_first.
  DATA: w_lastname  TYPE adrp-name_last.
  CLEAR: e_name.
  IF I_ernam IS NOT INITIAL.
    CLEAR: w_firstname,w_lastname.
    SELECT SINGLE name_first name_last
      INTO (w_firstname, w_lastname)
      FROM usr21
      INNER JOIN adrp ON usr21~persnumber = adrp~persnumber
      WHERE usr21~bname = i_ernam.
    CONDENSE: w_firstname,w_lastname.
    CONCATENATE w_lastname w_firstname INTO e_name.
    CONDENSE e_name.
  ENDIF.

执行结果:

posted @ 2016-11-25 18:00  小鱼儿游  阅读(1020)  评论(0编辑  收藏  举报