Application Development 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 data is repeated while going back from alv report

0 Kudos

Hi,

In my alv report , I call ed TOP_OF_PAGE. Data regatding top_of_page is stored in internal table.

After executing the report,while going back from report, a screen containing top_of_page data is appeaing.

Even though I cleared that table,still that data appeared.

Please resolve this.

1 ACCEPTED SOLUTION

0 Kudos

Hi all,

I cleared that table previously .

Still that screen appears.

This is my following code.

PERFORM top_of_page. " Subroutine for Top-of-page

*Display Report

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = lv_repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

i_callback_top_of_page = 'TOP_OF_PAGE'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

it_fieldcat = lt_fieldcat[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS = it_events

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = lt_meter

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.

perform clear_data.

endif.

FORM top_of_page .

  • Declaration of local variables, structures and internal tables

Data : lv_count TYPE i,

lv_count_c(9) TYPE c,

lt_header TYPE slis_t_listheader,

wa_header TYPE slis_listheader,

lt_line LIKE wa_header-info.

  • Title

clear lt_header[].

wa_header-typ = 'H'.

wa_header-info = 'Meter Readings Report'.

APPEND wa_header TO lt_header.

CLEAR wa_header.

  • Total No. of Records Selected

DESCRIBE TABLE lt_meter LINES lv_count.

lv_count_c = lv_count.

CONCATENATE 'Total Number of meters readed for given cycle: ' lv_count_c

INTO lt_line SEPARATED BY space.

wa_header-typ = 'A'.

wa_header-info = lt_line.

APPEND wa_header TO lt_header.

CLEAR: wa_header, lt_line.

*Display Top-of-page

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = lt_header.

ENDFORM. " TOP_OF_PAGE

&----


*& Form CLEAR_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form CLEAR_DATA .

data : lt_header TYPE slis_t_listheader.

clear lt_header[].

endform.

6 REPLIES 6

Former Member
0 Kudos

Hi,

If your internal table is with header line use refresh or clear with square brackets.

if you still not getting properly write the code where you are getting proplem.

thanks.

Aswath

Former Member
0 Kudos

Hi, clear internal table before assign header details to internal table.

like , clrear it_tab[].

then assign header details.

0 Kudos

Hi all,

I cleared that table previously .

Still that screen appears.

This is my following code.

PERFORM top_of_page. " Subroutine for Top-of-page

*Display Report

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = lv_repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

i_callback_top_of_page = 'TOP_OF_PAGE'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

it_fieldcat = lt_fieldcat[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS = it_events

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = lt_meter

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.

perform clear_data.

endif.

FORM top_of_page .

  • Declaration of local variables, structures and internal tables

Data : lv_count TYPE i,

lv_count_c(9) TYPE c,

lt_header TYPE slis_t_listheader,

wa_header TYPE slis_listheader,

lt_line LIKE wa_header-info.

  • Title

clear lt_header[].

wa_header-typ = 'H'.

wa_header-info = 'Meter Readings Report'.

APPEND wa_header TO lt_header.

CLEAR wa_header.

  • Total No. of Records Selected

DESCRIBE TABLE lt_meter LINES lv_count.

lv_count_c = lv_count.

CONCATENATE 'Total Number of meters readed for given cycle: ' lv_count_c

INTO lt_line SEPARATED BY space.

wa_header-typ = 'A'.

wa_header-info = lt_line.

APPEND wa_header TO lt_header.

CLEAR: wa_header, lt_line.

*Display Top-of-page

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = lt_header.

ENDFORM. " TOP_OF_PAGE

&----


*& Form CLEAR_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form CLEAR_DATA .

data : lt_header TYPE slis_t_listheader.

clear lt_header[].

endform.

0 Kudos

Hi,

for your top-of-page in alv this code is enough.


i_callback_top_of_page = 'TOP_OF_PAGE'

You don't have to explicitly call the subroutine it will be called by itself when you write the above statement.

This code is not required


This is my following code.
PERFORM top_of_page. " Subroutine for Top-of-page

Please try this and post the result.

Thanks. and regards.

Aswath.

Edited by: aswathsa on Feb 20, 2012 12:00 PM

0 Kudos

Hi,


perform clear_data.

endif.

The above perform clear_data is inside an IF condition. Please check this condifion is executed properly.

Also i dont think that you need PERFORM top_of_page.Check in debugging that the code is going to this perform, If not get the cursor to this perform and execute and make sure the it_tab is clearing.

Ben

Former Member
0 Kudos

Hi,

Your repetition of Top of page can be avoided by using 'CLEAR'.

Use CLEAR internal table i.e clear itab[] before you assign any header details .

This will work out for you to clear your problem