cancel
Showing results for 
Search instead for 
Did you mean: 

CL_CRM_BOL_CORE

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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 .

Former Member
0 Kudos

Hi,

Can you mention the badi name please and paste the code here? That would help understand it better.

Thanks,

Rohit

Former Member
0 Kudos

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 .

Former Member
0 Kudos

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

Former Member
0 Kudos

solved.

the get entity method is creating a new entity in badi which is causing save to haapen. suggested practise is not to use these methods in badi ,