Skip to Content
Technical Articles
Author's profile photo Saurabh Srivastava

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.

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Peranandam Chinnathambi
      Peranandam Chinnathambi

      Hello,

      No need to do all workaround to get object list of perticuler CR. Use GOV API CL_USMD_GOV_API>READ_ENTITY() or get_crequest_data(). Otherwise use Read API

      Author's profile photo Debasish Shukla
      Debasish Shukla

      Hi Saurabh,

      How System is allowing to create multiple change requests for one Material at the same time? 

      Thank you.

      Debasish

       

      Author's profile photo Saurabh Srivastava
      Saurabh Srivastava
      Blog Post Author

      Hi Debasish,

      While creating CR type in MDGIMG there is one column of checkbox 'Parallel Processing'.

      When we check the Parallel Processing option then we can create multiple CR for same material.

      Hope i answered your query.

       

      Author's profile photo Debasish Shukla
      Debasish Shukla

      Thanks Saurabh for your quick turnaround.

      Author's profile photo S D
      S D

      Thnks for such a wonderful post. Would you kindly explain howto find the enhancement in the backend for the code ?

       

      Regards,

      Sanjay