2009 Oct 16 10:28 AM
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.
2009 Oct 16 10:45 AM
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
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.
2009 Oct 16 10:45 AM
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
2009 Oct 16 10:48 AM
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.
2009 Oct 16 11:33 AM
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
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |