‎2010 Mar 29 5:40 AM
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.
‎2010 Mar 30 8:06 AM
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
‎2010 Mar 29 10:13 AM
HAI,
It seems your internal table is empty..Debug and see whether it has any records or not.
Best Regards,
rama
‎2010 Mar 29 10:18 AM
hi rama,
internal table have valid records,ihve check but still im not getting output.
‎2010 Mar 29 11:05 AM
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
‎2010 Mar 30 8:06 AM
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
‎2010 Mar 30 8:11 AM
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
‎2010 Mar 30 10:03 AM