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
925

Hi All,

When I use control break statements in the loop, I could get * in the output display for the field, which I set the AT New operation.

I sorted the internal table with the primary key, consequently with the other fields in order.

Still, I get * in the output.

Kindly, guide me in this regard. Thanks.

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
894

hi,

assaign it to a work area before control brk statemnt.

loop at itab.

wa =itab.

at new ..

write wa-...

endloop.

rgds

anver

pls mark all hlpful answers

8 REPLIES 8
Read only

Former Member
0 Likes
894

hi,

Use READ table statement after that ..

        AT NEW.
          READ TABLE it_combined INDEX v_tabix.
          WRITE : IT_COMBINED-FIELD1.
        ENDAT.

REgards,

Santosh

Message was edited by: Santosh Kumar P

Read only

Former Member
0 Likes
894

Hi Cartesian,

Whenever you use Control Breaks at a field,

all the fields after that gets *.

So before using Control Break stmt, pass the data into another work area of same type and use for printing.

Reward point if it helps.

Manish

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
894

Simply move the data to a work area and write the data that is in the workarea instead.

data: begin of itab occurs 0,
      fld1 type c,
      fld2 type c,
      fld3 type c,
      end of itab.
data: wa like line of itab.

loop at itab.

wa = itab.

at new fld1.

   write:/ wa-fld1, wa-fld2, wa_fld3.
endat.

endloop.

Regards,

RIch Heilman

Read only

Former Member
0 Likes
894

Please note that when an AT event is fired (i.e. AT NEW, AT FIRST, AT END OF ) etc..the columns to the right of the defined field are all asteriked out hence if you try and display the value of that field it would be asterik.

Example.

Itab Structure

matnr

werks

lgort

qty

loop at itab.

at new werks.

=>here the value of lgort and qty would be *

endat.

endloop.

If you want to read the value...you can do the below.

loop at itab.

fs_tab = itab.

at new werks.

=> here you can use fs_tab values

endat.

Read only

anversha_s
Active Contributor
0 Likes
895

hi,

assaign it to a work area before control brk statemnt.

loop at itab.

wa =itab.

at new ..

write wa-...

endloop.

rgds

anver

pls mark all hlpful answers

Read only

0 Likes
894

thanks for the reply. It solved my problem.

Read only

0 Likes
894

<i>hi,

assaign it to a work area before control brk statemnt.

loop at itab.

wa =itab.

at new ..

write wa-...

endloop.

rgds

anver</i>

Yep, and that is exactly what I said...

Regards,

Rich Heilman

Read only

Former Member
0 Likes
894

Hi,

after at NEW

read table itab index sy-tabix.

and then use write statements...

Regards

vijay