Application Development and Automation 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: 
Read only

Set_table_for_first_display its showing runtime error

Former Member
0 Likes
764

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

2 REPLIES 2
Read only

Former Member
0 Likes
489

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

Read only

Former Member
0 Likes
489

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