Skip to Content
0
Former Member
Nov 08, 2011 at 03:54 AM

Performance Measure - Select SUM and Collect Statement.

908 Views

Dear All,

I am using YNME_PROCESS_PO_CUST Badi in this i writing some validation Delivery Completion.

For that i need to calculate GR qty and Delivery quantity based on this i need some validation. But here i confussed which statement i need to use for bast performance.

Note: In Badi Item Level Data will be process one by one..like item level 10 then 20 then 30......Like that

Code will like that---

SELECT SUM( menge ) FROM ekes

INTO l_delqty

WHERE ebeln = ls_mepoitem-ebeln

AND ebelp = ls_mepoitem-ebelp.

SELECT SUM( dabmg ) FROM ekes

INTO l_grqty

WHERE ebeln = ls_mepoitem-ebeln

AND ebelp = ls_mepoitem-ebelp.

l_delqty1 = l_grqty - l_delqty.

IF l_delqty1 NE 0.

ls_mepoitem-elikz = ''.

CALL METHOD im_item->set_data( ls_mepoitem ).

ENDIF.

I check in SE38 response is better in this code.

Other code may be like that .. same data will be like upper/

SELECT * FROM ekes

INTO CORRESPONDING FIELDS OF TABLE it_ekes

WHERE ebeln = ls_mepoitem-ebeln

AND ebelp = ls_mepoitem-ebelp.

LOOP AT it_ekes.

MOVE-CORRESPONDING it_ekes TO it_ekes1.

COLLECT it_ekes1.

CLEAR it_ekes.

ENDLOOP.

READ TABLE it_ekes1 INDEX 1.

IF sy-subrc EQ 0.

l_delqty1 = it_ekes1-menge - it_ekes1-dabmg.

ENDIF.

IF l_delqty1 NE 0.

ls_mepoitem-elikz = ''.

CALL METHOD im_item->set_data( ls_mepoitem ).

ENDIF.

Can any send me document--

Regard

DK