SAP Knowledge Base Article - Public

3774659 - Purchase order allows a plant which is not assigned to the company code

Symptom

When creating a purchase order, the system allows a plant that is not assigned to the company code entered. 
Related checks show messages for the assignment of the Purchase Org to the Company Code and the assignment of the Plant to the Purchase Org.

Environment

SAP S/4HANA Cloud Public Edition

Reproducing the Issue

  1. Open the Create Purchase Order advanced app (ME21n).
  2. Enter a company code in the PO header.
  3. Enter a purchasing organization that is valid for the scenario.
  4. At the item level, enter a plant that is not assigned to the company code of the PO header.
  5. Observe that the PO can be created/saved without any plant-to-company code validation message.

Cause

Standard system behavior

Resolution

  1. Set system message 06 167 (“Please only use plants with company code &”) as an Error via configuration node “Define Attributes of System Messages” (SSCUI 102364).
  2. The cloud BAdIs MM_PUR_S4_PO_MODIFY_ITEM or BD_MMPUR_FINAL_CHECK_PO are available to add a custom validation, CDS view 'I_ValuationArea' is available to derive the plant–company code relationship.

See Also

Keywords

purchase order, plant not assigned to company code, cross-company plant, 06167, ME004, MEPO038, sscui 102364, me21n, mepo038, me004, organizational assignment, validation, i_valuationarea, badi mm_pur_s4_po_modify_item, bd_mmpur_final_check_po, MEX_CHECK_COMPANY_CODE_ALLOWED, MEX_CHECK_WERKS, LMEPOF00, MEPO_HEADER_CHECK_NEU, T024W, T024E , KBA , MM-PUR-PO-2CL , Purchase Orders (Public Cloud) , MM-FIO-PUR-PO-2CL , Fiori UI for Purchase Orders (Public Cloud) , Problem

Product

SAP S/4HANA Cloud Public Edition all versions