cancel
Showing results for 
Search instead for 
Did you mean: 

database table not getting updated

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Ravi,

Sorry for the delayed response!

Please check the Delivery Maintenance of the table. Set the Databrowser/Table maintenance as: "X Display/Maintenance allowed".

In the normal scenarios it should work fine, and the same req. i had earlier and it was working fine.

Regards,

Shashikanth. D

Answers (1)

Answers (1)

Former Member
0 Kudos

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