Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

When use consistency validation check in BOPF, how to prevent the data being saved?

Former Member

Hello,

When use consistency validation check in BOPF, how to prevent the data being saved?

In help document link:Validation - Business Object Metadata Model - SAP Library

if there are inconsistent node instances, a consistency validation behaves in one of the following ways:

  • The validation sends messages to the consumer
  • The validation sends messages to the consumer and prevents the transaction from being saved until the inconsistency is corrected
  • The validation sends messages to the consumer and changes the consistency status.

I created a test class, but the data still be saved as the first way. How to implement the class like the second way?

Thank you.

1 ACCEPTED SOLUTION

victor_ionescu
Explorer

Hi Kenny,

you can select one of the three options mentioned by you when creating the validation via the wizard in BOB transaction. If you use BOBX or other "advanced" transactions, make sure that you also define a consistency group and assign your validation to it, only then is saving prevented.

Best regards

Victor

3 REPLIES 3

cyclingfisch_
Active Contributor
0 Kudos

Hi Kenny,

did you fill the exporting table et_failed_keys with the key of the failed instance?

Cheers,

Martin

victor_ionescu
Explorer

Hi Kenny,

you can select one of the three options mentioned by you when creating the validation via the wizard in BOB transaction. If you use BOBX or other "advanced" transactions, make sure that you also define a consistency group and assign your validation to it, only then is saving prevented.

Best regards

Victor

0 Kudos

Hi Victor,

  Thank you, it works.

Best regards,

Kenny