cancel
Showing results for 
Search instead for 
Did you mean: 

Data transfer between 2 table views

Former Member
0 Kudos

Dear Gurus

Here is my scenario.

I need to transfer data between 2 table views (Both these table views are having only column). These 2 tables are present in separate views (under same viewset).

Now initially I need to display some data in one of the tables when I display the screen for the first time (this I was able to achieve). Now if I double-click on any row of this table, I need to move the data present in that particular row to a different table present in the same screen.

Here is what I have achieved.

1) When I click on any row, I was able to capture the row index and the corresponding data in that row.

I put some code in the method EH_ONSELECT (present in the event handler) to get this working.

Now my question is

How can I move this captured data into a different table view?

I tried investigating on some of the methods such as do_prepare_output. But I am left with no clue on what coding needs to be done here.

Any help will be greatly appreciated.

Thanks

Raj

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Raj,

Basically you need to make use of a custom controller context node by binding context node of view1 to it.

Now at view2 you need to make use of this custom controller context node again and populate view2 context node with the selected entries (marked entries on view1).

Check this link for Custom Controller binding. You can do it similarly.

You need to take due care of performance,depending the amount of data you are going to handle.

Regards,

Masood Imrani S.

Former Member
0 Kudos

Hi Masood

I really appreciate your prompt reply.

I had a couple of questions. Hope you will throw some light on these.

1) In which method (in the IMPL class) in the second view do we need to call this custom controller (I have seen the coding provided by you required for calling a custom controller in a different thread, but it doesn't say where we need to place this code).

2) How can we capture the selected row in the custom controller ?(currently I was able to capture this selected row by putting some code in the EH_ONSELECT method). Could you plz tell me how to do this in the custom controller?

Once again thank u very much for your time.

Thanks

Raj

Former Member
0 Kudos

Hi Raj,

You can write the code in methods like DO_PREPARE_OUTPUT, but need to take adequate care of perfrormance as this method gets triggered for all server events.

If you can identify any other method on the second view at an instance when you select rows on view1..

that too is fine.

You can get the selected entries from a context node collection wrapper method...

DATA: lr_marked_line TYPE REF TO if_bol_bo_col.
* Get the lines selected by the user
  lr_marked_line = me->typed_context->productcategory->collection_wrapper->get_marked( ).

You can do a work around this way too...create an internal table attribute in the IMPL class of Custom Controller...Update it with the selceted rows in view1.

Populate view2 with the values in this table by accessing them from Custom Controller.

Code can be in DO_PREPARE_OUTPUT or some method that triggers at the point you select values in first row.

Regards,

Masood Imrani S.

Former Member
0 Kudos

Hi Masood

Thats excellent.... I really appreciate the way you are responding to my queries.

I will try the solution u suggested and will keep u posted on the progress. Untill then, I am going to keep my thread unaswered.

Thanks again.

Raj

Answers (0)