Skip to Content
author's profile photo Former Member
Former Member

Object oriented ALV

hi,

i am doing object oriented alv in which i need to display some lines at the top of the page . Below is my code where i am using set_gridtitle method for displaying title of the list. but its not working pls suggest

IF gv_custom_container IS INITIAL.

Create the container for screen 100

CREATE OBJECT gv_custom_container

EXPORTING

container_name = gc_container "C_CTRL1

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5

OTHERS = 6

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

  • Creating alv grid instance

CREATE OBJECT gv_grid

EXPORTING

i_parent = gv_custom_container

EXCEPTIONS

error_cntl_create = 1

error_cntl_init = 2

error_cntl_link = 3

error_dp_create = 4

OTHERS = 5

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL METHOD cl_gui_cfw=>flush.

IF sy-subrc NE 0.

CALL FUNCTION 'POPUP_TO_INFORM'

EXPORTING

titel = sy-repid

txt2 = sy-subrc

txt1 = 'Error in flush'.

ENDIF.

PERFORM f_build_layout.

PERFORM f_grid_title.

PERFORM f_build_fcat CHANGING gi_fcat.

CALL METHOD gv_grid->set_gridtitle

EXPORTING

i_gridtitle = gv_title.

Display the output in grid

CALL METHOD gv_grid->set_table_for_first_display

EXPORTING

is_variant =

i_save = gc_a

i_default = 'X'

is_layout = gwa_layout

it_toolbar_excluding =

it_hyperlink =

it_alv_graphics =

it_except_qinfo =

ir_salv_adapter =

CHANGING

it_outtab = gi_final

it_fieldcatalog = gi_fcat

it_sort =

it_filter =

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msg

ELSE.

CALL METHOD gv_grid->refresh_table_display

EXCEPTIONS

finished = 1

OTHERS = 2.

ENDIF.

ENDIF.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Sep 22, 2008 at 10:39 AM

    check this blog

    TOP_OF_PAGE in ALV Using CL_GUI_ALV_GRID

    and if you want only a single line title you can use layout

    and set the attribute GRID_TITLE and pas the layout to alv display method

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.