Skip to Content
0
Former Member
Mar 25, 2008 at 10:59 AM

select and endselect explanatation

22 Views

Hello experts.

LOOP AT itab.

SELECT hwbas mwskz kschl hwste txgrp buzei kbetr INTO

(itab1-hwbas, itab1-mwskz, itab1-kschl, itab1-hwste,

itab1-txgrp, itab1-buzei, bset-kbetr)

FROM bset WHERE bukrs = bukrs

AND belnr = itab-belnr

AND gjahr = itab-gjahr

AND mwskz IN mwskz .

itab1-belnr = itab-belnr.

itab1-budat = itab-budat.

itab1-bldat = itab-bldat.

itab1-xblnr = itab-xblnr.

itab1-lifnr = itab-lifnr.

itab1-gjahr = itab-gjahr.

itab1-bukrs = itab-bukrs.

itab1-kbetr = ( bset-kbetr / 10 ).

APPEND itab1.

ENDSELECT.

ENDLOOP .

I am confused , how many times in the loop for a single record the select statement will go , in my case select statement is select 5 times for a record and then it goes for the loop for another record. i dont know why it is rotating in the loop for 5 times and then going for another record.

so please explain me the code inside the loop and at what time it will go for the second time in the loop that is for another record.

Thank you so much for all the replies.