cancel
Showing results for 
Search instead for 
Did you mean: 

Table view ----check box

Former Member
0 Kudos

Hi Gurus,

I have a table view having check boxes. once the check boxes are checked and click on save, I wanted to save them in the corresponding table. How and what can I code in the 'save' event handler. Please suggest me.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello David!

There are two things here.

If you are talking about getting data in an internal table, then you do not have to worry much as you can just call the method get_static_attributes_table on the node which is bound to the Table UI Element on your View.

However, if you wish to get the data in a Dictionary Table, call get_static_attributes_table so that you get the the data in an internal table and then push this data onto your DDIC table.

Hope this helps.

Regards,

Neha

Former Member
0 Kudos

Hi Neha,

Can you please give me the code on how to get the particular row, on which the action is fired in the table view, into an internal table.

Thanks,

David.

Former Member
0 Kudos

Hello David,

To get the particular row for which the event is fired, firstly, look for the importing parameter WDEVENT in your action handler (of checkbox). Next, using this parameter, code in the following -

lo_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).

lo_element->get_static_attributes(

EXPORTING

static_attributes = ls_element ).

Here. lo_element is the element of node bound to your table and ls_element is the corresponding structure where you wish to get the data. Make sure that you do not change the parameter 'CONTEXT_ELEMENT'. This one goes as it is.

Hope this helps.

Regards,

Neha

Former Member
0 Kudos

Hi Neha,

Thanks for your quick reply. I would like to know how to get the data from ls_element to an internal table and then how to update from this internal table to dictionary table. Please give me the code.

Thanks,

David.

Former Member
0 Kudos

Hello David,

ls_element is a structure. If TAB is your ddic table, then you need to code something like this -

DATA lt_tab type tab.

DATA ls_tab like line of lt_tab.

move-corresponding ls_element to ls_tab.

INSERT INTO tab VALUES ls_tab.

However, if you want the whole table, you need to call get_static_attributes_table. This gives you an internal table. You can then do a move-corresponding for all rows of internal table -

loop at lt_element into ls_element.

clear ls_tab.

move-corresponding ls_element to ls_tab.

append ls_tab to lt_tab.

endloop.

INSERT tab FROM TABLE lt_tab.

So, all in all, it really depends on what you want to insert into the DB. Once you have that clear, after that they are just ABAP statements.

Hope this helps.

Regards,

Neha

Answers (1)

Answers (1)

Former Member
0 Kudos

fyi, I'm doing this in web dynpro for ABAP.

Former Member
0 Kudos

Pls be more detailed, what exactly do you want to save and which table.

Also give your architecture...that is what components u using, what embedded components etc....