Page Numbers - ABAP

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
Ong

Page Numbers - ABAP

Post by Ong » Mon May 19, 2003 10:24 am

Hey All,

I wanna output the page numbers on my plain report like 1/8, 2/8, 3/8, 4/8, 5/8...8/8.
I looked around but I am kinda lost in here so any help ?

Thanks.

Fw-190
Posts: 183
Joined: Thu Feb 13, 2003 5:12 am
Location: Back in the land of decent (warm) beer

Post by Fw-190 » Mon May 19, 2003 10:40 am

USE THE SEARCH !!!!!!! :evil:
USE THE SEARCH !!!!!!! :evil:
USE THE SEARCH !!!!!!! :evil:
USE THE SEARCH !!!!!!! :evil:

I have personaly answered this a few times !!!!!!!!!

Here's the last time I answered it ONLY 12 DAYS AGO;
viewtopic.php?p=113308&highlight=#113308


Rant over :) Return to being chilled out cool dude. 8)
"You start coding. I'll go find out what they want"

Ong

Post by Ong » Mon May 19, 2003 11:02 am

Hi FW-190,

Thanks a lot for your help.
I tried it but it doesn't work for me. All I see is the ----------- in the heading. Do we need to 'set' sy-lisel somewhow ? I never used it before.

Thanks.

Ong1

Post by Ong1 » Mon May 19, 2003 11:02 am

Hi FW-190,

Thanks a lot for your help.
I tried it but it doesn't work for me. All I see is the ----------- in the heading. Do we need to 'set' sy-lisel somewhow ? I never used it before.

Thanks.

kumar
Posts: 2012
Joined: Tue Oct 22, 2002 12:51 pm
Location: Basel, Switzerland
Contact:

Post by kumar » Mon May 19, 2003 11:30 am


Ong

Post by Ong » Mon May 19, 2003 11:44 am

thanks KRK.

But. it still doesn't work. The output is on every page..
1 of -----
1 of -----
1 of -----
etc..

I tried to putting the TOp-Of-Page code part in different places ( before end-of-selection and after end-of-selection, in Title heading) but still the result is the same. Where am I lost ?

Wolfgang G Propfe
Posts: 469
Joined: Sun Oct 20, 2002 5:57 pm
Location: Houston, TX, USA
Contact:

Post by Wolfgang G Propfe » Mon May 19, 2003 12:50 pm

Dear Ong:
Is every page number 1? Odd. Also, do you run this program in batch? This only works, if you generate a list that you can modify (F1 on READ and MODIFY line).

Regards,
Wolfgang

Ong

Post by Ong » Mon May 19, 2003 1:09 pm

dear wolfgang,

thanks for your help.

I am not generating a list. Thanks for pointing it out. I guess I will contend with printing page numbers instead of ( 1/X , 2/X etc..) for now.

Thanks again.

ZABAP
Posts: 309
Joined: Tue Mar 18, 2003 8:03 am
Location: MS, USA

Page Numbers - ABAP

Post by ZABAP » Mon May 19, 2003 2:22 pm

Why not use the calculation in the following code:

Code: Select all

REPORT Y_PAGE_NUMBER_EXERCISE NO STANDARD PAGE HEADING LINE-SIZE 80
LINE-COUNT 55.

TABLES: VBAP.

SELECT-OPTIONS: ORDER FOR VBAP-VBELN.

DATA: IVBAP TYPE STANDARD TABLE OF VBAP WITH HEADER LINE,
      TAB_ENTRIES TYPE I,
      TOTAL_PAGES TYPE P DECIMALS 3,
      TOTAL_NUMBER_OF_PAGES TYPE P DECIMALS 0,
      HEADER_LINE_COUNT TYPE I VALUE 3.

SELECT * FROM VBAP INTO TABLE IVBAP WHERE VBELN IN ORDER.

DESCRIBE TABLE IVBAP LINES TAB_ENTRIES.

TOTAL_PAGES = ( TAB_ENTRIES  / SY-LINCT ).
TOTAL_PAGES = ( ( ( TOTAL_PAGES *  HEADER_LINE_COUNT ) 
                          + TAB_ENTRIES ) / SY-LINCT ).
TOTAL_NUMBER_OF_PAGES = CEIL( TOTAL_PAGES ).

LOOP AT IVBAP.

  WRITE:/ IVBAP-VBELN,
          IVBAP-POSNR.

ENDLOOP.

TOP-OF-PAGE.

WRITE:/  'LIST OF SALES ORDERS',
      45 'Page',
         SY-PAGNO,
         'of' NO-GAP,
         TOTAL_NUMBER_OF_PAGES.
ULINE.
SKIP.
I know its not the cleanest, but it gets the job done.

Hope this helps! :D

Ong

Post by Ong » Mon May 19, 2003 4:34 pm

Got the idea. Thanks a ton ZABAP.

Post Reply