‎2010 May 08 6:34 AM
hi experts,
I am using the method set_table_for_first_display to display my grid output. when am excute the program its showing run time error.
error is showing in call method alv_grid->set_table_for_first_display
runtime error is showing in 'NULL'
If anyone know means please suggest me how to clear the error.....
thanks
experts
‎2010 May 08 4:44 PM
Hi,
Refer to my article below, which has a very simple step by step tutorial on how to build a OO ALV with code sample-
http://www.divulgesap.com/blog.php?p=MTMz
Hope it helps.
Regards,
Ravikiran
‎2010 May 08 5:10 PM
Hi,
Did you write the following code sequence in PBO?
MODULE load_data OUTPUT.
CREATE OBJECT c_container
EXPORTING
container_name = 'C_CONTAINER'
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.
ENDIF.
CREATE OBJECT grid
EXPORTING
i_parent = c_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.
DATA:
r_event TYPE REF TO lcl_event_receiver.
CREATE OBJECT r_event.
SET HANDLER : r_event->handle_double_click FOR grid,
lcl_event_toolbar=>handle_toolbar FOR grid,
lcl_event_toolbar=>handle_user_command FOR grid,
r_event->handle_col FOR grid,
r_event->handle_sort FOR grid.
CALL METHOD grid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_outtab = t_sflight
it_fieldcatalog = t_fcat
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-msgv4.
ENDIF.
ENDMODULE. " LOAD_DATA OUTPUT
Just check if grid is been passed container.
Regards and Best wishes.
Kiran Bura