BEGIN OF y_mara,
matnr TYPE matnr, "Material number
mtart TYPE mtart, "Material type
meins TYPE meins, "Base Unit of Measure
END OF y_mara,
wt_mara TYPE TABLE OF y_mara,
BEGIN OF y_afko,
aufnr TYPE aufnr, "Order Number
gltrp TYPE co_gltrp, "Basic finish date
gamng TYPE gamng, "Total order quantity
plnbez TYPE matnr, "Material Number
plnty TYPE plnty, "Task List Type
plnnr TYPE plnnr, "Key for Task List Group
plnal TYPE plnal, "Group Counter
END OF y_afko,
wt_afko TYPE HASHED TABLE of y_afko
with unique key AUFNR,
SELECT matnr "Material number
mtart "Material type
meins "Base Unit of Measure
FROM mara
INTO TABLE p_wt_mara
%_HINTS ORACLE 'INDEX("MARA" "MARA~T")'.
need help for below code to improve performance for AFKO selection other than innerjoin with forall entries is there any way to achive better performance
IF p_wt_mara[] IS NOT INITIAL.
SELECT A~aufnr "Order Number
A~gltrp "Basic finish date
A~gamng "Total order quantity
A~plnbez "Material Number
A~plnty "Task List Type
A~plnnr "Key for Task List Group
A~plnal "Group Counter
FROM afko as A
JOIN aufk as B ON A~aufnr = B~aufnr
INTO TABLE p_wt_afko
FOR ALL ENTRIES IN p_wt_mara
WHERE A~plnbez EQ p_wt_mara-matnr and B~bukrs = p_bukrs.
IF sy-subrc EQ 0.
SORT p_wt_afko BY aufnr.
ENDIF.
ENDIF.