Line-count/page number in alv
My report is a z copy of FBL5N .In that i wud have included the page no as a part of the heading , my issue is, since it is display some other information like customerr number company code name etc., my page no will also display only if the top_of_page event is called , but this will be called only if the info related to the first customer is printed it will call the event again say for example like my inpur is for customer a customer b company code a company code b if the records for customer a and company code a combination is over it will call the top-of-page event again so it doesnt matter for any number of number say like it can even have 100's of records in the display for this entire 100 records my page number will be displayed as 1 for the next combination it will be displayed as 2 but when i try to take the printed copy 100 number of records cannot be displayed in a single sheet in that case my page number shud vary but since the top-of-page event is called only once for the entire 100 records it is displaying repeatedly as 1 only how can i sove it
Hi,
check the following link:
http://www.sapbrain.com
regards,
bhaskar
Similar Messages
-
Hi all,
I use top of page to print page number for ALV report. When i run my report in backgrond and see the spool, the page is always started from page 2.
These does not happen when I use non-ALV report, report prints the header starting from page 1 normally. It is weird.
does anyone of you ever face such of that problem ?
thanks alots
AliaHi Alia,
Page number is usually not set in an ALV display, as compared to List processing.
r u sure this is a requirement?
chk this:
ALV Print page numbers
Regards,
Anjali -
Displaying page number in ALV grid display
Hi,
Is it possible to display page number in an ALV grid display?
If yes, how?
I tried it in top of page event, but it didnt work.
Harmeet.hi,
check out the sample code....
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'F00007_USER_COMMAND'
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
it_fieldcat = g_t_fieldcat[]
it_events = gt_events[]
i_save = 'A'
TABLES
t_outtab = g_t_final_report[]
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.
FORM TOP_OF_PAGE *
FORM top_of_page.
write : sy-pagno.
ENDFORM. "top_of_page
Reward Appropriate points.
Regards,
Mansi. -
Display Page number in ALV List.
Dear Friends,
I want to display page numbers in ALV list print output. But I dont know how to do that without using objects.
Please suggest.
Regards,
Madan.TRY LIKE THIS
data : ifieldcat type slis_t_fieldcat_alv,
wfieldcat type slis_fieldcat_alv,
IEVENT TYPE SLIS_T_EVENT,
WEVENT TYPE SLIS_ALV_EVENT..
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IEVENT
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.
READ TABLE IEVENT INTO WEVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WEVENT-FORM = 'TOP_OF_PAGE'.
MODIFY IEVENT FROM WEVENT INDEX SY-TABIX.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOPOFPAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = IFIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = IEVENT
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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB
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.
FORM TOP_OF_PAGE.
WRITE : /10 'HeadinG OF ALV'.
WRITE : 100 SY-PAGNO.
ENDFORM.
ONE THING IS THERE YOU CAN USE WRITE FOR ONLY LIST DISPLAY NOT FOR GRID DISPALY.
REGARDS
SHIBA DUTTA -
Page Number in ALV Output (print out)
Hi,
I would like to print the Page numbers in the Printout of ALV Display.
How can solve this ?
Regards,
Ram.Hi ,
If you are ALV grid or List then
In the eevnt TOP of page check sy-ucomm for print and then increment the pages by using sy-pagno and fill listheader table and reuse_commentary_write
check the code below .
IF sy-ucomm = 'PRIN'.
t_listheader1[] = t_listheader[].
DELETE t_listheader1 WHERE key = c_page.
CLEAR v_htext.
IF v_pagno4 = sy-pagno.
Write top of page
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_listheader.
Please reward if useful. -
How do I change the placement of the page number in the footer?
Hi,
I am using Framemaker 8. I am making some adjustments to the master pages. For example, I've made the margins more narrow. I have a footer that has a line above it. The page number in the footer should be in line with the end of this line (the page number should be just below the end of the line above it), but now it is not. How can I move the page number over so that it is lined up with the line above it?
Thank you for your help!
ErinErin,
The surefire technique that I use is to open the master page and select the text box you want to adjust by using Ctrl+left mouse click.
Then right click and select Object Properties to open the Custom Text Frame box. Adjust the width, height, top, and bottom values to set the size and position of the box precisely and then click Set. If you have several master pages for different purposes, this technique ensures that all similar text boxes are positioned accurately.
For the text box containing your footer, click on the text inside the text frame and right align it by selecting the Text Alignment button in the toolbar and selecting Right for right-justified.
If it doesn't line up with the end of your bottom rule, open the Custom Text Frame box and adjust the left and top settings.
Yours,
Michael F
======= -
Displaying Page No in ALV Grid top of page
Dear All,
I have tio display the page number in ALV grid top of page .
That is 001 of 100
next page 002 of 100
this page number should increase / decrease depending upon page up and page down also on scrolling the ALV bar .
How to achieve this?
RegardsHi Rajendra,
I guess you need to write your logic to get the page numbers. Check the below link.
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
Thanks
Satya
Edited by: Rob Burbank on Aug 24, 2010 5:57 PM -
How to give a page break in alv grid display after 65 lines are displayed?
hi all,
I need to give a page break in alv grid display after 65 lines are displayed on each page...Please help me with this...hai
give this command beging of the report name... u have to diclar the beging of the report ......
<b>report</b> ( name of the report) <b>standard page heading line-size 200 line-count 65.</b>
ex1.:- report name is rtpm_trl_show_flows
report <b>rtpm_trl_show_flows </b> no standard page heading line-size 200
line-count 65.
ex:2
report <b>zlpur01</b> no standard page heading line-size 200
line-count 65.
type-pools: slis.
tables: bkpf.
selection-screen begin of block sel with frame title text-001.
select-options: s_comp for bkpf-bukrs, " Company
s_valut for bkpf-budat. " Invoice Date
S_MTART FOR MARA-MTART. " Material Type
selection-screen end of block sel.
parameters: p_vari like disvariant-variant. " ALV Variant
constants: formname_top_of_page type slis_formname value 'TOP_OF_PAGE'.
data: i_bseg type bseg occurs 0 with header line.
data: vatval type p decimals 2 value '0.15'.
data: xhkont type string value '154000'.
data COM type c.
data: begin of invt occurs 100,
budat like bkpf-budat, " Inv Dat
bukrs like bkpf-bukrs, " Material
STCEG like bsak-STCEG, "name of the companycode
belnr like bkpf-belnr,
xblnr like bkpf-xblnr, " Inv Reference
ebeln like rseg-ebeln, " PO number
lifnr like bseg-lifnr, " Vendor No
name1 like lfa1-name1, " Supplier Name
matnr like bseg-matnr,
maktx like makt-maktx,
stcd1 like lfa1-stcd1, " Supplier VAT REG NO
xamt like bseg-dmbtr, " TAX amt
yamt like bseg-wrbtr,
wrbtr like bseg-wrbtr, " Base amount
mwskz like bseg-mwskz,
dmbtr like bseg-dmbtr, " TAX amt
gjahr like bkpf-gjahr,
hkont like bseg-hkont,
zamt like bseg-dmbtr, " TAX amt
wamt like bseg-dmbtr,
shkzg like bseg-shkzg,
shkzg1 like bseg-shkzg,
end of invt.
regard
nawa -
How to give no of lines per page in alv report
hi
could anybody tell me
how to give no of lines per page in alv report
i need bottom of page too
if possible plz send the code too
it ll be very helpful to me
thanx
kals.Hi,
This is possible, using some of the events in the ALV.
You could use AFTER_LINE_OUTPUT event and call you form after say, a certain line count is reached on the list output.
MOVE 'AFTER_LINE_OUTPUT' TO gw_event-name.
MOVE 'AFTER_LINE_OUTPUT' TO gw_event-form.
APPEND gw_event TO gt_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_events = gt_events[]
and define the form for each event as follows - this would be a dynamic call by the ALV.
*& Form after_line_output
* Form for the After Line Output Event in the internal table
* --> rs_lineinfo
FORM after_line_output USING rs_lineinfo TYPE slis_lineinfo.
IF sy-linno eq v_linno. "Defaulted value for line count
perform write_footer.
NEW-PAGE.
ENDIF.
ENDFORM. " after_line_output
For lines per page:
rs_lineinfo-tabindex would give you the index of the current line in the list, which you could use to read the t_outtab table, and reduce the line count of items displayed on the earlier page.
There are a few other events too, like BEFORE_LINE_OUTPUT and END_OF_LIST which you can use as required and print the data.
Regards,
Anil. -
Page Number - Total Page number in Blocked ALV
Hi Gurus,
I need to print the page numbers like 1 of 5 in the ALV footer. Am able to print the current page number but am unable to print the total page number in the footer of the Blocked ALV. Can any one guide me how to display the total number of pages.
Points will be awarded
Thanks
RaviHi,
Please refer to the link below :
http://www.sapdev.co.uk/reporting/alv/alvgrid_events.htm
Thanks,
Sri. -
Page number problem in ALV background
Hi all,
I am displaying a report in ALV format.
In the header , i have to display the detail like current page no/ total page numbers .
I am able to achieve this , but I am facing 2 problems
1. In foreground , it is always dispayed as ONE SINGLE PAGE , there by showing 1/10 no matter how much pages are present.
2. When i schedule this program in background, it takes 1 page extra .. i.e 1/10 , 2/10 .... 11/10 .
The number of records obtained in background are proper , but probably the page lenghts are different,
Can any one please provide some inputs on the same ?
Thanks ,
Supriya Murudkar .Hi Twinkal,
Thanks for your suggestion .
Is there any solution for the same ?
The program has a normal output as well as ALV o/p.
I just compared the 2 outputs now.
Some records which are on page 1 on normal output are on page 2 of ALV output. the total number of records being the same.
Do we have any other sol for this .
Thanks ,
Supriya Murudkar -
Page number in Top of page during line selection
Hi All,
I am generating an interactive report.
I want to display the same header at each page break.
How to restrict the page size in At line-selection?
I want to display page in format Page X of Y for each page break?How to handle it?
Thanks in advance.
Regards,
SandyHi,
Try the code:
REPORT ZPAGETEST NO STANDARD PAGE HEADING LINE-SIZE 40
LINE-COUNT 20.
DATA:COUNT(6) TYPE N.
DATA: LAST_PAGE_NO LIKE SY-PAGNO.
DATA: TOTPAGE(6) TYPE C .
TOP-OF-PAGE.
WRITE:20 SY-PAGNO ,'of', '££££££'.
START-OF-SELECTION.
DO 100 TIMES.
WRITE: / COUNT.
COUNT = COUNT + 1.
ENDDO.
LAST_PAGE_NO = SY-PAGNO.
TOTPAGE = SY-PAGNO.
DO LAST_PAGE_NO TIMES.
READ LINE 1 OF PAGE SY-INDEX .
REPLACE '££££££' WITH TOTPAGE INTO SY-LISEL.
MODIFY CURRENT LINE.
ENDDO.
Regards,
Sesh -
How to Count the number of TAB chars value '0A' in a line?
I have a requirement to count the number of TABs in a text file that I am processing (they must equal 75) to ensure that all the fields have been submitted on the file I am reading?
How do I identify the TABs in a line?
I have this so far:
CONCATENATE gv_unix_file gv_lstfiles-name INTO gv_unix_file.
OPEN DATASET gv_unix_file for INPUT IN TEXT MODE ENCODING NON-UNICODE.
IF sy-subrc <> 0 .
message e000(zz) with 'Cannot access in_uk files'.
ENDIF.
CONCATENATE gv_unix_file_arc gv_lstfiles-name INTO gv_unix_file_arc.
OPEN DATASET gv_unix_file_arc FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
IF sy-subrc <> 0 .
message e000(zz) with 'Cannot access in_uk files'.
ENDIF.
DO.
READ DATASET gv_unix_file into lv_str.
IF sy-subrc <> 0.
exit. "exit do loop, file is done.
else.
TRANSFER lv_str to gv_unix_file_arc.
ENDIF.
ENDDO.Here is a sample code:
DATA: lv_string TYPE string,
lv_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
lv_i TYPE i.
DATA: result_tab TYPE match_result_tab.
DO 3 TIMES.
CONCATENATE 'A' lv_string INTO lv_string SEPARATED BY lv_tab.
ENDDO.
" this is how you need to find how many tabs are in your transfer work area...
FIND ALL OCCURRENCES OF lv_tab IN lv_string RESULTS result_tab.
DESCRIBE TABLE result_tab LINES lv_i.
WRITE:'No. of tabs found:', lv_i. -
How to count the number of lines dynamically,
In the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
after displaying one category contents am displaying a line
which also counts to a line in the internal table.
My question is how to count the number of lines(ULINE) displayed dynamically.
FORM GET_LINES .
DATA: LV_LINES TYPE I,
LV_TIMES TYPE I,
LV_TABIX TYPE SY-TABIX.
DESCRIBE TABLE IT_REC LINES LV_LINES.
DO LV_LINES TIMES.
LV_TIMES = SY-INDEX .
READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
LV_TABIX = LV_TIMES.
READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
IF SY-SUBRC EQ 0.
APPEND GWA_UPDATE TO GT_UPDATE.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. " GET_LINESIn the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
after displaying one category contents am displaying a line
which also counts to a line in the internal table.
My question is how to count the number of lines(ULINE) displayed dynamically.
FORM GET_LINES .
DATA: LV_LINES TYPE I,
LV_TIMES TYPE I,
LV_TABIX TYPE SY-TABIX.
DESCRIBE TABLE IT_REC LINES LV_LINES.
DO LV_LINES TIMES.
LV_TIMES = SY-INDEX .
READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
LV_TABIX = LV_TIMES.
READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
IF SY-SUBRC EQ 0.
APPEND GWA_UPDATE TO GT_UPDATE.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. " GET_LINES
The display function is:
FORM DISPLAY_DATA .
ULINE.
WRITE : /1 SY-VLINE, 'check',
10 SY-VLINE, 'Plant',
20 SY-VLINE, 'Material number',
50 SY-VLINE, 'Follow up material',
70 SY-VLINE, 'Safety stock',
100 SY-VLINE, 'Partc'.
ULINE.
LOOP AT IT_MARC.
MOVE: IT_MARC-WERKS TO IT_REC-WERKS,
IT_MARC-MATNR TO IT_REC-MATNR,
IT_MARC-NFMAT TO IT_REC-NFMAT,
IT_MARC-EISBE TO IT_REC-EISBE,
IT_MARC-PARTC TO IT_REC-PARTC .
APPEND IT_REC.
CLEAR IT_MARC.
ENDLOOP.
DATA: GV_TABIX TYPE SY-TABIX.
LOOP AT IT_REC.
GV_TABIX = SY-TABIX.
READ TABLE GT_TOTAL WITH KEY WERKS = IT_REC-WERKS
NFMAT = IT_REC-NFMAT.
IF SY-SUBRC EQ 0.
IT_REC-PARTC = GT_TOTAL-PARTC.
MODIFY IT_REC INDEX GV_TABIX TRANSPORTING PARTC.
ENDIF.
ENDLOOP.
LOOP AT IT_REC.
WRITE : /1 SY-VLINE, IT_REC-CHECK AS CHECKBOX,
10 SY-VLINE, IT_REC-WERKS,
20 SY-VLINE, IT_REC-MATNR,
50 SY-VLINE, IT_REC-NFMAT,
70 SY-VLINE, IT_REC-EISBE,
100 SY-VLINE, IT_REC-PARTC.
AT END OF NFMAT.
ULINE.
ENDAT.
ENDLOOP.
ULINE.
ENDFORM. " DISPLAY_DATA
Solved -
Count the number of lines in a txt file
I need to count the number of lines in a txt file, but I can't do it using readLine(). This is because the txt file is double spaced. readLine() returns null even if it is not the end of the file. thanks for the help
I need to count the number of lines in a txt file,
but I can't do it using readLine(). Then just compare each single byte or char to the newline (code 10).
This is because the txt file is double spaced. readLine() returns
null even if it is not the end of the file.Errm what? What do you mean by "double spaced"? Method readLine() should only return null if there's nothing more to read.
Maybe you are looking for
-
Is there a way to wake an ipad up by detecting motion with the front camera?
I am using the iPad for an HMI Display To control a machine and want it to be able to wake up from sleep just by detecting motion with the front camera rather than having to push any buttons on the iPad, is this even possible?
-
Condition Type Doesn't Appear in COMMPR01
Hello CRM Pricing Experts, I have created a custom pricing procedure called Z00001. This pricing procedure has a custom condition type called ZPR0. This in turn is based on a custom access type ZPR0 (Access=5, Table=SAP00080,E=checked, requirement=
-
2D Picture Control Export as JPG
Hi guys, I've created a radar plot using a 2D Picture Control. However on attempts to export this by using 'Get Image' I end up with a complete white/black (depends on background colour) square box. So in short, the radar plot created out of 2 variab
-
Hi since i delete the "Evernote" plug-in to safari i get crash everytime i do upload .. sometime Flash player in safari get crash too ... this log for last crash.. Process: Safari [639] Path: /Applications/Safari.app/Contents/MacOS/Safari Identifier:
-
Barcode Scanners A Sham?
My friend has an N93, which has a barcode scanner yes... The only bar code its ever been able to read was the sample bar code thta came with it once upon a time. Do these things actually work??? And Thats I Got To Say About That!