04-24-2009 7:27 AM
Dear Freinds,
iam not able to trigger the top of page event , iam givng complete code which i have written for ALV.
Form alv_display.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = v_repid.
IF it_count_succ IS NOT INITIAL.
Get the fieldcatalog for the first block
* tOTAL
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = TOTAL_SUCSS'.
s_fieldcatalog-tabname = 'IT_COUNT_SUCC'.
s_fieldcatalog-seltext_m = 'Total Count '.
APPEND s_fieldcatalog TO t_fieldcatalog1.
CLEAR s_fieldcatalog.
*dESC
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'DESC'.
s_fieldcatalog-tabname = 'IT_COUNT_SUCC'.
s_fieldcatalog-seltext_l = 'Status of
the E-MAIL'.
s_fieldcatalog-outputlen = '50'.
APPEND s_fieldcatalog TO t_fieldcatalog1.
CLEAR s_fieldcatalog.
ENDIF.
IF it_count_fail IS NOT INITIAL.
Get the fieldcatalog for the second block
* tOTAL
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'TOTAL_FAIL'.
s_fieldcatalog-tabname = 'IT_COUNT_FAIL'.
s_fieldcatalog-seltext_m = 'Total Count '.
APPEND s_fieldcatalog TO t_fieldcatalog2.
CLEAR s_fieldcatalog.
*dESC
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'DESC'.
s_fieldcatalog-tabname = 'IT_COUNT_FAIL'.
s_fieldcatalog-seltext_l = 'Status of the E-MAIL'.
s_fieldcatalog-outputlen = '50'.
APPEND s_fieldcatalog TO t_fieldcatalog2.
CLEAR s_fieldcatalog..
ENDIF.
IF it_count_succ IS NOT INITIAL OR
it_count_fail IS NOT INITIAL.
wa_events-form = 'TOP_PAGE'.
wa_events-name = 'TOP_OF_PAGE'.
APPEND wa_events TO it_events.
ENDIF.
IF it_count_succ IS NOT INITIAL.
v_tabname = 'IT_COUNT_SUCC'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = v_layout
it_fieldcat = t_fieldcatalog1[]
i_tabname = v_tabname
it_events = it_events[]
TABLES
t_outtab = it_count_succ.
ENDIF.
IF it_count_fail IS NOT INITIAL.
v_tabname = 'IT_COUNT_FAIL'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = v_layout
it_fieldcat = t_fieldcatalog2[]
i_tabname = v_tabname
it_events = it_events[]
TABLES
t_outtab = it_count_fail.
ENDIF.
**Display
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
i_interface_check = ' '
IS_PRINT =
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 =
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_PAGE
&----
text
-
FORM top_page.
break-point.
WRITE:/ 'PLAYSLIP REPOT ' COLOR 5.
ENDFORM. "TOP_PAGE
endform.
Please correct me where i went wrong , there by iam not able to getting the top of page. In debugging i can see that the Form top_page is not getting selected at all, even though i can see data in IT_EVENTS when 'REUSE_ALV_BLOCK_LIST_APPEND'
regards
divya.
04-24-2009 7:29 AM
Hi,
have yu assigned proegram name to v_repid, check it.
v_repid = Sy-repid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = v_repid.
Regards,
Naveen
04-24-2009 7:33 AM
Context Block
IF it_count_succ IS NOT INITIAL OR it_count_fail IS NOT INITIAL. wa_events-form = 'TOP_PAGE'. wa_events-name = 'TOP_OF_PAGE'. APPEND wa_events TO it_events. ENDIF.
please remove the condition from the above context block and try.
04-24-2009 7:39 AM
Hi,
You can use top of page like,
DATA: IT_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER TYPE SLIS_LISTHEADER.
In the function module,
CALL FUNCTION 'REUSE_ALV_GRID_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_CALLBACK_TOP_OF_PAGE = 'TOP' "this will point to subroutine top
"where header is declared
FORM TOP.
refresh top.
WA_HEADER-TYP = 'S'.
WA_HEADER-KEY = TEXT-001.
WA_HEADER-INFO = SY-REPID.
APPEND WA_HEADER TO IT_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = 'S'.
WA_HEADER-KEY = TEXT-002.
WA_HEADER-INFO = SY-UNAME.
APPEND WA_HEADER TO IT_HEADER.
CLEAR WA_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = IT_HEADER
* I_LOGO =
* I_END_OF_LIST_GRID =
* I_ALV_FORM =
.
ENDFORM.
Hope it helps
Regards
Mansi
04-24-2009 11:38 AM
I have got the solution now based on the standard program BALVBT01 reference .
regards
divya
04-24-2009 11:38 AM
I have got the solution now based on the standard program BALVBT01 reference .
regards
divya