Gooddays experts, I found thisquery that joinsthreetables,
SELECT a~BUDAT AS BUDAT a~BWART AS BWART a~AUFNR AS AUFNR
b~ftrmi AS ftrmi b~stlnr AS stlnr
c~matnr AS matnr c~werks AS werks
INTO CORRESPONDING FIELDS OF TABLE gt_result
FROM AUFM AS a INNER JOIN afko AS b ON a~aufnr = b~aufnr
INNER JOIN resb AS c ON b~aufnr = c~aufnr
WHERE a~AUFNR IN SO_AUFNR.
Thisquery is delayed,so i decided todo the following
SELECT a~BUDAT AS BUDAT a~BWART AS BWART a~AUFNR AS AUFNR
b~ftrmi AS ftrmi b~stlnr AS stlnr
INTO CORRESPONDING FIELDS OF TABLE gt_result
FROM AUFM AS a INNER JOIN afko AS b ON a~aufnr = b~aufnr
WHERE a~AUFNR IN SO_AUFNR.
IF NOT ti_resb IS INITIAL.
SELECT matnr aufnr
FROM resb
INTO TABLE ti_resb
FOR ALL ENTRIES IN gt_result
WHERE aufnr = gt_result-aufnr.
ENDIF.
IF NOT gt_result IS INITIAL.
LOOP AT gt_result ASSIGNING <fs_data>.
DATA: l_matnr.
CLEAR: l_matnr.
SELECT SINGLE matnr INTO l_matnr FROM resb
WHERE matnr = <fs_data>-matnr.
<fs_data>-matnr = l_matnr.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM gt_result COMPARING aufnr.
ENDIF.
I need to getthematerialresb table, do debbugbut not getthe value, please can guidemewhereis mymistake.
Best regards.