11-26-2007 10:13 AM
Hi ,
I am using new-page command in my program. When ever Plant changes ,Records of thet plant should be printed under that Plant.
I am getting output correctly .But when I click on NEXT PAGE button on basic list.
I am getting empty page , if I press again NEXT PAGE I am getting the records of another plant correctly . The sequence of empty pages between follows.
Can any one give correct idea why an empty page is triggering every time.
Thanks,
Suresh.
11-26-2007 10:16 AM
Hi
Declare a structure like
DATA: gs_print type lvc_s_prnt.
and before calling set_table_for_first_display, write
gs_print-grpchgedit = 'X'.
Now pass this structure to the method as follows:
call method grid->set_table_for_first_display
exporting
is_print = gs_print
is_layout = gs_layout
is_variant = gs_variant
i_save = 'A'
i_default = 'X'
changing
it_fieldcatalog = gt_fieldcat[]
it_outtab = g_t_outtab[]
it_sort = gt_sort[].
Run the report. Now when you are in the print preview mode, press the sort ascending or descending button on toolbar (without selecting a column). A dialog box appears asking for sort order. Add the required field, from the available list on right hand side, on which you want a page-break. In the last column titled NG of this sort order dialog box, write * for page feed or UL for line feed. Press Copy button to see the effect.
Hope this helps.
Even you can have a look at these links...
11-26-2007 10:16 AM
Hi
Declare a structure like
DATA: gs_print type lvc_s_prnt.
and before calling set_table_for_first_display, write
gs_print-grpchgedit = 'X'.
Now pass this structure to the method as follows:
call method grid->set_table_for_first_display
exporting
is_print = gs_print
is_layout = gs_layout
is_variant = gs_variant
i_save = 'A'
i_default = 'X'
changing
it_fieldcatalog = gt_fieldcat[]
it_outtab = g_t_outtab[]
it_sort = gt_sort[].
Run the report. Now when you are in the print preview mode, press the sort ascending or descending button on toolbar (without selecting a column). A dialog box appears asking for sort order. Add the required field, from the available list on right hand side, on which you want a page-break. In the last column titled NG of this sort order dialog box, write * for page feed or UL for line feed. Press Copy button to see the effect.
Hope this helps.
Even you can have a look at these links...
11-26-2007 10:18 AM
MR.SURESH BE CLEAR U R QUESTION..? WHAT U R CLIKING ..? WHAT U R GETTING? how u r clicking next page ? where u r clicking..? copy u r program code then might help ok..r u mean to say that ur cliking on application tool bar..?
11-26-2007 11:11 AM
Yes , you are corrrect .
I am not using ALV here, It's a simple report.
I am clicking on "NEXT PAGE" button on application tool bar .
I am sending my code here :
REPORT zvsd0206
MESSAGE-ID zvso
NO STANDARD PAGE HEADING
LINE-SIZE 143
line-count 56.
LOOP AT p_it_final INTO wa_final.
AT NEW werks.
new-page.
SKIP 1.
WRITE : sy-uline.
WRITE : sy-vline.
WRITE: 143 sy-vline NO-GAP .
WRITE : 4'MATERIAL :',14 wa_final-matnr,45 'PLANT :',wa_final-werks.
WRITE: / sy-vline NO-GAP .
WRITE: 143 sy-vline NO-GAP .
ULINE : 2(141).
WRITE : sy-vline.
WRITE: 143 sy-vline NO-GAP .
WRITE : 2'SALE_ORDER_N0',
15 sy-vline,
16 'ITEM_NO',
24 sy-vline,
25 'CRT_DATE',
36 sy-vline,
37 'QUANTITY',
53 sy-vline,
54 'UOM',
58 sy-vline,
59 'CUSTOMER NAME' NO-GAP CENTERED,
95 sy-vline,
96 'CUSTOMER_NO',
108 sy-vline,
109 'GROUP',
115 sy-vline,
116 'REQ_DLVRY_DATE',
130 sy-vline,
131 'RE-DATED',
139 sy-vline,
140 'CSR',
143 sy-vline.
WRITE: / sy-vline NO-GAP .
WRITE: 143 sy-vline NO-GAP .
ULINE : 2(141).
ENDAT.
sub_count = sub_count + 1.
tot_count = tot_count + 1.
WRITE: sy-vline NO-GAP .
WRITE: 143 sy-vline NO-GAP .
WRITE : 2 wa_final-vbeln,
15 sy-vline,
16 wa_final-posnr,
24 sy-vline,
25 wa_final-erdat,
36 sy-vline,
37 wa_final-kbmeng NO-GAP UNIT wa_final-vrkme,
53 sy-vline,
54 wa_final-vrkme,
58 sy-vline,
59 wa_final-name1,
95 sy-vline,
96 wa_final-kunnr,
108 sy-vline,
109 wa_final-kdgrp,
115 sy-vline,
116 wa_final-vdatu,
130 sy-vline,
131 wa_final-redate,
139 sy-vline,
140 wa_final-kvgr2,
143 sy-vline.
WRITE : sy-uline .
AT END OF werks.
SKIP 2.
WRITE : / text-001, 18 sub_count.
CLEAR : sub_count.
ENDAT.
AT LAST .
SKIP 2.
WRITE:/ text-002,18 tot_count.
ENDAT.
ENDLOOP.
I hope now you can give some idea.
Thanks,
Suresh.