cancel
Showing results for 
Search instead for 
Did you mean: 

Validating Custom Fields

Former Member
0 Kudos

Hi All,

I added 3 custom fields in the service order item shopping cart.

I am trying to validate those 3 fields.

I implemented the code in "BBP_DOC_CHECK_BADI" BADI.

The problem is the error is raised as soon as I enter the data and click on

" Add to Shopping Cart " button.

But I want the error to be raised once we enter something in the custom fields and click on Check button.

Appreciate any inputs.

Thanks,

Vinay

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

varma ,

as you understand the badi is hit several times, one of them being as u click on add to shopping cart.

one work around could be , find out the sy-ucomm value as u click 'check' and enclose ur validation under the if condition.

sy-ucomm should be something like 'DOC_CHK', but please confirm while debug.

Former Member
0 Kudos

Hi Alok,

Thanks for the suggestion.

Adding sy-ucomm to the if condition worked.

sy-ucomm = 'sc_check'.

Thanks,

Varma

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You need to write the code in the CHECK badi only to raise the error message on click of CHECK button.

Please refer the foll link for sample code for teh BADI;

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/srm/srmBADIRepository&

BR,

Disha.

Pls reward points for useful answers.