‎2011 Feb 16 8:19 AM
Hi,
I am using method set_table_for_first_display to display 2 different output with same container depending upon the selection of radio button. but the problem I am facing is when I click BACK button after dispaying second output and executing first output, it is showing prebious output only. is there any method to handle this problem?
Regards,
Nilanjana
‎2011 Feb 16 8:44 AM
Please try flushing the buffer using the class method CL_GUI_CFW=>FLUSH. This should refresh your buffer data in the container.
Regards
Ranganath
‎2011 Feb 16 8:24 AM
Hi,
As you told code is working perfect. Write code in such a way leave program or leave screen.
case sy-ucomm.
when 'Back'.
leave program.
end case.
check if it is useful.
Regards,
Madhu.
‎2011 Feb 16 8:26 AM
HI,
When you are clicking on BACK button you should clear the Internal Table it_outtab.Hope your problem will be sloved.You can check in debugging mode also when you press the second radio button what is the content of the it_outtab table...
Regards,
Suvajit...
‎2011 Feb 16 8:26 AM
Well, by standard back button is ued for switching b/w different screens.
Are you using:
- same screen?
- same container?
- same ALV control?
In order to simplify everything you should consider two ALV's which can be in turn swapped inside one container.
Regards
Marcin
‎2011 Feb 16 8:33 AM
Hi Marcin,
yes I am using
same screen and container but different fieldcatalog.
when i am executing second layout after first the output is changed but its not getting changed for vice versa.
Edited by: nilanjana sinha on Feb 16, 2011 9:33 AM
‎2011 Feb 16 8:37 AM
Hi,
On clicking back use leave to screen 0 in the PAI module of the screen.
Call screen 100.
PROCESS BEFORE OUTPUT.
Logic
.
.
.
PROCESS AFTER INPUT.
MODULE USER_COMMAND.
MODULE USER_COMMAND INPUT.
IF sy-ucomm EQ 'User command defined for BACK button'.
LEAVE TO SCREEN 0. "Go back to selection screen
ENDIF.
END MODULE.
Have a look at the method FREE of class cl_gui_alv_grid.
eg:
CALL METHOD wcl_alvgrid1->free
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
Thanks,
Vinod.
‎2011 Feb 16 8:44 AM
Please try flushing the buffer using the class method CL_GUI_CFW=>FLUSH. This should refresh your buffer data in the container.
Regards
Ranganath
‎2011 Feb 16 9:03 AM
flush free is not working, refresh_table_display is working if I place it before set_table_for_first_display.
Thanks all for the replies.
Edited by: nilanjana sinha on Feb 16, 2011 10:03 AM
‎2011 Feb 16 11:07 AM
Hi Please chech this blog by Uwe.
The same scenario is made so easy
link:[Against All Odds - Programming of Communicating (S)ALV Grid Controls|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/21504] [original link is broken] [original link is broken] [original link is broken];