Changing the behaviour of the GR_NON_VAL flag (SRM side)
You would like to know whether it is possible to influence the behaviour of the GR_NON_VAL flag on the SRM side. You have different ECC releases and you would like to develop your own logic only once (for all ECC releases), on the SRM side.
How to use the flag
It is not possible to use the flag this way. Whether the GR_NON_VAL flag is being updated or not, is controlled by the BAPI PO_ITEMX-GR_NON_VAL flag. This flag is blank (not updated) by default, as it is hard-coded in the ECC system. SRM will not have any chance to change the value until BBP_PO_INBOUND_BADI is reached in the ABAP code, which is already on the ECC side. So, the only way to control the scenario is to develop your own logic in the BBP_PO_INBOUND_BADI.