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 statement

Former Member
0 Likes
616

Hi All,

I am using the followinf code.

LOOP AT li_dberchz3 INTO wa_ldberchz3.

lwa_nettobtr = lwa_nettobtr + wa_ldberchz3-nettobtr.

AT END OF belnr.

wa_ldberchz4-mwskz = wa_ldberchz3-mwskz.

wa_ldberchz4-belnr = wa_ldberchz3-belnr.

wa_ldberchz4-nettobtr = lwa_nettobtr.

APPEND wa_ldberchz4 TO i_dberchz4.

CLEAR : lwa_nettobtr,

wa_ldberchz4.

ENDAT.

ENDLOOP.

When the cursor enters the statement AT END OF belnr, in work area wa_ldberchz3 all the fields after belnr are becoming **'s .can anybody tell me how it works.

Rgds,

Sai

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
582

Hi

same problem i have faced previously and it is solved as follows:

declare the two work areas:

lwa_item2-local

gwa_item2-global

of same type .

LOOP AT gt_item2 INTO lwa_item2.

gwa_item2 = lwa_item2.

:

:

:

at end of

:

:

endat.

endloop.

sure it will solve the issue

thanks

AM

5 REPLIES 5
Read only

Former Member
0 Likes
582

do as follows.

data: g_fl type c.

LOOP AT li_dberchz3 INTO wa_ldberchz3.

lwa_nettobtr = lwa_nettobtr + wa_ldberchz3-nettobtr.

AT END OF belnr.

g_fl = 'X'.

ENDAT.

if g_fl = 'X'.

wa_ldberchz4-mwskz = wa_ldberchz3-mwskz.

wa_ldberchz4-belnr = wa_ldberchz3-belnr.

wa_ldberchz4-nettobtr = lwa_nettobtr.

APPEND wa_ldberchz4 TO i_dberchz4.

CLEAR : lwa_nettobtr,

wa_ldberchz4.

clear g_fl.

endif.

ENDLOOP.

Read only

Former Member
0 Likes
582

hi some times it will happens like when the data length is small than the original you declared ...use off-set values for this..it is better

Read only

Former Member
0 Likes
582

Hi Prasad,

In the control statements AT NEW OF <field> and AT END OF <field> stars are displayed for the values which are on the right of that field. So If the fields are in this order mwskz, belnr, nettobtr Just say AT END OF nettobtr to avoid the stars.

Regards,

Swapna.

Read only

Former Member
0 Likes
583

Hi

same problem i have faced previously and it is solved as follows:

declare the two work areas:

lwa_item2-local

gwa_item2-global

of same type .

LOOP AT gt_item2 INTO lwa_item2.

gwa_item2 = lwa_item2.

:

:

:

at end of

:

:

endat.

endloop.

sure it will solve the issue

thanks

AM

Read only

Former Member
0 Likes
582

Hi,

Do tour code in this way...

Declare another work area say wa_ldberchz5 type wa_ldberchz3.

LOOP AT li_dberchz3 INTO wa_ldberchz3.

lwa_nettobtr = lwa_nettobtr + wa_ldberchz3-nettobtr.

CLEAR wa_ldberchz5.

wa_ldberchz5 = wa_ldberchz3.

AT END OF belnr.

wa_ldberchz4-mwskz = wa_ldberchz5-mwskz.

wa_ldberchz4-belnr = wa_ldberchz5-belnr.

wa_ldberchz4-nettobtr = lwa_nettobtr.

APPEND wa_ldberchz4 TO i_dberchz4.

CLEAR : lwa_nettobtr,

wa_ldberchz4.

ENDAT.

ENDLOOP.

The above code will solve your problem.