Skip to Content
Technical Articles

SAP MDG- Entity data specific to current Change request.

Table of Contents

  1. Introduction
  2. Overview
  3. Scenario
  4. Solution
  5. Conclusion

 

  1. Introduction – The purpose of this document is to explain If the material is processed under 2 change request i.e Parallel Processing, then we need to bifurcate data specific to each CR.
  2. Overview – In Parallel Process we can have the same material in multiple active CR. For example, a material can be requested for an extension for 2 different Plant in two separate CR. So while processing the first CR one should not execute any action on data which is from the second CR.
  3. Scenario
    1. A Material M1 is already extended to 5 Plants and now CR is to extend it on 6th plant, In this case, validation or any action should only happen on the 6th Plant.
    2. A Material M1 is requested for an extension to Plant P1 in CR1 and also P2 in CR2

Eg : Material is extended to DE plant in CR1(24826) and PH plant in CR2(24830)

 

On fetching data for validating we will get Plant from both CR.

Let see in the example.

If we process CR 24826 which have only DE Plant

In the backend, we will get the site from Other active CR too.

Checking in debugging mode

So If we get any validation error on site/Plants which is not in the processing CR then it will cause roadblock and CR can’t be processed further.

 

4.Solution

When we fetch the CR data using ‘IF_USMD_MODEL_EXT->read_entity_data_all’, Post that we need to filter out data from other CR.

 

To find if Entity data is in processing CR we need to use if_usmd_cr_changelist->is_entity_assigned

 

Use below Code.:

DATA : l_changelist TYPE REF TO if_usmd_cr_changelist.

l_changelist = cl_usmd_cr_changelist=>get_instance( iv_crequest_id = CR_Number “ (eg: 24826)

iv_model       =  ‘MM’ ).

Loop for MARC*/MBEW*/MVKE* 

If  l_changelist->is_entity_assigned( iv_entity_type = “MARC*/MBEW*/MVKE* “

                                       is_entity_key  = <fs_entity> ) = abap_false.   “ <fs_entity> = workarea of entity

DELETE <fs_entity>. 

ENDIF.

Endloop.

 

In the below screenshot we can see the final outcome is only Plants/SalesOrg etc which are relevant to processing CR.

 

 

Note: Solution has removed sites that are from other CR + Which are already extended in ECC. So the custom solution should work on relevant data.

 

5.Conclusion

The above methodology/Code will help you to filter out data from other CR and save from common issue in parallel processing.

 

Thanks.

4 Comments
You must be Logged on to comment or reply to a post.