2010 Sep 27 12:42 AM
Hi All,
I am displaying report using ALV grid container.Included pushbutton in alv report tool bar.Displaying any one of the row in next screen by selecting one row in alv report and clicking on pushbutton.When i save the displayed entry in second alv screen updating correctly in databse table.upto here working fine.
My problem is, i am coming back to initial alv screen then selecting any other row from the report, again clicking the push button to display the current selected row in the next screen as displayed above.But second selected row is not appearing in the second screen instead it is displaying the same entry which was saved first time.
I have checked in the degugging that i can see the second entry picking up correctly to the final internal table of second alv screen.but it's not displaying in the reort.Displaying the old saved entry only.
One more thing is without saving the entry in second screen i can able to display any entry by selecting the entry in the initial alv report.
I am wondering why it's not displaying the entry in second screen eventhough it's picking the correct entry till alv display of second screen.In output not showing that entry.showing only that old entry.
I need your expert opinion to solve this problem.
Hari..
Edited by: Rob Burbank on Sep 27, 2010 2:23 PM
Hi All,
I am displaying report using ALV grid container.Included pushbutton in alv report tool bar.Displaying any one of the row in next screen by selecting one row in alv report and clicking on pushbutton.When i save the displayed entry in second alv screen updating correctly in databse table.upto here working fine.
My problem is, i am coming back to initial alv screen then selecting any other row from the report, again clicking the push button to display the current selected row in the next screen as displayed above.But second selected row is not appearing in the second screen instead it is displaying the same entry which was saved first time.
I have checked in the degugging that i can see the second entry picking up correctly to the final internal table of second alv screen.but it's not displaying in the reort.Displaying the old saved entry only.
One more thing is without saving the entry in second screen i can able to display any entry by selecting the entry in the initial alv report.
I am wondering why it's not displaying the entry in second screen eventhough it's picking the correct entry till alv display of second screen.In output not showing that entry.showing only that old entry.
I need your expert opinion to solve this problem.
Hari..
Edited by: Rob Burbank on Sep 27, 2010 2:23 PM
2010 Sep 27 1:28 AM
Hiowdy,
Try refreshing the alv grid in your second screen when you navigate between screens:
go_grid->refresh_table_display( ).
Cheers
Alex
2010 Sep 27 2:36 AM
Hi Alex,
I have already used as below.but it's not working.
CALL METHOD o_grid->set_table_for_first_display
EXPORTING
is_variant = gs_variant
i_save = 'A'
i_default = 'X'
it_toolbar_excluding = i_exclude
is_layout = wa_layout
CHANGING
it_fieldcatalog = i_fieldcat
it_outtab = <i_final_act>.
*Refreshing ALV Grid display
CALL METHOD o_grid->refresh_table_display
EXPORTING
i_soft_refresh = 'X'
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
--Exception handling
ENDIF.
2010 Sep 27 5:15 AM
Hi
Try this.
if o_grid is initial.
create object <container>
exporting
container_name = 'container1'.
create object o_grid
exporting
i_parent = container_name.
perform fieldcatalog.
CALL METHOD o_grid->set_table_for_first_display
EXPORTING
is_variant = gs_variant
i_save = 'A'
i_default = 'X'
it_toolbar_excluding = i_exclude
is_layout = wa_layout
CHANGING
it_fieldcatalog = i_fieldcat[]
it_outtab = i_final_act[].
( after that I think you need to call the method for selecting rows.
like what I did in my code is below:
create object event.
set handler event->handle_double_click for o_grid.
else.
call method o_grid->refresh_table_display. )
*Refreshing ALV Grid display
CALL METHOD o_grid->refresh_table_display
EXPORTING
i_soft_refresh = 'X'
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc 0.
--Exception handling
ENDIF.
endif.
In this code if your o_grid is intial then it will process all the coding before refresh method else if your o_grid is not intial it will refresh the table which is going to be displayed.
I hope this will work for you
Thanks
Lalit Guptaa
2010 Sep 27 7:01 PM
Hi lalit,
i don't understand your solution..
Can you explain elborate solution.
harii...
2010 Sep 27 8:01 PM
Hi Srihari,
On your back button just use method REFRESH_TABLE_DISPLAY of class CL_GUI_ALV_GRID,
this will solve, also check tht the previous line is not selected when you are pushing the button
Thanks,
Anmol.
2011 Dec 18 12:59 PM
Hellow freinds,
I am also have same issue i make one GUI status , the process of screen as follow
Screen 100 -
> this User Slection screen, Here user start to make input and one Push button 'Display" when user click this Display the Programme Goes to Screen--101
Screen 101------> this is the result screen here ALV grid Display shows the result,
Now user click the Back Button (Standard Tool Bar) , then he see the first screen means screen 100 (Input screen)
Now user changes the value and again click Display for result ,so the problem is User can not see the correct result after pressing back , ALV shows the old result below is my code where i exporting the filed catalog.
PERFORM get_fieldcatalog.
CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
is_layout = layout
is_variant = variant
i_save = 'U'
i_structure_name = 'I_ALV2'
CHANGING
it_outtab = i_alv2[]
it_fieldcatalog = fieldcat[].
Plz give me some suggestion how to solve this issue.
Edited by: Neha.Servade on Dec 18, 2011 2:37 PM
2011 Dec 19 4:58 AM
Hi srihari,
If you want to refresh the ALV container use this code.
DATA : CONT type ref to cl_gui_alv_grid.
IF NOT CONT IS INITIAL.
CALL METHOD CONT->FREE.
CLEAR: CONT.
ENDIF.
CREATE OBJECT CONT
EXPORTING
CONTAINER_NAME = 'CONTAINER'.
CREATE OBJECT GRID
EXPORTING
I_PARENT = CONT.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
CHANGING
IT_OUTTAB = IT_KNA1
IT_FIELDCATALOG = IT_FCAT.
Place the above code before calling the screen 101 from 100.
Hope this is useful.
Regards,
G.Aditya