on 05-11-2011 4:06 PM
hi All,
I am using belpow code to get entity . but get_root_entity method is causing a save to happend. any idea to restict that
DATA: lr_core TYPE REF TO cl_crm_bol_core,
lv_OBJECT_ID TYPE CRMT_GENIL_OBJECT_ID.
lr_core = cl_crm_bol_core=>get_instance( ).
CALL METHOD lr_core->get_root_entity
EXPORTING
iv_object_name = cl_crm_uiu_mkttpm_constants=>gc_trade_obj
iv_object_guid = iv_guid
RECEIVING
rv_result = ev_tpm_entity.
Above code in in BADI
Hi,
Reading an entity would never cause a save. Some of the methods internally can call Modify but that would also not result in save unless we do transaction->save() and transaction->commit() explicitly.
Thanks,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was also under same impression but thats happening somehow.
the scenario is after reading entity i have some validations and then if validations fails i raise error in the BADI. but even after raising error data is getting saved . when i commented get_root_entity and raised error , data doenot get saved . i tried various combinations and then concluded this .
is there any other way to get entity or any way to stop the save .
BADI NAme - CRM_MKTPL_OL_OBJ
method check before save .
there is plenty of code in badi. so i am just writing the sequesnce
lr_core = cl_crm_bol_core=>get_instance( ).
CALL METHOD lr_core->get_root_entity
EXPORTING
iv_object_name = cl_crm_uiu_mkttpm_constants=>gc_trade_obj
iv_object_guid = iv_guid
RECEIVING
rv_result = ev_tpm_entity.
after that there are validations on entity. if validation fails message table gets populated and flag ev_reject_save = abap_true. ev_reject_save is parameter in badi method to discontinue save.
before getting core and entity there are some validation which works fine .
Hi,
Can you check where is the code getting called from. I am not sure about the marketing scenario, but in sales scenario - ORDER_SAVE badi which does similar to thing - that is stop from save. It gets called from the API/function module that is CRM_ORDER_SAVE.
If that is the case here as well, I am assuming reading from bol core would interfere in someway. Can you please check where exactly in the code is this badi getting called from.
Thanks,
Rohit
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
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.