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: 

ALV GRID DISPLAY

mahesh_jagnani
Participant
0 Kudos

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.

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello Mahesh

I assume that you mean the ALV toolbar shown above the ALV grid. The "<i>insert</i>" button (-> add new row) is only available on <b>editable </b>ALV lists.

If you set gs_layout-edit = 'X' (structure LVC_S_LAYO) and provide this layout information to method SET_TABLE_FOR_FIRST_DISPLAY your ALV grid should be editable and the corresponding buttons (add/delete row) appear.

For sample reports refer to <b>BCALV_EDIT_*</b>.

Regards

Uwe

3 REPLIES 3

Former Member
0 Kudos

Hi,

Use the GUI Status 'SALV_TABLE_STANDARD".

regards,

Navneeth K.

uwe_schieferstein
Active Contributor
0 Kudos

Hello Mahesh

I assume that you mean the ALV toolbar shown above the ALV grid. The "<i>insert</i>" button (-> add new row) is only available on <b>editable </b>ALV lists.

If you set gs_layout-edit = 'X' (structure LVC_S_LAYO) and provide this layout information to method SET_TABLE_FOR_FIRST_DISPLAY your ALV grid should be editable and the corresponding buttons (add/delete row) appear.

For sample reports refer to <b>BCALV_EDIT_*</b>.

Regards

Uwe

0 Kudos

thanks alot.