Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Control Break event

Former Member
0 Likes
745

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

6 REPLIES 6
Read only

Former Member
0 Likes
720

can u paste your code here to see what could be wrong?

Read only

Former Member
0 Likes
720

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...?

Read only

Former Member
0 Likes
720

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

Read only

naveen_inuganti2
Active Contributor
0 Likes
720

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

Read only

Former Member
0 Likes
720

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

Read only

Former Member
0 Likes
720

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