02-26-2007 1:13 PM
in at new control break statement. if control level changes after control level fileds if it is numeric fields it become zeroes, non numeric fields become asterisks. if we want to aoid that changes? what we have to do
02-26-2007 1:30 PM
Hi ch,
1. this will solve the difference.
2. we can use onchange of
3.
REPORT ABC.
DATA : BEGIN OF ITAB OCCURS 0,
bukrs like t001-bukrs,
f1(10) type c,
end of itab.
itab-bukrs = '1000'.
itab-f1 = '1111111'.
append itab.
itab-bukrs = '1100'.
itab-f1 = '3333333'.
append itab.
itab-bukrs = '1200'.
itab-f1 = '555555'.
append itab.
*----
AT NEW
loop at itab.
at new bukrs.
write 😕 itab-bukrs , itab-f1.
endat.
endloop.
*----
AT ONCHANGE
loop at itab.
ON CHANGE OF ITAB-BUKRS.
write 😕 itab-bukrs , itab-f1.
ENDON.
endloop.
regards,
amit m.
02-26-2007 1:15 PM
Hi Ramana,
do like this:
loop at itab.
at new field1.
<b>read table itab index sy-tabix.</b>
endat.
endloop.
Reward if helpful.
Regards,
Ravi
02-26-2007 1:17 PM
Hi,
Loop at itan
at new of matnr
move 'Y; to flg,
endat.
if flg eq 'Y'
do your coding here<<----
endif.
endloop.
Thanks
aRs
02-26-2007 1:23 PM
02-26-2007 1:34 PM
report zex36.
data: begin of it occurs 4,
f1,
f2,
end of it.
it = '1A'. append it. "Fill it with data
it = '3A'. append it.
it = '1B'. append it.
it = '2B'. append it.
sort it by f1.
loop at it.
at new f1.
write: / 'start of:', it-f1.
endat.
write: /4 it-f1.
at end of f1.
write: / 'end of:', it-f1.
endat.
endloop.
free it.
O/p
start of: 1
1
1
end of: 1
start of: 2
2
end of: 2
start of: 3
3
end of: 3
02-26-2007 1:30 PM
Hi ch,
1. this will solve the difference.
2. we can use onchange of
3.
REPORT ABC.
DATA : BEGIN OF ITAB OCCURS 0,
bukrs like t001-bukrs,
f1(10) type c,
end of itab.
itab-bukrs = '1000'.
itab-f1 = '1111111'.
append itab.
itab-bukrs = '1100'.
itab-f1 = '3333333'.
append itab.
itab-bukrs = '1200'.
itab-f1 = '555555'.
append itab.
*----
AT NEW
loop at itab.
at new bukrs.
write 😕 itab-bukrs , itab-f1.
endat.
endloop.
*----
AT ONCHANGE
loop at itab.
ON CHANGE OF ITAB-BUKRS.
write 😕 itab-bukrs , itab-f1.
ENDON.
endloop.
regards,
amit m.
02-26-2007 1:32 PM
02-26-2007 1:32 PM
hi,
u can avoid * for non numerice fields and zeros for numeric fields by reading the internal table.
after the control break statement with the loop and end loop try to read the internal table.
Regards,
Sruthi
02-26-2007 1:34 PM
hi,
data: v_index like sy-tabix.
v_index = sy-tabix.
sort itab.
loop at itab.
write:/ itab-kunnr.
at new kunnr.
read table itab index v_index.
write:/ itab-name1,itab-land1.
endat.
endloop.
do reward if it helps,
priya.