Override custom validation through SAP BAPI

Hi Experts,
Is there any way to override any custom validation through BAPI_SALESORDER_CHANGE or BAPI_SALESORDER_CREATEFROMDAT2 ?

Currently, my script runs well if the custom validations in SAP are not triggered.
Through UI Automation, we can override the custom validations or pop-ups.

What entries should be set in BAPIs to override the pop-ups as we do not want to go incorporate UI Automation.

Appreciate your time and guidance.

Regards
Mwgha

Hi @MegTh,

It is generally not recommended to override custom validations in SAP as they are in place to ensure data integrity and accuracy. However, if you still wish to proceed, you can try passing the parameter NO_DIALOG with the value X to the BAPI function modules BAPI_SALESORDER_CHANGE or BAPI_SALESORDER_CREATEFROMDAT2. This parameter is used to suppress any dialog boxes or pop-ups that may appear during the execution of the function module.

For example, you can try adding the following parameter to your BAPI function call:

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2' EXPORTING salesdocument = ls_salesdocument ... no_dialog = 'X' IMPORTING ... TABLES ... EXCEPTIONS ...

Please note that overriding custom validations can have unintended consequences and it is important to thoroughly test the impact of such changes before implementing them in a production environment.

Thank you for your time Abhimanyu.
I do not see any attribute while executing, do I need to create another program with this condition? Or “no_dialog = ‘X’” can be passed as an extension object?

What am I trying to achieve that assume there is an system pop-up confirming an message my order change/creation should still proceed.

If I use standard FM the change/creation fails.

image

@gabi_verzea @ordo
Hi Experts, Appreciate your time and feedback.

Regards
Megha

Hi All, Is there any other way to achieve this?
I came across a suggestion to use a BAPI wrapper program to suppress pop-up