cancel
Showing results for 
Search instead for 
Did you mean: 

Validation for Purchase order field in BSP

former_member186472
Participant
0 Kudos

Hi Gurus, I am new to BSP. In my requirement I need to validate PO and display error message on same page.

I have a stand alone class where I have done the validations. My question is how can I combine these two and display error message in case of error.

Please suggest if any previous discussions are available on this, because I could not able to find any....

BR

Siva

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Siva,

There are may ways to achieve this, and all depends on how you are developing your bsp app, ie. MVC or HTMLB.

in most cases these days people now choose the MVC approach, and in this method there are 3 ways you can do your validation, and its good practice to use all 3.

1. HTML - Set the "max length" of field and make the field type "number". ie

              <input type="number" name="iEbeln" min="8" max="10">

    

2. Javascript - write a small function to validate your field ie;

                    var numbers = /^[0-9]+$/;

                    if(iEbeln.value.match(numbers)){

                       return true;

                    }

3. ABAP - on your call to get data based on PO, let the bapi or your background logic validate it.

Hope that helps..

Shaunny B

former_member186472
Participant
0 Kudos

Shaunny, thanks for your response...

I have used htmlb special event on input field keyup, to achieve server round trip from client. Now I am able to do the validation....

Best regards,

Siva

Former Member
0 Kudos

Great to hear. Shoot me a msg if you come across any more issues

Answers (0)