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

data not getting displayed - set_table_for_first_display

Former Member
0 Likes
4,304

hi all,

ihve created field catalog and dynamic internal table both of them has valid data, created container on the screen paintern. but when im runnign this method and passing the internal table ,output is not getting dispaled only empty grid is been dispaled. what might be the problem . what ive to check.please suggest.

CALL METHOD gv_grid1->set_table_for_first_display

EXPORTING

is_layout = git_layout

CHANGING

it_outtab = <gfs_table>

it_fieldcatalog = GIT_FIELDCAT.

CALL METHOD gv_grid1->refresh_table_display.

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
2,087

Was custom container created correctly? Did you place ALV in your custom container? See below


DATA: r_cc_container TYPE REF TO cl_gui_custom_container.
DATA: r_alv_grid TYPE REF TO cl_gui_alv_grid.

DATA: it_sflight TYPE TABLE OF sflight,

INITIALIZATION.
  SELECT * FROM sflight INTO TABLE it_sflight UP TO 10 ROWS.

  CALL SCREEN 100.

MODULE pbo_0100 OUTPUT.
"create container
  CREATE OBJECT r_cc_container
    EXPORTING
      container_name    = 'CUSTOM_CONTROL'.

"create alv grid placing in custom container
  CREATE OBJECT r_alv_grid
    EXPORTING
     i_parent           = r_cc_container.

"dispaly the output
  CALL METHOD r_alv_grid->set_table_for_first_display
    EXPORTING
      i_structure_name              = 'SFLIGHT'  "pass table strcuture...
    CHANGING
      it_outtab                     = it_sflight
*       it_fieldcatalog               = ".... or fieldcatalog alternatively
ENDMODULE.                    

Regards

Marcin

6 REPLIES 6
Read only

Former Member
0 Likes
2,087

HAI,

It seems your internal table is empty..Debug and see whether it has any records or not.

Best Regards,

rama

Read only

0 Likes
2,087

hi rama,

internal table have valid records,ihve check but still im not getting output.

Read only

0 Likes
2,087

HAI,

You can also create an ALV with out field catalog. Try commenting the field catalog and see.

See this tutorial. There are two scenarios explained:

Link could not be posted but search for Dynamic Internal Table in SAPTechnical . com .

Best Regards,

rama

Edited by: newtoAbap on Mar 29, 2010 12:08 PM

Read only

MarcinPciak
Active Contributor
0 Likes
2,088

Was custom container created correctly? Did you place ALV in your custom container? See below


DATA: r_cc_container TYPE REF TO cl_gui_custom_container.
DATA: r_alv_grid TYPE REF TO cl_gui_alv_grid.

DATA: it_sflight TYPE TABLE OF sflight,

INITIALIZATION.
  SELECT * FROM sflight INTO TABLE it_sflight UP TO 10 ROWS.

  CALL SCREEN 100.

MODULE pbo_0100 OUTPUT.
"create container
  CREATE OBJECT r_cc_container
    EXPORTING
      container_name    = 'CUSTOM_CONTROL'.

"create alv grid placing in custom container
  CREATE OBJECT r_alv_grid
    EXPORTING
     i_parent           = r_cc_container.

"dispaly the output
  CALL METHOD r_alv_grid->set_table_for_first_display
    EXPORTING
      i_structure_name              = 'SFLIGHT'  "pass table strcuture...
    CHANGING
      it_outtab                     = it_sflight
*       it_fieldcatalog               = ".... or fieldcatalog alternatively
ENDMODULE.                    

Regards

Marcin

Read only

Former Member
0 Likes
2,087

Hi,

Please check if object of ALV Grid where u assign Container is initial than only call call method gr_alvgrid->set_table_for_first_display else if ALV Gird Object is not initial than call method gr_alvgrid->refresh_table_display.

e.g.



 if gr_alvgrid is initial.

  create object gr_ccontainer
    exporting
      container_name              = 'CC_ALV'
    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 e000 with 'Unable to get container to display list'.
  endif.


  create object gr_alvgrid
    exporting
      i_parent          = gr_ccontainer
    exceptions
      error_cntl_create = 1
      error_cntl_init   = 2
      error_cntl_link   = 3
      error_dp_create   = 4
      others            = 5.
  if sy-subrc <> 0.
    message e000 with 'Unable to instantiate list'.
  endif.

  call method gr_alvgrid->set_table_for_first_display
    exporting
      is_variant                    = wa_variant
      i_save                        = 'A'
      is_layout                     = gs_layout
    changing
      it_outtab                     = gt_final[]
      it_fieldcatalog               = gt_fieldcat[]
    exceptions
      invalid_parameter_combination = 1
      program_error                 = 2
      too_many_lines                = 3
      others                        = 4.
  if sy-subrc <> 0.
    message e000 with 'List could not be displayed'.
  endif.

elseif  not gr_alvgrid is initial .

  call method gr_alvgrid->refresh_table_display
    exceptions
      finished = 1
      others   = 2.
  if sy-subrc <> 0.
    message e000 with 'List could not be refreshed'.
  endif.

Regards

Arbind

Read only

0 Likes
2,087

thanks arbind and marcin.

problem solved.