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: 

NEW-PAGE

Former Member
0 Kudos

Hi,

I want start a new page when new vendor in a list. I put this code but isn't ok i don't know why..

LOOP

IF LAST_VENDOR IS NOT INITIAL.

IF LFA1-LIFNR NE LAST_VENDOR.

LAST_VENDOR = LFA1-LIFNR .

NEW-PAGE.

ENDIF.

ELSE.

LAST_VENDOR = LFA1-LIFNR

ENDIF.

WRITE..............

ENDLOOP

Please help

9 REPLIES 9

JozsefSzikszai
Active Contributor
0 Kudos

hi,

I guess the internal table is sorted with lifnr, right? Than you could try this:

LOOP AT ...
WRITE ...
AT END OF lifnr.
NEW-PAGE.
ENDAT.
ENDLOOP.

hope this helps

ec

Former Member
0 Kudos

did you give LINE-COUNT for your report. Report needs to know how many lines are in each page.

Look at the sample code.

REPORT  ztest LINE-COUNT 65.

DATA: lt TYPE TABLE OF pa0003 WITH HEADER LINE.

SELECT * FROM pa0003 INTO TABLE lt UP TO 10 ROWS.

LOOP AT lt.
  AT NEW pernr.
    NEW-PAGE.
    WRITE:/ lt-pernr.
  ENDAT.
ENDLOOP.

Former Member
0 Kudos

If your table is sorted by lifnr and this field is the first in you internal table

LOOP at itab.
at new lifnr.
NEW-PAGE.
endat.
WRITE..............
ENDLOOP

Tell me if this work.

0 Kudos

I try all + AT END OF LIFNR

Not work...:(

0 Kudos

Send the complete code.

A

0 Kudos

should work...

as stated out already by Andrew, there are two prerequisites:

1. the internal tables has to be sorted by lifnr

2. lifnr has to be the first field of the internal table

you can copy your actual code here if still does not work

0 Kudos

I think the problem is LINE-COUNT but i put what number?

0 Kudos

>

> I think the problem is LINE-COUNT but i put what number?

LINE-COUNT should not be the problem, you can forget it!

0 Kudos

I put 'LINE-COUNT 37' it work perfectly

Thanks for all