on 08-30-2007 7:01 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
fyi, I'm doing this in web dynpro for ABAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.