TSOCM_CR_CONTEXT

One of the most important and at the same time one of the worst designed tables in ChaRM is TSOCM_CR_CONTEXT. This table is used to store cycle assignment of CR and CD. At the same time it is used to plan the scope of a CR. There is no proper API existing, there are a lot of code snippets which are manipulating or evaluating the entries of this table mostly without sense.

This blog should help you to understand this table from technical point of view.

Code snippets / Reference:

  • CL_IM_AI_CRM_COPY_BADI->IF_EX_CRM_COPY_BADI~ORDERADM_H
  • cl_al_crm_cm_utility=>get_sub_docs_4_cyc_by_cr_ctxt (SAP note 2592607)
  • cl_wdcm_extchreq_scoping_asst=>GET_CR_PROJECT_BY_FOLLOW_ON (SAP note 2581812)

API:

  • CL_AI_CRM_CM_CR_CONT_RUN_BTIL=>GET_CR_CONTEXT
  • cl_ai_crm_cm_cr_cont_run_btil=>update_cr_context
  • cl_wdcm_extchreq_scoping_asst=>read_context_db
  • cl_wdcm_extchreq_scoping_asst=>update_context_db
  • cl_aic_cm_scope_backend_api=>read
  • cl_aic_cm_scope_backend_api=>UPDATE
  • cl_aic_cm_scope_backend_api=>SAVE_INTO_DB

Header Context:

  • GUID: GUID of Transaction
  • ITEM_GUID: = GUID
  • CREATED_GUID: Empty for CR, = GUID for CD
  • CREATED_BY: Empty
  • CREATED_ON: Empty
  • PROCESS_TYPE: Process Type of Transaction (CR and CD)
  • IBASE: Empty
  • IBASE_INSTANCE: Empty
  • PRODUCT_ID: Empty
  • SID: Empty
  • MANDT: Empty
  • PROJECT_ID: Assigned change cycle (SM 7.0/7.1: ID of assigned Project)
  • SOLUTION_ID: Empty (SM 7.0/7.1: ID of assigned Solution)
  • SLAN_ID: Change Control landscape or Solution
  • SBRA_ID: Branche
  • APPR_RESULT: Empty
  • APPROVED: Empty
  • APPROVE_STATUS: Empty
  • OBJECT_ID_DESCR: Empty

Scope Context:

  • GUID: GUID of CR Transaction
  • ITEM_GUID: = Unique GUID (can be GUID of CD if scope context was created after CD creation)
  • CREATED_GUID: Empty if CD is not created yet, otherwise GUID of CD
  • CREATED_BY: Creator of CD (see CRMD_ORDERADM_H-CREATED_BY of CD)
  • CREATED_ON: Creation Timestamp (see CRMD_ORDERADM_H-CREATED_AT of CD)
  • PROCESS_TYPE: Process Type of CD Transaction (see CRMD_ORDERADM_H-PROCESS_TYPE of CD)
  • IBASE: Ibase (will be transferred to REFOBJ on CD creation)
  • IBASE_INSTANCE: IBase Instance (will be transferred to REFOBJ on CD creation)
  • PRODUCT_ID: Product ID of IBase Component
  • SID: System ID of IBase Component (if LMDB object)
  • MANDT: Client of IBase Component (if LMDB object)
  • PROJECT_ID: Assigned change cycle
  • SOLUTION_ID: Empty
  • SLAN_ID: Change Control landscape or Solution
  • SBRA_ID: Branche
  • APPR_RESULT: „A“ or „F“ for approved, „“ for unapproved
  • APPROVED: Empty
  • APPROVE_STATUS: Used to store user status of CR in case of scope extension process
  • OBJECT_ID_DESCR: Description of CD (see CRMD_ORDERADM_H-DESCRIPTION of CD)

How to get configuration item system data fresh from CR/CD (maybe to update TSOCM_CR_CONTEXT)?

Solution 1 (working for LMDB and CMDB objects but not for text components):

  1. cl_ai_crm_object_api=>get_object_id_from_order
  2. cl_hf_helper=>get_sys_data
  3. cl_hf_helper=>get_ibase_comp_4_product
  4. CRM_IBASE_COMP_GET_DETAIL

Solution 2 (working for text components as well):

  1. cl_hf_helper=>get_ibase_instance_of_chng_doc
  2. CRM_IBASE_COMP_GET_DETAIL
  3. Extract OBJECT_ID (not PRODUCT_ID!)
  4. cl_hf_helper=>get_sys_data

How to get transaction data (needed to build context entries)?

  • cl_hf_helper=>get_header_of_chng_doc
  • cl_hf_helper=>get_proc_type_of_chng_doc
  • cl_hf_helper=>get_predoc_of_chng_doc
  • cl_hf_helper=>get_sucdocs_of_chng_doc
  • cl_hf_helper=>get_bo_links_of_chng_doc (to get assigned cycle of CD)
  • cl_hf_helper=>get_bo_tasklist_of_chng_doc (to get assigned tasklist of CD)
  • cl_al_crm_cm_utility=>get_smi_project_by_tasklist (to get cycle id or SM 7.0/7.1 project id of task list)

 

Note: These information are taken from my ABAP report which was developed to create entries in TSOCM_CR_CONTEXT table for old SM 7.0/7.1 change transactions after upgrade to SM 7.2. These information are not sufficient to re-implement this report. However I hope it will help you to understand the technical dependencies.