on 02-06-2009 3:58 PM
Hello Gurus,
i have used the following code for updating the table contents to database table,but the database table is not getting updated...
DATA lo_nd_n2 TYPE REF TO if_wd_context_node.
DATA lo_el_n2 TYPE REF TO if_wd_context_element.
DATA ls_n2 TYPE wd_this->element_n2.
DATA IT_N2 TYPE STANDARD TABLE OF /BI0/PCS_UNIT.
navigate from <CONTEXT> to <N2> via lead selection
lo_nd_n2 = wd_context->get_child_node( name = wd_this->wdctx_n2 ).
get element via lead selection
lo_el_n2 = lo_nd_n2->get_element( ).
get all declared attributes
lo_el_n2->get_static_attributes(
IMPORTING
static_attributes = ls_n2 ).
CALL METHOD LO_ND_N2->GET_STATIC_ATTRIBUTES_TABLE
IMPORTING
TABLE = IT_N2.
MODIFY /BI0/PCS_UNIT from table IT_N2.
Please help in solving this.
Regards,
Ravikanth
Hi Ravi,
Please check once whether you are having any entries in the internal table at all or not..
if yes, then check whether the UI element which you are displaying does contain any entries or not..
If that respective node doesnt contain any entry at all then internal table would be empty and u cannot modify the DB.
NOTE: simply changing the entries on the screen of the dynpro, does not guarantee that entries are modified in the DB.
You need to have some event handler like a button Click, etc, which updates the entries in the DB.
Regards,
Shashikanth. D
Edited by: Shashikanth Divakaruni on Feb 7, 2009 8:40 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi shashikanth,
I have a button named SAVE ,once the user modifies the data in the fields and clicks on SAVE the database shld get updated...
I have debugged the code written and mention above..The internal table is getting the current data present in the table UI element...
the final statement is updating the database which is not working in my case...
Please give ur valuable inputs..
Thank you
Ravikanth
Two things
1st Call Commit. after you are done updating.
2nd Try using the Field-Symbols & update the target table within the loop.
Cheers
Prashant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.