2014 Apr 30 3:38 PM
Hello ABAP Experts,
I am trying to execute a report, but while debugging I am getting time out dump on 2nd SELECT statement.
SELECT vbeln
matnr
werks
lgort
volum
lgnum
FROM lips
INTO TABLE i_volume
FOR ALL ENTRIES IN i_likp
WHERE vbeln EQ i_likp-vbeln
AND lgort IN s_lgort
AND werks IN s_werks.
IF i_volume[] IS INITIAL.
MESSAGE text-001 TYPE 'I'.
STOP.
ENDIF.
SORT i_volume BY vbeln.
SELECT matnr
meinh
umrez
umren
FROM marm
INTO TABLE gt_marm
FOR ALL ENTRIES IN i_volume
WHERE matnr = i_volume-matnr
AND meinh = 'ME' OR meinh = 'KG'.
IF sy-subrc EQ 0.
SORT gt_marm BY matnr.
DELETE ADJACENT DUPLICATES FROM gt_marm COMPARING matnr.
ENDIF.
Can you please help me out there ?
Thanks
Swanand
2014 Apr 30 3:46 PM
Hi Swanand,
try
WHERE matnr = i_volume-matnr
AND ( meinh = 'ME' OR meinh = 'KG' ).
you should also filter first materials to a temporary table with only distinct matnr entries and use it instead of i_volume.
regards,
Edgar
2014 Apr 30 3:46 PM
Hi Swanand,
try
WHERE matnr = i_volume-matnr
AND ( meinh = 'ME' OR meinh = 'KG' ).
you should also filter first materials to a temporary table with only distinct matnr entries and use it instead of i_volume.
regards,
Edgar
2014 Apr 30 3:54 PM
Hey use a single condition instead of multiple conditions in where clause.
WHERE matnr = i_volume-matnr
AND meinh IN ( 'ME' , 'KG' ).
2014 Apr 30 4:20 PM
Hi,
Move i_volume entries to a temporary internal table and delete adjacent duplicates from temp table before using the 2nd Select statement and also build a range table for MEINH values.
Regards,
Suresh