Application Development and Automation 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: 
Read only

BOPF consistency validation problem

christian_hecht
Newcomer
0 Likes
2,651

Hello,

i have a problem with a consistency validation which is defined in my BOPF object for the root node.

In my BOPF object there is defined an alternative key, the business partner number. When creating a new a entry it must be checked that the alternative key is unique.


Therefore i defined a consistency validation and use the class  /BOBF/CL_LIB_V_ALTKEY which checks for duplicate alternative keys. As trigger conditions, create an change are checked  for this validation.

The validation is processed fine when i call the BOPF modify method directly from a ABAP report and i receive an error message. The validation also works when i call an action which is defined for the root node and i get an error message too.

But when i trigger the creation of an new entry via oData/Gateway Service, then in debugger i can see that the check class is processed also, but no error message is given to the UI and the save process is not avoided, so i have duplicate records in database afterwards.

It only works when i define an additional action validation on the node with same class /BOBF/CL_LIB_V_ALTKEY. But then, if the alternative key is unique, the validation is triggered twice because later on the consistency validation is also processed.

Maybe an error in the SADL create coding or i am missing something?

Best regards

Christian

1 REPLY 1
Read only

former_member190794
Active Participant
0 Likes
1,224

Hello Christian

I would expect that you receive the error message in both cases - if you modify the BO via report or if you modify the BO via SADL. So please open a ticket on BC-ESI-BOF for further clarification.

In general (and also the class documentation of the altkey validation describes it like that) I recommend to have the altkey validation configured as action validation on CREATE/UPDATE or on SAVE (for a late check execution). If you would configure it as just a consistency validation instead, it won't reject the modification, but only return messages.

Best regards

Tilmann