‎2012 Aug 13 1:41 PM
Hi All,
I am currently having a program which calls a screen and displays the data in an ALV table of type 'cl_gui_alv_grid' in a custom control. Now once the user selects some rows in this table and presses the enter key. It should get the selected rows from the table and the data selected should be brought back to the previous screen and displayed there.
In order to get the selected rows i understand that I should get them using the method CL_GUI_ALV_GRID->ET_SELECTED_ROWS. Now once I get the selected data in PAI, should I use the ABAP memory to transfer it between screens or can i use some variable which is in scope of both the screens and the program? The input / output tick boxes in the 'Element List' are disabled as this is a Custom Control on screen.
What would be the best way of transferring the data between the screen and original screen and displaying it to the user on the original screen? Please suggest.
Thanks,
Suresh.
‎2012 Aug 13 2:26 PM
Hi Suresh,
I think , later one is much efficient than former one. Because passing data explicitely using abap memory (export/import command) is unnecessary stuff which is not in later case. In this we are sharing the data in variables. No need of exporting and importing data to abap memory.
Thanks
Santosh
‎2012 Aug 13 2:32 PM
Hello Suresh,
I would suggest, that you implement a MVC-Pattern to handle the communication between the screens.
E.g. one class-instance controls the ALV-Grid, another class instance handles another screen. The data between those screens will be shared through a model-class.
Some kind of documentation: http://wiki.sdn.sap.com/wiki/display/ABAP/ABAP+Objects+Design+Patterns+-+Model+View+Controller+%28MV...
Or here:
http://scn.sap.com/thread/2094078
Kind regards,
Hendrik
‎2012 Aug 13 3:27 PM
Hi Suresh
If your "Selected Rows" table is globally defined you should be able to call it in both screens as long as the screens are within the same program, there is no need to export the data to memory.
Regards
Vic