on 03-03-2011 6:26 AM
Hi All,
I have two buttons, submit and save. in submit i am calling FM through service call to get data. data is coming correctly.
In save i am trying to save any changed data. but changed data is not saving, i checked through debug in table showing changed data, but in database it is not updating.
code i am using in SAVE button.
DATA lo_nd_it_vttk TYPE REF TO if_wd_context_node.
DATA lo_el_it_vttk TYPE REF TO if_wd_context_element.
DATA ls_it_vttk TYPE wd_this->Element_it_vttk.
DATA lt_it_vttk TYPE wd_this->Elements_it_vttk.
Data lt_it_vttk type STANDARD TABLE OF if_main=>Element_it_vttk.
DATA lt_it_vttk TYPE STANDARD TABLE OF vttk.
DATA wa_vttk TYPE vttk.
navigate from <CONTEXT> to <IT_VTTK> via lead selection
lo_nd_it_vttk = wd_context->path_get_node( path = `ZSHIPMENT_CHANGE.CHANGING.IT_VTTK` ).
get element via lead selection
lo_el_it_vttk = lo_nd_it_vttk->get_element( ).
get all declared attributes
lo_el_it_vttk->get_static_attributes(
IMPORTING
static_attributes = ls_it_vttk ).
******Changing DATA ************
WA_VTTK-EXTI1 = LS_IT_VTTK-EXTI1.
WA_VTTK-DTDIS = LS_IT_VTTK-DTDIS.
WA_VTTK-UZDIS = LS_IT_VTTK-UZDIS.
WA_VTTK-DPREG = LS_IT_VTTK-DPREG.
WA_VTTK-UPREG = LS_IT_VTTK-UPREG.
append WA_VTTK to lt_it_vttk .
MODIFIED DATA IS COMING TO lt_it_vttk TABLE. BUT NOT UPDATING DB
lock the table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'E'
TABNAME = 'VTTK'
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
MODIFY VTTK from table lt_it_vttk.
if sy-subrc is initial.
COMMIT WORK .
else.
ROLLBACK work.
endif.
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'E'
TABNAME = 'VTTK' .
In this i am missing anything? Please Help.
Thanks,
Madan.
I guess the problem is here.
******Changing DATA ************
WA_VTTK-EXTI1 = LS_IT_VTTK-EXTI1.
WA_VTTK-DTDIS = LS_IT_VTTK-DTDIS.
WA_VTTK-UZDIS = LS_IT_VTTK-UZDIS.
WA_VTTK-DPREG = LS_IT_VTTK-DPREG.
WA_VTTK-UPREG = LS_IT_VTTK-UPREG.
you are not passing any key fields value here.
i guess you need to pass the value of
WA_VTTK-TKNUM field also.
SO ADD
WA-VTTK-TKNUM = LS_IT_VTTK-TKNUM.
Thanks
sarbjeet singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Did you check sy-subrc value after the call tp FM 'ENQUEUE_E_TABLE' and after the Modify statement??
Is sy-subrc having 0?
Best Regards,
Srilatha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.