cancel
Showing results for 
Search instead for 
Did you mean: 

Values for Context assignment

Former Member
0 Kudos

Hello,

I need some help in developing a webdynpro application. My scenario is as follows:-

How to assign values entered in inputfields to table rows at runtime? The total number of rows in the table will only be decided at runtime. Could you advise me of how to do this?

I would greatly appreciate your help.

Regards,

Gopal.

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

Hello Gopal,

Can you please elaborate up on your intended requirement? Is it something like you want to accept input from the user through input fields & then have this entered data appear within your table? Why dont you make things easier by designing the functionality in this way:

1) Create table with a toolbar button say "Add Row" up on pressing which the system would add an editable row to the table.

2) The user can now directly enter his data into this editable row. (You can also provide another toolbar button up on pressing which you save the entered data on to the database.)

Regards,

Uday

Former Member
0 Kudos

Hi Uday,

Thanks a lot for your reply. We are supposed to develop the application with as many less clicks as possible . So, giving the Add new row button is not an option for us. So, we are making use of the concept of "Context Log" and it is working fine.

I'll try to explain in more detail:-

I have a custom node in my context, which has 9 different attributes. I have to get these 9 values from the end user. But, 3 of the attributes should be filled in through inputfields and the rest of the 6 attributes should be filled through a table because the end-user should be able to enter multiple line items.

But, at runtime, when the users clicks the Button to execute the BAPI, the 3 attributes that are entered through inputfields should be assigned to every row of the table that the user is using. But, the values are getting added only to the first row of the table. Do you get what I am saying?

Please let me know if you need more clarification. Your help is very much appreciated.

Regards,

Gopal.

Former Member
0 Kudos

Hi,

Wat is the cardinality of the custom node..If is is 1:1 or 0:1 then only one record can be stored...

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

As I said, this node is bound to a table and so it's cardinality is 0..n. Even though this node is bound to a table among the 9 attributes, only 6 attributes are being filled in through the Table UI element. Rest of the 3 attributes are filled in through inputfield.

But at runtime, the values that are filled in inputfield should be assigned into every row that the 6 attributes are filled in. Do you understand what I mean. Let me know if you need more information.

Regards,

Gopal.

Former Member
0 Kudos

Hi,

Then you need to modify the table and bind the table again.

for ex: col1 col2 col3 are the inputs that needs to be applied for everyrow right,

Use the GET_ATTRIBUTES method of if_wd_context_node to get the input field values.

Loop at lt_table into ls_table.

ls_table-val1 = col1.
ls_table-val2 = col2.
ls_table-val3 = col3.

modify lt_table from ls_table index sy-tabix.
clear ls_table.


endloop.

Answers (0)