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: 
Read only

Problem while displaying footer in alv.....

Former Member
0 Likes
1,079

hi,

i want to display a valuein footer, say for example v_sum is my data object and it contains value 345,

in footer of my alv i want to display it as

  Total of primum: 345.

for this i have coded like this......

this is first way:

wa_event-name = 'END_OF_LIST'.   
wa_event-form  = 'END_OF_LIST'.
APPEND wa_event to v_event.
CLEAR wa_event.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = v_repid
      is_layout          = w_layout
      it_fieldcat        = it_field
      it_sort            = it_sort
      it_events          = v_event[]
    TABLES
      t_outtab           = it_final.

FORM END_OF_LIST.

WRITE: 'TOTAL:', v_sum.

ENDFORM.

second way:

WA_foOTER-TYP = 'S'.
  CONCATENATE 'TOTAL : '  v_sum INTO WA_FOOTER-INFO.
 APPEND WA_FOOTER TO IT_FOOTER.

 CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program             = v_repid
      i_callback_html_end_of_list = 'END_OF_LIST' 
      is_layout                            = w_layout
      it_fieldcat                           = it_field
      it_sort                                = it_sort
      it_events                            = v_event[]
    TABLES
      t_outtab                            = it_final.

FORM END_OF_LIST.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
     IT_LIST_COMMENTARY       = IT_FOOTER.

ENDFORM.

but the problem is it is creating a footer but it is not displaying nothing can anybody suggest me where i am going wrong..please..................

Thanks and regards,

kamala

hi,

i want to display a valuein footer, say for example v_sum is my data object and it contains value 345,

in footer of my alv i want to display it as

  Total of primum: 345.

for this i have coded like this......

this is first way:

wa_event-name = 'END_OF_LIST'.   
wa_event-form  = 'END_OF_LIST'.
APPEND wa_event to v_event.
CLEAR wa_event.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = v_repid
      is_layout          = w_layout
      it_fieldcat        = it_field
      it_sort            = it_sort
      it_events          = v_event[]
    TABLES
      t_outtab           = it_final.

FORM END_OF_LIST.

WRITE: 'TOTAL:', v_sum.

ENDFORM.

second way:

WA_foOTER-TYP = 'S'.
  CONCATENATE 'TOTAL : '  v_sum INTO WA_FOOTER-INFO.
 APPEND WA_FOOTER TO IT_FOOTER.

 CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program             = v_repid
      i_callback_html_end_of_list = 'END_OF_LIST' 
      is_layout                            = w_layout
      it_fieldcat                           = it_field
      it_sort                                = it_sort
      it_events                            = v_event[]
    TABLES
      t_outtab                            = it_final.

FORM END_OF_LIST.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
     IT_LIST_COMMENTARY       = IT_FOOTER.

ENDFORM.

but the problem is it is creating a footer but it is not displaying nothing can anybody suggest me where i am going wrong..please..................

Thanks and regards,

kamala

9 REPLIES 9
Read only

Former Member
0 Likes
1,011

cazn any boby help me its urget.....

Read only

Former Member
0 Likes
1,011

refer this link,

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_endlist.htm

Full coding list

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm

This will solve ur problem, reward points and close the thraed if ur problem got solved.

Read only

Former Member
0 Likes
1,011

Try by giving line-count

REPORT test NO STANDARD PAGE HEADING

LINE-SIZE 240

LINE-COUNT 66(4).

Read only

Former Member
0 Likes
1,011

HI,

data is not displaying in footer.. can any body help me....

i have folled this link also...

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_endlist.htm

this is my code.....

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program          = v_repid
*     i_callback_html_end_of_list = 'END_OF_LIST_HTML'
      is_layout                   = w_layout
      it_fieldcat                 = it_field
      it_sort                     = it_sort
      it_events                   = v_event[]
      i_save                      = 'X'
    TABLES
      t_outtab                    = it_final
    EXCEPTIONS
      program_error               = 1
      OTHERS                      = 2.

FORM end_of_list_html USING end TYPE REF TO cl_dd_document..

  DATA:   ls_text    TYPE sdydo_text_element,
          l_grid     TYPE REF TO cl_gui_alv_grid,
          f(14)      TYPE c VALUE 'SET_ROW_HEIGHT'.

  ls_text = 'total'.
  v_prim1 = v_prim.

  CONCATENATE ls_text v_prim1 INTO ls_text.

* adds test (via variable)
  CALL METHOD end->add_text
    EXPORTING
      text         = ls_text
      sap_emphasis = 'strong'.

* adds new line (start new line)
  CALL METHOD end->new_line.

*set height of this section
  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
      e_grid = l_grid.

  CALL METHOD l_grid->parent->parent->(f)
    EXPORTING
      id     = 3
      height = 14.

ENDFORM.                    "end_of_list_html

please help me it is urgent....

Read only

0 Likes
1,011

Hi

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program          = v_repid
     i_callback_html_end_of_list = 'END_OF_LIST'
      is_layout                   = w_layout
      it_fieldcat                 = it_field
      it_sort                     = it_sort
      it_events                   = v_event[]
      i_save                      = 'X'
    TABLES
      t_outtab                    = it_final
    EXCEPTIONS
      program_error               = 1
      OTHERS                      = 2.



FORM end_of_list USING end TYPE REF TO cl_dd_document..
 
  DATA:   ls_text    TYPE sdydo_text_element,
          l_grid     TYPE REF TO cl_gui_alv_grid,
          f(14)      TYPE c VALUE 'SET_ROW_HEIGHT'.
 
  
  WRITE: 'Total' to ls_text,
               V_TOTAL CURRENCY <CURR> TO LS_TEXT+6..

* adds test (via variable)
  CALL METHOD end->add_text
    EXPORTING
      text         = ls_text
      sap_emphasis = 'strong'.
 
* adds new line (start new line)
  CALL METHOD end->new_line.
 
*set height of this section
  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
      e_grid = l_grid.
 
  CALL METHOD l_grid->parent->parent->(f)
    EXPORTING
      id     = 3
      height = 14.

Max

Read only

0 Likes
1,011

hi max,

it is not displaying max....pls. check this....

 wa_event-name = slis_ev_end_of_list.
 wa_event-form = 'END_OF_LIST'.
  APPEND wa_event TO v_event.
  CLEAR wa_event.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program          = v_repid

      i_callback_html_end_of_list = 'END_OF_LIST'
      is_layout                   = gd_layout 
      it_fieldcat                 = it_field
      it_sort                     = it_sort
      it_events                   = v_event[]
      i_save                      = 'X'
    TABLES
      t_outtab                    = it_final
    EXCEPTIONS
      program_error               = 1
      OTHERS                      = 2.

ENDFORM.                    " ALV_DISPLAY

FORM end_of_list USING end TYPE REF TO cl_dd_document..

  DATA:   ls_text    TYPE sdydo_text_element,
          l_grid     TYPE REF TO cl_gui_alv_grid,
          f(14)      TYPE c VALUE 'SET_ROW_HEIGHT'.


  WRITE: 'Total' to ls_text,
               V_prim  TO LS_TEXT+6.

* adds test (via variable)
  CALL METHOD end->add_text
    EXPORTING
      text         = ls_text
      sap_emphasis = 'strong'.

* adds new line (start new line)
  CALL METHOD end->new_line.

*set height of this section
  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
      e_grid = l_grid.

  CALL METHOD l_grid->parent->parent->(f)
    EXPORTING
      id     = 3
      height = 14.

endform.

Read only

0 Likes
1,011

Hi,

Y u have commented

*     i_callback_html_end_of_list = 'END_OF_LIST_HTML'Uncomment this if you have commented.

After
  CONCATENATE ls_text v_prim1 INTO ls_text.

* adds new line (start new line)
  CALL METHOD end->new_line.

* adds test (via variable)
  CALL METHOD end->add_text
    EXPORTING
      text         = ls_text
      sap_emphasis = 'strong'.
 
* adds new line (start new line)
  CALL METHOD end->new_line.

After doing the above chanegs if you are not getting the correct output, try adjusting the height in the footer.

Read only

0 Likes
1,011

no it is not comming.......if u can pls. tell me what to do...

Read only

Former Member
0 Likes
1,011

second way:

WA_foOTER-TYP = 'S'.

CONCATENATE 'TOTAL : ' v_sum INTO WA_FOOTER-INFO.

APPEND WA_FOOTER TO IT_FOOTER.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = v_repid

i_callback_html_end_of_list = 'END_OF_LIST'

is_layout = w_layout

it_fieldcat = it_field

it_sort = it_sort

it_events = v_event[]

TABLES

t_outtab = it_final.

FORM END_OF_LIST.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = IT_FOOTER

<b> I_END_OF_LIST_GRID = 'X'</b>.

ENDFORM.

you have to define end of list here

regards

shiba dutta