cancel
Showing results for 
Search instead for 
Did you mean: 

Append Values in context

Former Member
0 Kudos

Hi Experts,

I am new to webdynpro ABAP and i m facing a problem please help me

What i am doing is.. taking values in first view in input fields

and displaying the same values in second view in table.

now when i navigate to the first view again and insert new values then i want to append the second set of values to the table in second view.

Kindly address the solution asap

Thanks in advance

Regards

Rajat

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Rajat,

You should have 2 nodes with the same structure to do this. First node (Node A) is Cardinality 1..1, second node (Node B) is cardinality 0..n.

1. Bind the attributes of Node A to you input fields on the first view.

2. Bind Node B to the table in the second view.

3. Create a Internal Table with the same structure as your Nodes.

4. When navigating to the second view, get the attributes of Node A. Append them to your internal table created at point 3.

5. Bind the internal table to Node B. (method bind_table( ). )

This should work.

Please let me know if you need more information.

Regards,

Roelof

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Rajat,

You can indeed use the method mentioned by Alex Justin.

You can also create the internal table in your componentcontroller or view (attribute tab).

Regards,

Roelof

Former Member
0 Kudos

i got the point..

but where i define my internal table.

because it will be called again n again when i press the save button.

then it will also get initialized..

Former Member
0 Kudos

hi rajat.......

you wii be having a common node....

so once you press the save button,

in the onaction of save button, read the node into an internal table and process it and bind it back again.

--regards,

alex b justin

Former Member
0 Kudos

hi rajat........

consider you are havin two input fields i1 nad i2 bound to context c1 and c2.

read c1 and c2 to variables v1 and v2.

let table be the node.

every time you press the save button, read the node using method get_static_attributes_table.

let the internal table be i1 which has values name1 and name 2.

now

w1 be th work area.

w1-name1 = v1.

w1-name2 = v2.

append w1 to i1.

bind it again to the node using bind_table method.

it works.

---regards,

alex b justin