Total Page in ABAP List
Hi Experts,
I have a requirement to print: "Page XX of XX" in my ABAP List report (this report is meant to be printed).
For Current Page, I know that the system field is SY-PAGNO. But I can't find the field for Total Page. Is there anyway to print this (Total Page) since it means that we have to predict how long the report will be before we WRITE anything?
Thanks a lot,
Sam
In the first statement of ur report u'll have to reserve some lines for footer as follows:
REPORT <prg name> LINE-COUNT 25(2).
here ur list will display 23 lines of data and then 2 lines are reserved for footer.
This means that in each page u can display 23 lines of text. Now depending on number of entries in your internal table which contains data to be displayed, we can calculate the number of pages required to print the total output.
E.g: I have 62 records in my internal table, so to get the total number of pages use the following logic:
(U can find out the number of recs in internal table dynamically using DESCRIBE stmt)
62/23 = 2.69
Round the result to the next integer using CEIL , so the next interger is 3.
So ur total number of pages is 3. And u now the current page number by sy-pagno.
Hope this solves ur problem.
Similar Messages
-
Dear Expert,
Please help me, how to count total page in ABAP list ?
Any suggestion or idea to solve this question ?
Thank you.
Really appreciate your respond and solution.In the first statement of ur report u'll have to reserve some lines for footer as follows:
REPORT <prg name> LINE-COUNT 25(2).
here ur list will display 23 lines of data and then 2 lines are reserved for footer.
This means that in each page u can display 23 lines of text. Now depending on number of entries in your internal table which contains data to be displayed, we can calculate the number of pages required to print the total output.
E.g: I have 62 records in my internal table, so to get the total number of pages use the following logic:
(U can find out the number of recs in internal table dynamically using DESCRIBE stmt)
62/23 = 2.69
Round the result to the next integer using CEIL , so the next interger is 3.
So ur total number of pages is 3. And u now the current page number by sy-pagno.
Hope this solves ur problem. -
How to corretly show the total pages when a list of data
Hi,
I notice the report result only show 1 of 2? when I click on the View Report in the first place. Indeed, the returned result are spreaded to 4 pages... The user needs to click >| button in order to go to the last page and click |< back to the 1st page
so he can realised the result does have 4 pages and it is very misleading.....
Any way to fix this ...?! Thanks in advance ...Hi kkcci88888,
According to your description, you want to know total page number when previewing the report.
In Reporting Services 2008 or later, on-demand processing has been changed. Reports are now processed and rendered page by page as a report user interactively reads through a report. When we view the report for the first time, it will display an estimated
number of pages until all pages in the report have been rendered. In your scenario, we can add the TotalPages built-in field in the page header or page footer then hide the textbox. So the total pages can be calculated when processing the report then it can
display in the navigation bar.
Reference:
SQL Server Reporting Services Tips and Tricks to Improve the End User Experience
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support -
Hi,
I want to display on TOP of PAGE : X page / Total page with ALV LIST.
here is my code :
FORM eventtab_build USING lt_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = lt_events.
READ TABLE lt_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE gc_formname_top_of_page TO ls_event-form.
APPEND ls_event TO lt_events.
ENDIF.
READ TABLE lt_events WITH KEY name = slis_ev_end_of_list
INTO ls_event.
IF sy-subrc = 0.
MOVE 'END-OF-LIST' TO ls_event-form.
APPEND ls_event TO lt_events.
ENDIF.
ENDFORM. "eventtab_build
FORM top_of_page.
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader.
DATA : lv_desc(15) TYPE c,
lv_month(2) TYPE c,
lv_year(4) TYPE c.
DATA : pageno(2) TYPE c.
lv_month = sd_augdt-high+4(2).
lv_year = sd_augdt-high(4).
SELECT SINGLE ltx FROM t247 INTO lv_desc WHERE mnr = lv_month
AND spras = sy-langu.
WRITE : /1 sd_bukrs-low.
SKIP 1.
WRITE : 50 'RELEVE DES ACHATS LIVRAISONS FACONS'.
WRITE : /52 '& TRAVAUX EFFECTUES AU MAROC'.
WRITE : /54 'OUVRANT DROIT AU DEDUCTION'.
SKIP 1.
WRITE : /1 'IDENTIFIANT FISCAL :', '1234',135 'REGIME : ENCAISSEMENT'.
SKIP 1.
IF NOT dtab-mwskz IS INITIAL.
WRITE : /54 'Code TVA: ',dtab-mwskz.
ENDIF.
WRITE : 135 'Page No :', sy-pagno RIGHT-JUSTIFIED.
WRITE : /2 'MOIS :',lv_desc,20 lv_year.
SKIP 1.
pageno = sy-pagno.
wa_header-typ = 'H'.
CONCATENATE 'PAGE NO : ' pageno ' of ' '****' INTO
wa_header-info SEPARATED BY space.
APPEND wa_header TO t_header.
CLEAR wa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_list_top_of_page.
it_list_commentary = t_header.
ENDFORM. "top_of_page
please, give me a guidance.
Best regards.Hi Please refer this program. You have not written exact problems here. Anyways refer below code:-
REPORT ZRIL_ALVEVENTS .
TYPE-POOLS : SLIS.
DEFINITION OF DATA INTERNAL TABLE
DATA : IT_SFLIGHT TYPE STANDARD TABLE OF SFLIGHT.
DEFINITION OF FIELDCATALOG INTERNAL TABLE
DATA : WA_FCAT TYPE SLIS_FIELDCAT_ALV, "WORK AREA FOR FIELD CATALOG
IT_FCAT TYPE SLIS_T_FIELDCAT_ALV.
DEFINITION FOR EVENT TABLE
DATA : IT_EVENTS TYPE SLIS_T_EVENT,
WA_EVENTS TYPE SLIS_ALV_EVENT. "WORK AREA FOR EVENT"
DEFINE THE NAME LIST HEADER
DATA : FORMNAME TYPE SLIS_FORMNAME VALUE 'TOP_OF_LIST'.
DEFINE THE TABLE FOR LIST OF ACTION ON EVENT SPECIFIED IN LIST HEADER
DATA : IT_ACTION TYPE SLIS_T_LISTHEADER,
WA_ACTION TYPE SLIS_LISTHEADER. " WORK AREA FOR LIST OF "
*POPULATE DATA FROM SFLIGHT TABLE
SELECT * FROM SFLIGHT INTO TABLE IT_SFLIGHT.
MAKE THE FIELDCATALOG TABLE FOR SFLIGHT
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME =
I_STRUCTURE_NAME = 'SFLIGHT'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
GET THE LIST OF EVENTS IN EVENT INTERNAL TABLE
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IT_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
GET THE NAME OF EVENT (TOP-OF-LIST) FROM LIST OF EVENTS IN EVENT TABLE
READ TABLE IT_EVENTS
WITH KEY NAME = SLIS_EV_TOP_OF_LIST
INTO WA_EVENTS.
IF READ OPERATION SUCCESSFUL
MOVE NAME OF LIST HEADER INTO WORK AREA OF EVENTS
AND APPEND THAT WORK AREA TO EVENTS TABLE THAT CONTAINS LIST OF
EVENTS
IF SY-SUBRC = 0.
MOVE FORMNAME TO WA_EVENTS-FORM.
APPEND WA_EVENTS TO IT_EVENTS.
ENDIF.
SPECIFY ONE ACTON ON EVENT IN WORK AREA AND APPEND THAT ACTION TO
TABLE OF ACTION
WA_ACTION-TYP = 'H'.
WA_ACTION-INFO = TEXT-001.
APPEND WA_ACTION TO IT_ACTION.
CLEAR WA_ACTION.
WA_ACTION-TYP = 'S'.
WA_ACTION-KEY = TEXT-002.
WA_ACTION-INFO = TEXT-003.
APPEND WA_ACTION TO IT_ACTION.
CALL THE SUBROUTINE TO DISPLAY THE LIST
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = IT_FCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = IT_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_SFLIGHT
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
FUNCTION MODULE THAT WILL BE CALLED AUTOMATICALLY WHEN THE
TOP-OF-LIST EVENT IS TRIGGERED.
FORM TOP_OF_LIST.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_ACTION
I_LOGO =
I_END_OF_LIST_GRID =
ENDFORM.
Regards
Abhii..
Edited by: Abhii on Nov 10, 2009 1:00 PM -
Latest ep of my podcast doesn't show in iTunes store. Subscribers CAN download it. Podcast page shows 'Total: 3 items' but lists only items 2 and 3. RSS feed is validated and fine. How do I get iTunes to display it?
I've used Feedburner many times and never had such a problem. I am a bit confused, forgive me if I ask for questions already answerd. Have you tried updating the podcast in someone elses copy of iTunes? My guess is that the file is bad since it is working in other programs but not iTunes. I would try making a new .mp4 file and podcasting it and seeing if that works.
Good luck!
~Ben -
Printing A3 page format using ABAP List from SAP is a problem...
Hi Experts,
I am trying to print a standard output (ABAP List) A3 page size from SAP.
I used SWIN, SAPWIN, I9HP4 device types, but none of them worked.
I created page format type ZYEVMIYE 290MM 420MM and the page format L120, W200. In order to make it usable with page size is A3. Unfortunately this did not work either.
The behaviour of the problem is when I tried to print with the device types that mentioned above then printer indicator comes to an error. And nothing comes out from the printer.
Just to be on the safe side I made a test from windows self test, it resulted success with A3 page size format. So from this point of the view I got a thought that somehow SAP (selected device types) is not able to send correct signal to Printer for page size A3, because on the printer information screen displays load Tray2 for A4 this is showing that SAP sends Printer a signal for page format A4.
I need help on how to make SAP (selected device type) send a correct signal to Printer in order to printout A3 page size format.
Quick reply will much be appreciated.Hi,
At last i got a Solution to my Question.
The Problem is that in my SAP-Code they have been translated the PDF into 255 string.But i am retreiving using 132 string.So, i resolved in this way.
<b>For Each dr As DataRow In ds.Tables(0).Rows
Dim dataline As String = dr(0)
If dataline.Length < 255 Then
dataline = dataline.PadRight(255, " ")
End If
sb.Append(dataline)
Next.</b>
May be this Thread is useful to Others.
Regards,
Rajender. -
Print tpage number/total page number in a report with width more than 240
Dear all,
I need to display total page number as following code sample.
But I need to put it after position 240.
this program can print total page number if it is placed at postion 239 or before.
WRITE: /234(10) 'Heading', 239 SY-PAGNO,'of ', '-----'.
Whenever I put 240 or more WRITE: /234(10) 'Heading', 240 SY-PAGNO,'of ', '-----'.
Total page num could not be displayed.
Please tell me the solution.
thanks
REPORT YPAGECOUNT NO STANDARD PAGE HEADING LINE-SIZE 276 LINE-COUNT 65.
DATA L_PAGE_COUNT(5) TYPE C.
TOP-OF-PAGE.
WRITE : /234(10) 'PAGE', SY-PAGNO,'/ ','-----', ''.
WRITE: /234(10) 'Heading', 239 SY-PAGNO,'of ', '-----'.
ULINE.
START-OF-SELECTION.
Real list output takes place here
DO 1000 TIMES.
WRITE: / 'Line #', SY-LINNO.
ENDDO.
Page count will be printed on each page here
WRITE SY-PAGNO TO L_PAGE_COUNT LEFT-JUSTIFIED.
DO SY-PAGNO TIMES.
READ LINE 1 OF PAGE SY-INDEX.
REPLACE '-----' WITH L_PAGE_COUNT INTO SY-LISEL.
MODIFY CURRENT LINE.
ENDDO.Using Values Greater than 255 for the LINE-SIZE of a List
If you define a fixed column width greater than 255 using the LINE-SIZE addition in the REPORT or NEW-PAGEstatement, the following notes apply:
Type definitions: The type group SLIST defines the valid maximum value for the list width (SLIST_MAX_LINESIZE), and contains a type for list lines with maximum width (SLIST_MAX_LISTLINE).
Accessing the entire contents of a line: To read or modify the entire contents of a wide line, you can use the ... LINE VALUE addition in the READ LINE or MODIFY LINE statements. This is an alternative to using SY-LISEL that is independent of the attributes of the system field (since the length of SY-LISEL is 255 characters).
Horizontal lines: With extra-wide lists, the "ULINE." statement corresponds to "WRITE / SY-ULINE.". So, for example, "ULINE AT 5(300)." corresponds to "WRITE AT 5(300) SY-ULINE.".
Output length: You can use the length specification in WRITE (or ULINE) to extend the output length of an extra-wide list up to the value of LINE-SIZE. If you want to output a whole field that is longer than 255 characters, you must use this, even if the field itself is defined as longer than 255 characters.
Example
NEW-PAGE LINE-SIZE 1000.
DATA: F1(500) VALUE 'F1'.
WRITE: / F1 COLOR COL_NORMAL. " Output with length 255
WRITE: /(500) F1 COLOR COL_NORMAL. " Output with length 500
Awrd Points if useful
Bhupal -
ABAP list report wont print on Z device type with Z format
Our developer have created a report which outputs data in ABAP list format and the standard format would not fit. We have since created a custom format and copied a device type in to custom device type. So we now have a custom format and custom device type. However when we print, it spools correctly and shows as green but the report wont print. The only thing that gets printed is
"Sort criteria AscdgDescndSubtotalGRAND TOTAL : X X PROJ" "
The abap list format is Z_100_500. Basically the report has 450 columns and hence we created this format.
I am not sure what this means. I have been advised by SAP to follow instruction on note 17895 - Adapting print list formats for customers however i cant fully comprehend point 5 of the note and I believe this is why it wont print. Has anyone adapted ABAP list using this note. Can you please let me know how i should go about printer initialisation mentioned in the noted.
We have checked everything however dont seem to get around the issue. Any ideas will be appreciatedNo comments
-
End of page in alv list output.
Hi All,
Can any body help me out for how to show end of page in alv list output.
Thanks,
Rakesh SinghRefer this link:
http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
Regards,
Ravi -
Printing a simple abap-list in panel-format (DIN A4)
Hallo Ladies and Gentlemen,
i have a simple abap-list. when i print it, the list will be printed in landscape-format. how can i change it? i have to print it in panel-format.
Thanks a lot,
MarcelHi Marcel,
I think you have to click on the "Full Administration" button t see the option for "Page Formats"...
Also go to transaction SPAD,
in Devices / Servers tab press Output devices button
Double click on the device type of your printer
Press button Formats
and here you get a list of all formats for your printer
Regards,
Abhy -
Hi ,
I want to know how to change font size in ABAP list report.
I want to enlarge the font size.
I have tried print control but it doesn't work.
I have also tried line size and line count
but it can only reduce the font size .
Thanks.
JohnHi Kong,
Try with following example:
REPORT ZFONT NO STANDARD PAGE HEADING LINE-SIZE 80 LINE-COUNT 65.
NEW-PAGE PRINT ON.
PRINT-CONTROL FUNCTION 'SF000'.
WRITE: / 'This is CPI 20'.
PRINT-CONTROL FUNCTION 'SF020'.
WRITE: / 'This is CPI 6'.
PRINT-CONTROL FUNCTION 'SF008'.
WRITE: / 'This is CPI 12'.
PRINT-CONTROL FONT 1 LPI 6.
WRITE: / 'font 1 lpi 6'.
PRINT-CONTROL FONT 2 LPI 6.
WRITE: / 'font 2 lpi 6'.
PRINT-CONTROL FONT 3 LPI 6.
WRITE: / 'font 3 lpi 6'.
End of print-control
NEW-PAGE PRINT OFF.
End of Program
thnks
Anurodh -
Hi expert ,
How to edit font and size in ABAP list ?
Currently, I'm writing code as below but not effect in my ABAP list.
PRINT-CONTROL SIZE 50 COLOR BLUE FONT 20 LPI 10.
WRITE: / ' test font and size'.
pls help me . Thank you so much all.
Edited by: kishan P on Oct 12, 2010 3:32 PMTry with this copied from SAP IMG website
REPORT ZFONT NO STANDARD PAGE HEADING LINE-SIZE 80 LINE-COUNT 65.
Start of print-control
NEW-PAGE PRINT ON.
PRINT-CONTROL FUNCTION 'SF000'.
WRITE: / 'This is CPI 20'.
SKIP.
PRINT-CONTROL FUNCTION 'SF020'.
WRITE: / 'This is CPI 6'.
SKIP.
PRINT-CONTROL FUNCTION 'SF008'.
WRITE: / 'This is CPI 12'.
Depending on your SAP printer device, this may also work
PRINT-CONTROL FONT 1 LPI 6.
you can try to change font and LPI numbers
WRITE: / 'font 1 lpi 6'.
PRINT-CONTROL FONT 2 LPI 6.
WRITE: / 'font 2 lpi 6'.
PRINT-CONTROL FONT 3 LPI 6.
WRITE: / 'font 3 lpi 6'.
End of print-control
NEW-PAGE PRINT OFF.
*--- End of Program -
Printing ABAP list in fontsize
Hi,
Could we set perticular font-size for printing ABAP list ?
Regards,
Amit RHi Amit
Check the link below , it will be useful to u.
http://help.sap.com/saphelp_nw04/helpdata/en/d9/4a95e351ea11d189570000e829fbbd/content.htm
http://www.oce.com/NR/rdonlyres/eihvvkydvfbuf4txsdbwcufqggviov54zgwkxx4yaxlozj5ajs4bcijjakhg3x573vznycykih2bop3yxtklzumddue/SAPimplementation.pdf
The FORMAT statement and associated COL<xx> print controls supersede color setting with PRINT-CONTROL and CO00<n>.
The R/3 standard includes these COL<xx> print controls:
COL0H: Color off, font intensified
COL0N: Color off, normal font
COL0V: Color off, inverse font
COL1H: Title color, font intensified
COL1N: Title color, normal font
COL1V: Title color, inverse font
COL2H: Standard color, font intensified
COL2N: Standard color, normal font
COL2V: Standard color, inverse font
COL3H: Total color, font intensified
COL3N: Total color, normal font
COL3V: Total color, inverse font
COL4H: Key color, font intensified
COL4N: Key color, normal font
COL4V: Key color, inverse font
COL5H: Positive color, intensified font
COL5N: Positive color, normal font
COL5V: Positive color, inverse font
COL6H: Negative color, font intensified
COL6N: Negative color, normal font
COL6V: Negative color, inverse font
COL7H: Group color, font intensified
COL7N: Group color, normal font
COL7V: Group color, inverse font
Message was edited by: sreekanth reddy -
Printing ABAP list in portrate format
Hi,
In one of requirement I wanted to print a report
in portate format on A4 size paper. Report has been created with use of write statement only.
When I checked print properties it shows only standard some page format(all are landscape).I even tried by creating custom portate format for ABAP list.
Please anybody suggest the way to take printout of ABAP list in portrate format.
Thanks in advance,
Amit RHi Amit,
check the line count and line size of your repor. And try with the line size = 80 and line count = 0. Then while printing the page format will be determined based on these variable to print the report.
If the report length is lange then you cannot print in the portate format.
Hope this will help you.
Regards
Satya. -
ABAP list printing on device I2SWIN
Hello,
we have defined output device (printer) with device type I2SWIN for printing on users frontend computers via SAPlpd. Settings of I2SWIN device type is default:
SAPlpd/SAPWIN driver 3.0
Do not use printer driver for ABAP list print
Character set 1406 Printer I2SWIN ISO 8859-2 (MS Windows Latin-2)
We can print ABAP lists on this device. We define formats and set margins and orientation in this formats. But these settings are ignored during printing. If we change in I2SWIN setting Printer driver to "Printer driver for SWIN printing using SAPLP/Windows", then margins are accepted and printed, but there are wrong characters in print output (not in requested code page).
Could anybody help us how to set print to accept margins in ABAP lists and also have print output with good code page.
Thank you
Vaclav Jonas
Edited by: Vaclav Jonas on Apr 24, 2008 3:02 PMO.K., we use margin settings according SAP Note 21738 and all works fine.
Maybe you are looking for
-
Hi, According to this document: SMB2 Client Redirector Caches Explained File.exists() is not accurate on a smb2 network share. I am not able to change any register settings, so I want to deal with it. According to the document there is an API to get
-
Error Initiating travel form in transaction TRIP
Hi In transaction TRIP, after clicking change approved travel expense report, travel expense details are displayed. When I click on Results button, it is giving error message: Error while initiating travel form Message no. 56568. Can someone kindly h
-
I have one managed bean A which has as it's member variables ArrayList B, ArrayList C, and ArrayList D. I have methods within the managed bean A that performs operations on the three separate lists. Say for instance, whenever I want to reference the
-
QTVR - How to create 3d objects in Quicktime
Hello can anybody help me to understand which is the best software to create 360 degrees object in quicktime? I already get iStill but it seems to be difficult to get a professional 3D interactive object, like this one: http://www.clxeurope.com/itali
-
Hi all, is it posible install 11g Express edition on 1CPU/1GB RAM os-linux open suse 11.2 32? I have 10g install should I need reinstall or upgrade to 11? Edited by: useruseruser on Apr 27, 2011 3:23 AM