Wednesday
Hello everyone!
We have created two fields in header level in transaction ME21N(contract number and its date)
Abaper made these field required but the PO can still be saved without filling the z fields.
These fields should be mandatory at PO level, whithout filling these fields, system shouldn't allow the PO to be saved.
Can you please advise how to do this?
Request clarification before answering.
Dear @MukhammadAziz
The Z‑fields at the header level of ME21N (Purchase Order creation), but even though the ABAPer marked them as “required,” the PO can still be saved without values. That’s a common issue because simply setting the screen field as required in the screen painter or PBO logic doesn’t enforce the check at save/commit level.
Use BAdI ME_PROCESS_PO_CUST (Recommended)
This BAdI is specifically designed for custom validations in PO processing. Implement method PROCESS_HEADER or CHECK Read your Z‑fields from the header. If they are initial (empty), raise an error message (MESSAGE e...) so the PO cannot be saved. This ensures the system blocks SAVE until the fields are filled.
You can work with User Exit EXIT_SAPMM06E_012 (Include ZXM06U43)
This exit is triggered during PO checks. You can add similar validation logic here. Works, but less flexible and not as clean as the BAdI.
Hope above solutions will help you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 12 | |
| 10 | |
| 8 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.