Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
vickyokrm
Participant

Here in this blog , i would like to share my experience with code values check provided by BOPF Framework, as we all know BOPF frame work enables developer to develop application in a unique approach.Of course it also provides with lot of  generic  features which makes developer life easy.similarly it provides generic way to validate BO Node field values against the value range in the data domain.Feeling happy in writing a blog for BOPF.  

BOPF provides the generic validation class /BOFU/CL_V_CODE_VALUES ,Which shall be  inherited in order to implement the validation check against the Domain value range for the BO node attribute.

As we can see this generic class implements /BOBF/IF_FRW_VALIDATION, So it is recommended to implement BOPF validation to the respective node by inheriting the class :wink: . and the method GET_VALIDATION_CONFIGURATION which is an abstract method need to be redefined.

Let me quickly take through 3 easy steps on how to implement the validation.

Creating Action validation :


     i have created a action validation for the node 'PR_ITEM' , it is been modeled  to trigger the validation on the instance update of the node PR_ITEM.


Implement GET_VALIDATION_CONFIGURATION :


          Now lets implement the abstract method GET_VALIDATION_CONFIGURATION, this methods keeps track of the information of the node attributes to which the field value are to be validated. i do some dirty coding some times :wink: .Here we bind the node attribute and the data domain object of the node attribute and give it back to the validation. Note: Data Domain is mandatory for the node attribute in order to perform this validation ,also i have tried only with the fixed value range of the domain but not with the domain value table.

     In the above image i have defined the 'MAT_TYPE' and Domain 'ZMAT_TYPE' , so when ever the field MAT_TYPE is provided with the values which is not maintained in the Domain values , BOPF will not allow the instance to update.


Testing:


          So finally we have implemented code values check to a node attribute let test the application on the test ui and we will how BOPF reacts to it.

In the below image ,Attribute MAT_TYPE has 4 possible values in domain fixed values.

and when we try to input some other values rather than the possible 4 entries , validation stops the instance update process with error message as shown in below snip.

Conclusion:

          So  the code values check helps in validation of the node attribute with quick and easy implementation with generic implementation,Thanks for reading and am not so expertise in writing a blog but i think this blog at least  give some overview knowledge in BOPF code values check.Like wise BOPF provides other lot of features which definitely helps in developer.so let me come up with some other new BOPF topic on my next blog,Happy Blogging !!!. :smile:


7 Comments
vickyokrm
Participant
0 Kudos

I would be so delighted to get comments and feedback.

former_member182889
Active Participant
0 Kudos

Nice description of a good example for re-use in BOPF. The BOPF re-usables provide some more generic features as library classes which you may want to explore.

Oliver

P.s.: If you trigger a validation on update, it should usually also be triggered on create, as also data can be provided with the create-call.

vickyokrm
Participant
0 Kudos

Yes Oliver ,exactly i should have also made the validation to be triggered on "Create" as well .

bharath_k6
Active Participant
0 Kudos

hI vigneswaran,

Appreciate your blogging on BOPF.

Expecting more such blogs from you.

Thanks,

Bharath.

former_member221498
Discoverer
0 Kudos

Hi vigneswaran,

Appreciate your blogging, its very helpful for my task. But i am stuck with 2 code value checks simultaneously.

Could you please help me out on this?

Thanks,

Vivek

Roman71
Explorer
0 Kudos

Hello Vigneshwaran,

nice blog, well done.

I have a case the validation class is not working (or I just think it is not working). I have domain "CALENDAR_WEEKS" for storing the calendar weeks a year can have. The Domain is a DEC(2). The possible value would be 52 and 53.

I have implemented the check class but I always get an error that my value is wrong no matter what I input.


Any idea on this?

Best regards


Roman

Former Member
0 Kudos
Hi Vigneshwaran,

 

Thank you so much for your sharing. 🙂