Hi Avi dey,
1. when get the related entity for 'BTOrder' and 'BTOrderHeader' bypass the BOL buffer by following code
lr_ent ?= lr_ent->get_related_entity( iv_relation_name = 'BTOrder'
iv_mode = cl_crm_bol_entity=>bypassing_buffer ).
lr_ent ?= lr_ent->get_related_entity( iv_relation_name = 'BTOrderHeader'
iv_mode = cl_crm_bol_entity=>bypassing_buffer ).
2. After the function module ‘CRM_DOC_FLOW_INIT_DB' call
put the following code to bypass the API layer.
CALL FUNCTION 'CRM_ORDERADM_H_INIT_EC'
EXPORTING
iv_header_guid = lv_order_guid
iv_init_whole_buffer = 'X'.
You will get the changes from the later session.This will solve your issue.
Regards,
Shan