‎2014 Oct 30 10:17 AM
Hi experts,
I am trying to display two lists., wherein first list displays header details and second list displays item details.
When I change the selection in first list data is not getting displayed in second list as per the selection.
Previous selection data is displayed not the current one.
Second list internal table is getting populated correctly, but not displayed! previous records are displayed.
Class used CL_GUI_ALV_GRID and method set_table_for_first_display.
What is the solution for this ?
BR,
Eshwar
‎2014 Oct 30 10:40 AM
Hi,
you could use this code:
if ref_gui is initial.
create container, fieldcat, first display ecc....
else.
PERFORM refresh_alv USING ref_gui.
endif.
*&---------------------------------------------------------------------*
*& Form REFRESH_ALV
*&---------------------------------------------------------------------
FORM refresh_alv USING l_ref_gui TYPE REF TO cl_gui_alv_grid.
DATA st_stable TYPE lvc_s_stbl.
CHECK l_ref_gui IS NOT INITIAL.
st_stable-row = 'X'.
st_stable-col = 'X'.
CALL METHOD l_ref_gui->refresh_table_display
EXPORTING
is_stable = st_stable
i_soft_refresh = ' '
EXCEPTIONS
finished = 1
OTHERS = 2.
ENDFORM. " REFRESH_ALV
let me know,
AI
‎2014 Oct 30 10:36 AM
‎2014 Oct 30 10:37 AM
Hi Eshwar,
please try mutigrid with different selection statments.
‎2014 Oct 30 10:40 AM
Hi,
you could use this code:
if ref_gui is initial.
create container, fieldcat, first display ecc....
else.
PERFORM refresh_alv USING ref_gui.
endif.
*&---------------------------------------------------------------------*
*& Form REFRESH_ALV
*&---------------------------------------------------------------------
FORM refresh_alv USING l_ref_gui TYPE REF TO cl_gui_alv_grid.
DATA st_stable TYPE lvc_s_stbl.
CHECK l_ref_gui IS NOT INITIAL.
st_stable-row = 'X'.
st_stable-col = 'X'.
CALL METHOD l_ref_gui->refresh_table_display
EXPORTING
is_stable = st_stable
i_soft_refresh = ' '
EXCEPTIONS
finished = 1
OTHERS = 2.
ENDFORM. " REFRESH_ALV
let me know,
AI
‎2014 Oct 30 10:43 AM
Hi,
Try this on screen loading (PBO).
If alv_object is bound.
call the method refresh tabe display using alv_object.
else.
set table for first display
endif.
‎2021 Nov 29 6:44 AM
Hi, I think it will be help your problem;
1) First of all you can show 2 alv with "cl_gui_splitter_container" after that you must define two alv grid and two container
"go_alv type ref to cl_gui_alv_grid,
go_alv2 type ref to cl_gui_alv_grid,*************************
"data: go_spli type ref to cl_gui_splitter_container,
go_sub1 type ref to cl_gui_container,********
Already you would define your internal table and fieldcatalog , layout features.
first alv can display with this form;
"
form display_alv .
if go_alv is initial.
create object go_container
exporting
container_name = 'CC_ALV'.
create object go_spli
exporting
parent = go_container
rows = 3
columns = 1.
call method go_spli->get_container
exporting
row = 1
column = 1
receiving
container = go_sub1.
call method go_spli->get_container
exporting
row = 2
column = 1
receiving
container = go_sub2.
call method go_spli->set_row_height
exporting
id = 1
height = 16.
create object go_docu
exporting
style = 'ALV_GRID'.
create object go_alv
exporting
i_parent = go_sub2. "OR GO_CONTAINER
create object go_event_receiver.
set handler go_event_receiver->handle_top_of_page for go_alv.
set handler go_event_receiver->handle_double_click for go_alv.
call method go_alv->set_table_for_first_display
exporting
i_structure_name = 'SCARR'
changing
it_outtab = gt_scarr.
call method go_alv->list_processing_events
exporting
i_event_name = 'TOP_OF_PAGE'
i_dyndoc_id = go_docu.
else.
call method go_alv->refresh_table_display.
endif.
endform. " DISPLAY_ALV "
after second alv is ;
form display_alv2 .
if go_alv2 is INITIAL.
create object go_container
exporting
container_name = 'CC_ALV'.
call method go_spli->get_container
exporting
row = 3
column = 1
receiving
container = go_sub3.
create object go_alv2
exporting
i_parent = go_sub3. "OR GO_CONTAINER
call method go_alv2->set_table_for_first_display
exporting
i_structure_name = 'SFLIGHT'
changing
it_outtab = gt_sflight.
else.
call method go_alv2->refresh_table_display.
endif.
endform. " DISPLAY_ALV2
"
HINT: Your double click method can be like this,
"
read table gt_scarr into gs_scarr index e_row-index.
if sy-subrc eq 0.
select * from sflight into table gt_sflight
where carrid = gs_scarr-carrid.
endif.
perform display_alv2.
perform set_fcat2.
"
Dont forget to refresh second alv display, if it will be your alv doesn't appear second click.