cancel
Showing results for 
Search instead for 
Did you mean: 

refresh the view and show value in table

former_member206441
Contributor
0 Kudos

Dear Experts,

Im using a view container ui element in a view(view1) to show another view(view2).

My problem is i placed a save button in view1 and table UI , input fields is displayed in view2,

when i give inputs and save, the data is stored in database sucessfully, what i want to do is to show the data in table UI which is given by the user, after hitting the save button.

any suggestions regarding this?

thanks in advance

Arun.P

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Arun ,

try to change the Lifetime of view1 and view2 into when visible instead of framework controlled under views property

rgds,

amit

former_member206441
Contributor
0 Kudos

Dear Experts

Thank You for the responses. My application is working now, by changing the life time property of the view suggested by

Amit.

Regards

Arun.P

Former Member
0 Kudos

Hi,

I feel this can be achieved using outbound and inbound plugs between both the views.

Kedar

Former Member
0 Kudos

hi,

What is the problem you are getting in this ?

1. Make an context node and put the attributes in it.

2. In layout, make in Table UI. Bind this table UI with Context node.

3. On the click of button, get the data in an internal table.

4. Bind the internal table with the Table UI.

select * from sflight into table itab.

DATA lo_nd_n2 TYPE REF TO if_wd_context_node.

lo_nd_n2 = wd_context->get_child_node( name = wd_this->wdctx_n2 ).

lo_nd_n2->bind_table( itab ).

n2 is my node created and binded with Table UI.

To get the values entered in Input field of View2 , map the attributes binded to Input field with component controller.

Now from comp controller, you can read the values of input field in View 1 also.

Edited by: Saurav Mago on Nov 12, 2009 11:11 AM

former_member206441
Contributor
0 Kudos

Hi Saurav

I already done what you have said, the data entered by the user is coming to internal table and passed into the node,

when the user presses save button every thing is working fine but the data is not showed in the table UI element.

when i refresh the page the data is shown in the table UI.

What im trying to do is after entering the data and press the save button the data must be shown in table UI.

Regards

Arun.P

Edited by: Arun Padmanaban on Nov 12, 2009 9:31 AM

Former Member
0 Kudos

Just before binding your node with new internal table values, invalidate first and then bind.

lo_nd->invalidate( ).

lo_nd->bind_table( itab ).

Also check before binding that you have reocrds in itab or not .

This should work. If not , plz paste your code here what you have written in OnAction of button.

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

when i give inputs and save, the data is stored in database sucessfully, what i want to do is to show the data in table UI which is given by the user, after hitting the save button.

since the data is saved succesfully in DB read the values again from DB and bind it back to the table again.

Priya

former_member206441
Contributor
0 Kudos

Hi Saurav

Even though i invalidate and append the itab values, the data is not shown in table IU element, i also tried by putting the code in domodify method still it is not working,

i want to know that any other way is there to show the values to table

Hi Priya

if i do the same application ie. table ui element, inputbox and save button in a single view it is working fine for me.

but for my requirement is to show the table and inputfield in one view and save button in another view,

im showing the table and inputfields(view2) through view container ui element in view1

and doing the operations but it is not woking.

Regards

Arun.P

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

The Save button and the table are in diff view .

When you click on save read the records from DB and store them at component controller level.

when you are binding the values in the second view for the table read the comp controller attribute and bind it to the table.

Priya

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

You can do in the following way:

1.Create a attribute in comp controller (Attributes Tab) .

2.on action of save fill this attribute.

select * from Z_table into corresponding fields of table wd_comp_controller->table.

3.in the second view bind the table to this attibute.

call METHOD lo_nd_sap_prj_experience->bind_table(

new_items = wd_comp_controller->table).

Priya

Former Member
0 Kudos

hi,

I dont know why it is not happening for you. Please check whether you are binding the correct node with the data.

It should work fine.

Could you paste the code you have written in OnAction of Save button.