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

at new control break statement

Former Member
0 Likes
989

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
960

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.

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.

8 REPLIES 8
Read only

Former Member
0 Likes
960

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

Read only

former_member194669
Active Contributor
0 Likes
960

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

Read only

0 Likes
960

than q for giving reply. can u explain clearly with example

Read only

0 Likes
960

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

Read only

Former Member
0 Likes
961

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.

Read only

0 Likes
960

than q for giving reply

regards

ramana

Read only

Former Member
0 Likes
960

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

Read only

Former Member
0 Likes
960

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.