2009 May 03 11:28 AM
hi abapers,
iam scheduling a report in background..and spool is genarated and that spool output is sent as mail..
but in my spool there are two pages..with reapeat heading..
ex:
for page 1.
xxxxxxx comapny
123 12323 2323 23232
for page 2
xxxxxx comapny
1233 3432 35433 3435
here in page2 the heding is again apperaing
i don't to repeat the agaain for page2 also.
can any help me......
hi abapers,
iam scheduling a report in background..and spool is genarated and that spool output is sent as mail..
but in my spool there are two pages..with reapeat heading..
ex:
for page 1.
xxxxxxx comapny
123 12323 2323 23232
for page 2
xxxxxx comapny
1233 3432 35433 3435
here in page2 the heding is again apperaing
i don't to repeat the agaain for page2 also.
can any help me......
2009 May 03 6:49 PM
I guess you are using the top of page event, use the top of list event and the header will be printed only once at the top of the list.
regards,
Advait
2009 May 04 5:53 AM
Thanks for u r reply..
i tried both top-of-list and top-of-page..
but still iam unable to supress page heading for second page..
2009 May 04 8:01 AM
2009 May 04 10:13 AM
ok,
but i tried with top-of-list also bt still same problem is repeating..
2009 May 04 12:41 PM
That is strange, top of list should get triggered only once at the beginning of the list. Can you paste your code here? So we can see what is wrong with it.
regards,
Advait
2009 May 05 2:32 PM
<< Unformatable code removed >>
Please just post the relevant portion
Edited by: Rob Burbank on May 5, 2009 10:47 AM
2009 May 05 2:36 PM
FORM write_data .
PERFORM build_catlogue.
PERFORM build_layout USING fieldlayout.
PERFORM fill_eventstab TABLES eventstab.
****by sagun desai 06.06.2007 req by Sharma
ls_variant-report = sy-repid.
IF sy-uname EQ 'UPLABAP' .
PERFORM display_list.
ELSE.
PERFORM display_list1.
ENDIF.
****end by sagun
ENDFORM.
********************************
iam desigining my catalog here
*************************************
FORM build_layout USING fieldlayout TYPE slis_layout_alv.
fieldlayout-f2code = '&ETA'.
fieldlayout-zebra = 'X'.
fieldlayout-key_hotspot = 'X'.
fieldlayout-detail_popup = 'X'.
fieldlayout-cell_merge = 'X'.
ENDFORM. " build_layout
FORM fill_eventstab TABLES p_eventstab STRUCTURE eventstab.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_eventstab[]
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
READ TABLE p_eventstab WITH KEY name = slis_ev_top_of_page.
IF sy-subrc = 0 .
MOVE 'TOP_OF_LIST' TO p_eventstab-form.
APPEND p_eventstab.
ENDIF.
ENDFORM. " fill_eventstab
FORM top_of_list.
CLEAR: heading,heading[].
heading-typ = 'H'.
HEADING-INFO = 'New DPR for Formulation plants'.
heading-info = 'Advanta India Ltd'.
APPEND heading.
heading-typ = 'H'.
heading-info = 'Daily production & Despatch report of Field Crops PackedSeed'.
APPEND heading.
heading-typ = 'A'.
heading-info = 'All figures are in KG / EA '.
APPEND heading.
heading-typ = 'A'.
heading-info = 'Report for only those products,produced/planned inthis month'.
APPEND heading.
heading-info = 'All stocks are current stk'.
APPEND heading.
FORM display_list .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZPPR_ADV_DPR5'
is_layout = fieldlayout
it_fieldcat = lt_fieldcat
i_default = 'X'
i_save = 'A'
is_variant = ls_variant
it_events = eventstab[]
TABLES
t_outtab = it_final.
ENDFORM. " display_list
2009 May 05 3:37 PM
On thing I noticed in your code is that you are using incorrect event name while reading the events internal table, because of this, the subroutine top_of_list is getting called for each new page.
FORM fill_eventstab TABLES p_eventstab STRUCTURE eventstab.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_eventstab[] ---> Use another internal table and read that and append to p_eventstab
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
READ TABLE p_eventstab WITH KEY name = slis_ev_top_of_page. " I guess this should be slis_ev_top_of_list
IF sy-subrc = 0 .
MOVE 'TOP_OF_LIST' TO p_eventstab-form.
APPEND p_eventstab. " Here use another internal table
ENDIF.
ENDFORM. " fill_eventstab
Here is the changed code
FORM fill_eventstab TABLES p_eventstab STRUCTURE eventstab.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = lt_eventstab[] "--->declare local lt_eventtab
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
READ TABLE lt_eventstab WITH KEY name = slis_ev_top_of_list. " Read lt_eventab
IF sy-subrc = 0 .
MOVE 'TOP_OF_LIST' TO p_eventstab-form.
APPEND p_eventstab.
ENDIF.
ENDFORM. " fill_eventstab
Hope this solves your issue.
regards,
Advait
Edited by: Advait Gode on May 5, 2009 4:37 PM
2009 May 07 5:25 AM
thanks for u reply,,
i added tha code u have given,
but probelm is heading is not appearing,hence in events table it is top-of-list ,it is displaying only list..
2009 May 04 1:14 PM
2009 May 26 4:19 PM
still nobody in sdn rectified the sol for this, iam forcebly closing this thread