‎2008 Aug 25 12:12 PM
Hi,
I am using one loop and in that i am using another loop with where condition in that i am using AT END OF event. but it is not checking the value in the event and directly it is going to inner part of event. what should i do u can any body help me.
Regards,
Raj
‎2008 Aug 25 12:16 PM
‎2008 Aug 25 12:16 PM
when you are using control break statements don't use where condition.
if you still want to go for then filter the records first then Apply control break statements.
what exactly you are doing, and post the code...?
‎2008 Aug 25 12:18 PM
Hi,
As per what i can guess is...
LOOP....
LOOP......WHERE...
AT END OF ....
**Your code....
ENDAT.
ENDLOOP.
ENDLOOP.Here what you need to check is that how many times your second loop is getting executed.....
If only 1 time then the code is absolutely correct......
If more than 1 then this behaviour can be because of the WHERE condition.....
Regards,
Kunjal
‎2008 Aug 25 12:20 PM
Hi.....
Usally AT END OF event checks the codition... i.e if the loop is taking last lap for that filed or not!
loop at itab.
at end of <field>.
////
endat.
endloop.Here field belongs to itab.
So there may be an error in ur code.. Plz check it once.
or..
Try to post the similer code...
also study the F1 documentation for AT END OF.... if you are not good at this area.
Thanks,
Naveen.I
‎2008 Aug 25 12:22 PM
LOOP AT IT_MSEG INTO WA_MSEG WHERE EBELN = WA_EKPO-EBELN AND
EBELP = WA_EKPO-EBELP.
WA_DISP_DETAIL-BELNR = WA_MSEG-MBLNR.
L_MENGE2 = L_MENGE2 + WA_MSEG-MENGE.
WA_DISP_DETAIL-BELNR = WA_MSEG-MBLNR.
L_MENGE2 = L_MENGE2 + WA_MSEG-MENGE.
AT END OF MATNR.
L_MENGE1 = WA_EBAN-BSMNG - L_MENGE2.
IF L_MENGE1 > 0.
WA_DISP_DETAIL-G_POQTY = L_MENGE1.
ENDIF.
CLEAR L_MENGE2.
ENDAT.
APPEND WA_DISP_DETAIL TO IT_DISP_DETAIL.
CLEAR WA_DISP_DETAIL.
This is the Inner loop
‎2008 Aug 25 12:25 PM
WA_DISP_DETAIL-BELNR = WA_MSEG-MBLNR.
L_MENGE2 = L_MENGE2 + WA_MSEG-MENGE.
Sorry WA_DISP_DETAIL-BELNR = WA_MSEG-MBLNR.
L_MENGE2 = L_MENGE2 + WA_MSEG-MENGE.
is repeated twice