on 12-31-2013 10:27 AM
Hi All Expert,
I created an own model. it works fine when i create a new entity from UI. But when i edit a exist entity, when i try save my changes i call
lr_tx ?= lr_entity->get_transaction( ).
lr_tx->check_save_needed( ) eq abap_true.
lr_tx->check_save_needed do not return true even there is real change to entity.
I debugged it and found it try to get result from following code. in create mode, it return true. but in change mode it is not true.
rv_result = me->my_manager_entry->data_changed.
any hints will be highly appreicated.
Hello Joshua,
firstly check entity is locked or not.
check lr_entity->lock()= abap_true.
then after making change and setting some value, call
lr_core->modify().
then write below code:--
data: lr_tx type ref to if_bol_transaction_context.
lr_tx = lr_entity->get_transaction( ).
check lr_tx->check_save_needed( ) eq abap_true.
check lr_tx->check_save_possible( ) eq abap_true.
if lr_tx->save( ) = abap_true.
lr_tx->commit( ).
else.
lr_tx->rollback( ).
endif.
Thanks and Regards,
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joshua,
You need to lock entity,
if entity is locked successfully,
make changes then use lr_core->modify( )
also check in genil modify( ) CT_CHANGED_OBJECTS Parameter shouldn't be blank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joshua,
Try with this
data: lo_core TYPE REF TO cl_crm_bol_core,
lo_tx TYPE REF TO if_bol_transaction_context.
*a Save changes
lo_tx = lo_order_entity->get_transaction( ).
lo_core = cl_crm_bol_core=>get_instance( ).
IF lo_core IS BOUND.
lo_core->modify( ).
ENDIF.
IF lo_tx->check_save_needed( ) EQ abap_true .
IF lo_tx->check_save_possible( ) EQ abap_true .
IF lo_tx->save( ) EQ abap_true.
lo_tx->commit( ).
EINDIF.
ENDIF.
ENDIF.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joshua,
Have you add lr_core->modify( ). before check if save is needed?.
Best regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.