Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

TOP OF PAGE nOT gettign displayed

Former Member
0 Kudos
283

Dear Freinds,

Iam using the ALV and iam not able to get the top of the page , please any one could correct me in my code where i am going wrong.

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 '.

  • s_fieldcatalog-ref_tabname = 'VBAK'.

  • s_fieldcatalog-ref_fieldname = 'VBELN'.

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-ref_tabname = 'VBAK'.

  • s_fieldcatalog-ref_fieldname = 'BSTNK'.

s_fieldcatalog-outputlen = '50'.

APPEND s_fieldcatalog TO t_fieldcatalog1.

CLEAR s_fieldcatalog.

wa_events-form = 'TOP_PAGE'.

wa_events-name = slis_ev_top_of_list . "'TOP_OF_PAGE'.

APPEND wa_events TO it_events.

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 '.

  • s_fieldcatalog-ref_tabname = 'VBAK'.

  • s_fieldcatalog-ref_fieldname = 'VBELN'.

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-ref_tabname = 'VBAK'.

  • s_fieldcatalog-ref_fieldname = 'BSTNK'.

s_fieldcatalog-outputlen = '50'.

APPEND s_fieldcatalog TO t_fieldcatalog2.

CLEAR s_fieldcatalog.

  • wa_events-form = 'TOP_PAGE'.

  • wa_events-name = 'TOP_OF_PAGE'.

  • APPEND wa_events TO it_events.

ENDIF.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

EXPORTING

i_callback_program = v_repid.

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 = fp_it_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 = fp_it_fail.

ENDIF.

**Display

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.

&----


*& Form TOP_PAGE

&----


  • text

----


FORM TOP_PAGE.

WRITE:/ 'PLAYSLIP REPOT ' COLOR 5.

ENDFORM. "TOP_PAGE

Please could any one correct me where iam going wrong.

regards

divya

1 ACCEPTED SOLUTION

Former Member
0 Kudos
252

Hi,

Refer to this demo program BALVBT01.

data: gt_zevents type slis_t_event.

  xs_event-name = slis_ev_top_of_page.
  xs_event-form = 'TOP_OF_PAGE'.
  append xs_event to gt_zevents.


  call function 'REUSE_ALV_BLOCK_LIST_APPEND'
       exporting
            it_fieldcat     = zfield
            is_layout       = z_layout
            i_tabname       = 'ZDATA'
            it_events       = gt_zevents
            i_text          = text-0b3
       tables
            t_outtab        = zdata.

form top_of_page.
  write: / 'TOP_OF_PAGE'.
endform.

10 REPLIES 10

Former Member
0 Kudos
252

In the form TOP_OF_PAGE, you need to insert your comments using the FM "REUSE_ALV_COMMENTARY_WRITE" instead of WRITE.

Regards,

Pepe

Former Member
0 Kudos
253

Hi,

Refer to this demo program BALVBT01.

data: gt_zevents type slis_t_event.

  xs_event-name = slis_ev_top_of_page.
  xs_event-form = 'TOP_OF_PAGE'.
  append xs_event to gt_zevents.


  call function 'REUSE_ALV_BLOCK_LIST_APPEND'
       exporting
            it_fieldcat     = zfield
            is_layout       = z_layout
            i_tabname       = 'ZDATA'
            it_events       = gt_zevents
            i_text          = text-0b3
       tables
            t_outtab        = zdata.

form top_of_page.
  write: / 'TOP_OF_PAGE'.
endform.

0 Kudos
252

The Top of page is triggering, could any one please let me know where i have

to keep the form routine

FORM TOP_PAGE.

WRITE:/ 'PLAYSLIP REPOT ' COLOR 5.

ENDFORM. "TOP_PAGE

as it is not at all triggering.....the cursor not even coming inside the top_page form routine............i have tested in debugging.

please any one suggest me where i have to keep the top of the page in the sequence of the program..

regards

divya.

0 Kudos
252

Follow as per [this link>>>>|http://www.sap-img.com/abap/reuse-alv-block-list-display.htm]

0 Kudos
252

Hi,

First provide the TOP_OF_PAGE event and form name to an internal table which can you provide to REUSE_ALV_GRID_DISPLAY.

Then goto Form of top_of_page :

decalre one internal table of type which can provide to FM : REUSE_LIST_COMMNETRY_WRITE

provide Typ and Info field values which are fields of that internal table.

Former Member
0 Kudos
252

Yes you need to use REUSE_ALV_COMMENTARY_WRITE to write top of page.

Regards,

Lalit Mohan Gupta.

Former Member
0 Kudos
252

hi divya,

use this

DATA: IT_EVENT TYPE SLIS_T_EVENT,

WA_EVENT LIKE LINE OF IT_EVENT.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

I_LIST_TYPE = 0

IMPORTING

ET_EVENTS = it_event

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 it_event into wa_event with key name = 'TOP_OF_PAGE'.

WA_EVENT-FORM = 'TOP_HEADER'.

MODIFY IT_EVENT FROM WA_EVENT INDEX SY-TABIX.

CLEAR WA_EVENT.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

IT_EVENTS = IT_EVENT

FORM TOP_HEADER.

REFRESH IT_TOP.

WA_TOP-TYP = 'S'.

WA_TOP-INFO = 'ANY TEXT'.

APPEND WA_TOP TO IT_TOP.

CLEAR WA_TOP.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = IT_TOP.

  • I_LOGO =

  • I_END_OF_LIST_GRID =

  • I_ALV_FORM =

ENDFORM.

i hope it solves ur prob.......

regards

shivraj

Edited by: ShivrajSinha on Apr 24, 2009 7:15 AM

Former Member
0 Kudos
252

use FM REUSE_ALV_COMMENTARY_WRITE to write top of page.at the end of program and pass the parameters. only then u get the heading of page.

Former Member
0 Kudos
252

Dear Freinds,

still 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.

WRITE:/ 'PLAYSLIP REPOT ' COLOR 5.

ENDFORM. "TOP_PAGE

endform . " alv_display.

My point the cursor in debug mode i have checked it never coming insider the Form top_page, eventhough i have seen an entry it_events for the form name = top_page. could any one please correct me why it is not calling, i agree that i have use the commentary write......but my question is why the cursor is not at all coming at form to_of_page event itself?? I think i have given some where wrong ......could any one please correct me.

regards

divya.

Former Member
0 Kudos
252

as i have reopened anoher thread