Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

my new-page triggers even though my fields are the same...

Hello experts,

I am currently experiencing this weird problem with a report that I made. On the code below, it_finaltab-funcloc is the left most column in my itab and the logic is whenever a new value appears on it_finaltab-funcloc it would create a new page. Now the weird thing is the values in my it_finaltab-funcloc are all the same but when the reportdisplay appears, it creates a new page!

Again, thank you guys for your help and have a nice day!

LOOP AT it_finaltab.

AT END OF asset_dum.

lv_subtot = 1.

ENDAT.

AT END OF funcloc.

lv_total = 1.

ENDAT.

v_new = it_finaltab-funcloc.

IF v_new <> v_old AND NOT v_old IS INITIAL.

lv_flag = 1.

NEW-PAGE.

ENDIF.

v_old = v_new.

IF lv_color = 1.

lv_color = 2.

ELSE.

lv_color = 1.

ENDIF.

FORMAT INTENSIFIED OFF COLOR = lv_color.

WRITE: / sy-vline,

(12) it_finaltab-asset CENTERED,

(12) it_finaltab-parent CENTERED,

(40) it_finaltab-description CENTERED,

(40) it_finaltab-location CENTERED,

(20) it_finaltab-asset_book_val CENTERED,

sy-vline.

ADD: it_finaltab-asset_book_val TO subtot,

it_finaltab-asset_book_val TO total.

IF lv_subtot = 1.

CLEAR lv_subtot.

FORMAT COLOR COL_TOTAL.

WRITE: / sy-vline,

at 100 'Sub-total:', AT 111(20) subtot CENTERED,

sy-vline.

CLEAR subtot.

FORMAT COLOR OFF.

ENDIF.

IF lv_total = 1.

CLEAR lv_total.

FORMAT COLOR COL_TOTAL INTENSIFIED ON.

WRITE: / sy-uline(sy-linsz),

sy-vline,

'Total Assets:', it_finaltab-funcloc,

AT 111(20) total CENTERED,

sy-vline,

sy-uline(sy-linsz).

CLEAR total.

FORMAT COLOR OFF.

ENDIF.

FORMAT COLOR OFF.

ENDLOOP.

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question