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: 

Alphanumeric Condition on a field

Former Member
0 Kudos

Hello Everyone,

In my Webdynpro Application, I need to include some validation on a Order Number field. The conditions that need to be set on the Order Number are

The first character should be an Alphabet and the rest should be numbers.......

Is it possible to put these conditions. I hope you can understand my requirements. Please let me know if it is not clear.

Regards,

Gopal.

1 ACCEPTED SOLUTION

former_member1245113
Active Contributor
0 Kudos

Hi

First get the value using GET_ATTRIBUTE. once the value is available in you method, it is same as normal ABAP.

data : first type c.

first = vbeln0+(1).

now validate the value in First. whether it holds Alphabet or not.

then pass it back using SET_ATTRIBUTE

Cheers

Ram

3 REPLIES 3

former_member1245113
Active Contributor
0 Kudos

Hi

First get the value using GET_ATTRIBUTE. once the value is available in you method, it is same as normal ABAP.

data : first type c.

first = vbeln0+(1).

now validate the value in First. whether it holds Alphabet or not.

then pass it back using SET_ATTRIBUTE

Cheers

Ram

0 Kudos

Hi Ram,

Thanks a lot for your reply. I am new to ABAP. So, I really dont know how to do this in ABAP. Could you please help me by giving the code to this requirement. I would greatly appreciate your help.

Regards,

Gopal.

0 Kudos

hi,

Please have a look at the sample code and try to implement in your case.



data : v_char(10) type c,  "ORDER NUMBER
       v_char1(1) type c,
       v_char2(9) type c.

v_char = 'A123456789'.

V_CHAR1 = V_CHAR+0(1).
V_CHAR2 = V_CHAR+1(9).

IF V_CHAR1 CO 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' AND V_CHAR2 CO '0123456789'.
*V_CHAR IS VALID.
WRITE 😕 V_CHAR, V_CHAR1, V_CHAR2.
ELSE.
*V_CHAR IS INVALID.
ENDIF.

Regards,

Nagaraj