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: 

AT_NEW use on page

Former Member
0 Kudos

In a clasic reportthe requirement is that at every AT_NEW statement ,the related matter shld be printed on new page.

for eg. if for div. from 1 to 5, for each div. the related matter shld be printed on new page. thus report consists of at least 5 pages.

Thanks & Regards,

Gowd.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

after AT-NEW statment use skip lines command . Skip maximum number of lines .

Suppose if you have defined 32 lines per page then you can use

skip 32 lines .

No need to use complex logic.

Reward points if useful

Regards,

Nageswar

7 REPLIES 7

Former Member
0 Kudos

Pls look this.

hope it will help you.

Reward if help.

All this AT NEW, AT FIRST, AT END OF and AT LAST are called control break statements of Internal tables and are used to calculate the TOTALS based on sertain key fields in that internal table

FIrst to use these statements the ITAB has to be sorted by the key fields on whcih you need the SUM of the fields.

Some time you will get * when mopving data from this int table to other table using these commands

so you have to use

READ TABLE ITAB INDEX SY-TABIX in AT..ENDAT..if you are using other fields between them

DATA: sflight_tab TYPE SORTED TABLE OF sflight

WITH UNIQUE KEY carrid connid fldate,

sflight_wa LIKE LINE OF sflight_tab.

SELECT *

FROM sflight

INTO TABLE sflight_tab.

LOOP AT sflight_tab INTO sflight_wa.

AT NEW connid.

WRITE: / sflight_wa-carrid,

sflight_wa-connid.

ULINE.

ENDAT.

WRITE: / sflight_wa-fldate,

sflight_wa-seatsocc.

AT END OF connid.

SUM.

ULINE.

WRITE: / 'Sum',

sflight_wa-seatsocc UNDER sflight_wa-seatsocc.

SKIP.

ENDAT.

AT END OF carrid.

SUM.

ULINE.

WRITE: / 'Carrier Sum',

sflight_wa-seatsocc UNDER sflight_wa-seatsocc.

NEW-PAGE.

ENDAT.

AT LAST.

SUM.

WRITE: / 'Overall Sum',

sflight_wa-seatsocc UNDER sflight_wa-seatsocc.

ENDAT.

ENDLOOP.

Former Member
0 Kudos

Hi,

use command new-page in at new

for more info

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/new_pa01.htm

regards

Shiva

Former Member
0 Kudos

YOU SHOULD USE

AT NEW DIV.

new-page.

then whatver filds you wanna write.

endat.

but remember to take all fields that you want to print in separate variables because "at new " wont recognize them

it will recognize new variables.

reawrd if helpful

keep rockin

vivek

KalC
Active Participant
0 Kudos

Hi Muneshwar,

You can use NEW-PAGE command in your AT NEW event.which will trigger new page for every new delivery.

This might help you.

Regards,

kalyan.

Former Member
0 Kudos

Use AT NEW and then NEW_PAGE and then WRITE

Narendra

Former Member
0 Kudos

Hi,

at every AT_NEW put NEW-PAGE.

Regards.

Chaitanya.

Former Member
0 Kudos

Hi,

after AT-NEW statment use skip lines command . Skip maximum number of lines .

Suppose if you have defined 32 lines per page then you can use

skip 32 lines .

No need to use complex logic.

Reward points if useful

Regards,

Nageswar