‎2008 Oct 30 8:19 PM
Hi Guys,
can you please let me know which is less time consuming LOOP selection?
LOOP at BKPF where belnr = ws-Belnr.
IF i_bkpf-blart = 'A1'. ...........................check the condition and enter in loop ITAB
loop at itab into ws_itab where a = b.
delete record.
endloop.
ELSEIF i_bkpf-blart = 'B1' . check the condition and enter in loop ITAB
loop at itab into ws_itab where a = b.
delere record.
endloop.
ENDIF.
ENDLOOP.
OR**************************************************************************
LOOP at BKPF where belnr = ws-Belnr.
loop at itab . -
Enter the LOOP ITAB and then check condtion
IF i_bkpf-blart = 'A1'.
delete record.
elseif i_bkpf-blart = 'B1' .
delere record.
endif.
endloop.
ENDLOOP.
‎2008 Oct 30 8:44 PM
‎2008 Oct 30 8:32 PM
‎2008 Oct 30 8:35 PM
Hi ,
But the second loop LOOPs across all the records of ITAB and then check condition.
And first one just LOOPs when condition is met.
What do you say?
Regards,
Yogita
‎2008 Oct 30 8:37 PM
LOOP at BKPF where belnr = ws-Belnr.
IF i_bkpf-blart = 'A1'. ...........................check the condition and enter in loop ITAB
loop at itab into ws_itab where a = b.
delete record.
endloop.
ELSEIF i_bkpf-blart = 'B1' . check the condition and enter in loop ITAB
loop at itab into ws_itab where a = b.
delere record.
endloop.
ENDIF.
ENDLOOP.
**************************************OR*************************************************************************
LOOP at BKPF where belnr = ws-Belnr.
loop at itab . Enter the LOOP ITAB and then check condtion
IF i_bkpf-blart = 'A1'.
delete record.
elseif i_bkpf-blart = 'B1' .
delere record.
endif.
endloop.
ENDLOOP.
‎2008 Oct 30 8:44 PM
‎2008 Oct 30 8:53 PM
Hi Rob,
But as per the requirement, I need to select multiple records and hence I need to use LOOP instead of READ which selects single record.
Please advice.
Regards,
Yogita
‎2008 Oct 30 9:16 PM