Skip to Content
0
Aug 31, 2007 at 05:44 AM

ALV GRID DISPLAY

18 Views

hi,

i want to display ALV grid using oops concept.but it does not show all STANDARD TOOL BAR on output like 'insert'.

REPORT ztest_mae1.

DATA : tbl_kna1 TYPE TABLE OF kna1,

tbl_fieldcat TYPE lvc_t_fcat. " For holding Fields of table

  • ALV Grid instance reference of SAP Standard class

DATA: w_o_alvgrid TYPE REF TO cl_gui_alv_grid ,

  • Custom container instance reference

w_o_ccontainer TYPE REF TO cl_gui_custom_container .

CREATE OBJECT w_o_ccontainer

EXPORTING

container_name = 'ZNEW'. “ NAME OF CONTAINER ON SCREEN 9000

*Create ALV grid object

CREATE OBJECT w_o_alvgrid

EXPORTING

i_parent = w_o_ccontainer.

SELECT *

FROM kna1

INTO TABLE tbl_kna1.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = 'KNA1'

CHANGING

ct_fieldcat = tbl_fieldcat

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

  • Displaying the ALV grid

CALL METHOD w_o_alvgrid->set_table_for_first_display

CHANGING

it_outtab = tbl_kna1

it_fieldcatalog = tbl_fieldcat

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

CALL SCREEN 9000.

can u please tell me why standard application tool bar does not show all buttons.