Application Development 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: 

logic with at new?

Former Member
0 Kudos
149

Thanks to everyone.

I wanna get this result:

Material#1 PO1

PO2

PO3

Material#2 PO4

PO5

PO6

PO7

Any ideas?

Message was edited by: Ol Pom

Message was edited by: Ol Pom

5 REPLIES 5

Former Member
0 Kudos
43

Sort the <Int.table>

Loop at itab.

at new itab-matnr.

write:/ XX.

endat.

endloop.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
43

Something like this?



report zrich_0003 .


data: begin of itab occurs 0,
      matnr type ekpo-matnr,
      ebeln type ekpo-ebeln,
      ebelp type ekpo-ebelp,
      end of itab.

data: wa like line of itab.

select * into corresponding fields of table itab
           from ekpo
                   up to 100 rows.

sort itab ascending by matnr ebeln ebelp.

loop at itab.

 wa = itab.

  at new matnr.
   skip 1.
    write:/ wa-matnr, at 20 wa-ebeln, wa-ebelp.
    continue.
  endat.

  write:/20 wa-ebeln, wa-ebelp.


endloop.

Regards,

Rich Heilman

Former Member
0 Kudos
43

Hi OI

In order to use the sentence AT NEW in a LOOP you need to order your itab.

Regards,

David

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
43

Please make sure to award points for helpful answers and mark as solved when solved completly. Thanks.

Regards,

Rich Heilman

anversha_s
Active Contributor
0 Kudos
43

hi,

do this.

sort itab by matnr.

loop at itab.

at new matnr.

write : matnr.

endat.

write PO1.

endloop.

rgds

anver