‎2008 Jul 09 10:40 AM
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
‎2008 Jul 09 10:59 AM
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
‎2008 Jul 09 10:42 AM
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.
‎2008 Jul 09 10:44 AM
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
‎2008 Jul 09 10:50 AM
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.
‎2008 Jul 09 10:59 AM
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
‎2008 Jul 09 11:56 AM
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.