I need to pull data from 2 tables into 1 object. Both tables share equipment number, and I need to get the corresponding description from table EQKT and the owner ID from EQUZ.
DATA: BEGIN OF t_report OCCURS 3,
matnr LIKE eqkt-equnr,
mtart LIKE eqkt-eqktx,
maktx LIKE equz-J_3GEIGNER,
END OF t_report.*-
DATA: d_repid LIKE sy-repid.
*-----------------------------------------
*--Selection Screen
SELECT-OPTIONS: s_matnr FOR eqkt-equnr.
*-----------------------------------------
START-OF-SELECTION.
*-Read data
SELECT * FROM eqkt
WHERE equnr IN s_matnr.
CLEAR makt.
SELECT SINGLE *
FROM makt
WHERE matnr = eqkt-equnr AND
spras = sy-langu.
MOVE: eqkt-equnr TO t_report-matnr,
eqkt-eqktx TO t_report-mtart.
APPEND t_report.
ENDSELECT.
*This is where it stops working.
SELECT * FROM EQUZ
WHERE equnr IN s_matnr.
MOVE: EQUZ-J_3GEIGNER TO t_report-maktx.
APPEND t_report.
ENDSELECT.
The code compiles, and in the ALV in which I display it, it does properly display the "owner" at the top of the table, but no data is filled in for the owner (the equipment number and description are properly displayed)