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
i. 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.
ii. 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)
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
i. 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.
ii. 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)
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.
No comments:
Post a Comment