DATA: BEGIN OF it_temp OCCURS 0,
persnumber LIKE usr21-persnumber.
INCLUDE STRUCTURE itab.
DATA: END OF it_temp.
DATA: BEGIN OF it_adrp OCCURS 0.
INCLUDE STRUCTURE adrp.
DATA: END OF it_adrp.
DATA: BEGIN OF it_adcp OCCURS 0.
INCLUDE STRUCTURE adcp.
DATA: END OF it_adcp.
PERFORM getuserdata.
*&---------------------------------------------------------------------*
*& Form getuserdata
*&---------------------------------------------------------------------*
FORM getuserdata.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE it_temp
FROM usr02 INNER JOIN usr21
ON usr02~bname = usr21~bname.
SELECT * FROM adrp
INTO CORRESPONDING FIELDS OF TABLE it_adrp.
SELECT * FROM adcp
INTO CORRESPONDING FIELDS OF TABLE it_adcp.
LOOP AT it_temp.
READ TABLE it_adrp WITH KEY persnumber = it_temp-persnumber.
IF sy-subrc = 0.
it_temp-name_text = it_adrp-name_text.
ENDIF.
READ TABLE it_adcp WITH KEY persnumber = it_temp-persnumber.
IF sy-subrc = 0.
it_temp-department = it_adcp-department.
ENDIF.
MODIFY it_temp.
MOVE-CORRESPONDING it_temp TO itab.
APPEND itab.
ENDLOOP.
ENDFORM. " getuserdata
阅读(1213) | 评论(0) | 转发(0) |