MDG CR context API的用法

背景

实施BADI USMD_RULE_SERVICE进行实体数据校验时,需要判断当前的CR type以及CR step,严格控制增强生效的条件。

源代码

  method if_ex_usmd_rule_service~check_entity.
  
    if io_model is initial
    or io_model->d_usmd_model <> if_mdg_bp_constants=>gc_bp_model.
      return.
    endif.
    data(lo_usmd_app_context) = cl_usmd_app_context=>get_context( ).
    
    if lo_usmd_app_context is initial.
      return.
    endif.
    
    lo_usmd_app_context->get_attributes( 
    importing 
    	ev_crequest_type = data(lv_crequest_type) ).
     if lv_crequest_type <> lc_crequest_type.
       return.
     endif.

    lo_usmd_app_context->get_attributes( 
    importing 
    	ev_crequest_step = data(lv_crequest_step) ).
    	
    if  lv_crequest_step <> lc_crequest_step_final
    	and lv_crequest_step <> lc_crequest_step_proc.
    	return.
    endif.
  endmethod.

猜你喜欢

转载自blog.csdn.net/u012232542/article/details/111358155
CR
今日推荐