‎2008 Oct 31 4:12 AM
I have field called Registratio No. in which i can enter only Numbers, '/ 'and ' *' apart from these 3 if i enter any other special characters it has to through a error message.
how to wite code for this.
I have given CHAR 16 for this field
Thanku
‎2008 Oct 31 4:38 AM
Hi Pranu,
You can proceed in the following way:
1. Declare are constant variable with those 3 special character.
DATA: LC_VAR TYPE STING VALUE '~!@#$%^&*()-+={}[]\|'.
2. From the Screen/UI in the PAI event, you have to write a module to check the syntax.
This is the code snippet:
if lv_value CA lc_var.
message s(messgae_no) Display like 'E'.
< Further Logic for error handling >
Endif.
You can put here any branching instruction by either call screen transaction or anything else.
Have a look at this Demo Code: DEMO_DYNPRO_FIELD_CHAIN
Hope this will help.
Samantak.
‎2008 Oct 31 4:38 AM
Hi Pranu,
You can proceed in the following way:
1. Declare are constant variable with those 3 special character.
DATA: LC_VAR TYPE STING VALUE '~!@#$%^&*()-+={}[]\|'.
2. From the Screen/UI in the PAI event, you have to write a module to check the syntax.
This is the code snippet:
if lv_value CA lc_var.
message s(messgae_no) Display like 'E'.
< Further Logic for error handling >
Endif.
You can put here any branching instruction by either call screen transaction or anything else.
Have a look at this Demo Code: DEMO_DYNPRO_FIELD_CHAIN
Hope this will help.
Samantak.
‎2008 Oct 31 6:55 AM
Hi ,
DATA: LC_VAR1 TYPE STRING VALUE ' -*/'.
if ZTAB2-REGNO NA lc_var1.
message E010(ZMSG) with 'Enter Valid Registration Number'.
Endif.
as pre the code u have given me it is accepting only if i enter any one of the special character i specified in the local variable.
but my requirement is it should not accept if i give any other special character apart from the characters i specified in the local variable.
it should accept me if i don't enter any special character also
PLZ help me my code is