Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Transfer data from screen

Former Member
0 Likes
963

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.

3 REPLIES 3
Read only

Former Member
0 Likes
699

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

Read only

hendrik_brandes
Contributor
0 Likes
699

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

Read only

Former Member
0 Likes
699

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