2008 Jun 17 6:54 AM
Hi
reference no (p_ref) is in my selection screen.
If this field contains special characters (\ / : * ? " |, ) system must prompt error message in selection screen. How to do this. Pls help me
Regards
Anbu
2008 Jun 17 7:03 AM
PARAMETERS:ref_no(10).
AT SELECTION-SCREEN OUTPUT.
if ref_no ca '\' or ref_no ca '/' or ref_no ca ':'.
MESSAGE 'error' TYPE 'E'.
endif.
plz reward points if dis helps
hi,
please go through the code.... it will help you.
data: str type string value '/\:";|?~`@#$%^&*()-_+=}{][''><'.
parameters: p_ref type char20.
at selection-screen.
if p_ref ca str.
message 'Cannot have special characters' Type 'E'.
endif.
start-of-selection.
write:/ p_ref.
Edited by: nitya sundar mohanty on Jun 17, 2008 11:57 AM
2008 Jun 17 6:57 AM
Hiiii...
If it is a standard program u have to copy the standard program to Z program and then only we have to make filed level validations.....
we cannot make any changes to the stadnard program even for the validations level .....
regards
chandu reddy
2008 Jun 17 6:59 AM
it is not standard program. I want to validate this in Zprogram only
2008 Jun 17 7:00 AM
after input form the user
use if condtion
and validate the field and through message.........
Reward IF........
Regards
Anbu
Edited by: Anbu B on Jun 17, 2008 8:04 AM
Edited by: Anbu B on Jun 17, 2008 8:06 AM
2008 Jun 17 7:04 AM
Hi anbalakshmi,
If you want to do a validation in the selection screen. then what you have to do is just to add validation at the selection screen event.
S_MATNR TYPE MARA-MATNR.
AT SELECTION-SCREEN.
If S_MATNR CA ' /\,-_ '.
Write: ' Please do not enter the special charater'.
Endif.
&***************Reward Point if helpful*********************&
2008 Jun 17 7:01 AM
concaternate all ur special characters into a string...
At selection-screen.
data: vl_string type string.
concaternate '/' ',' ';' into vl_string.
if p_ref CA vl_string.
message e001(MSGC).
endif.
2008 Jun 17 7:01 AM
at selection-screen.
if p_ref ca '\' or
ca '/'...
message e(000).
endif.
regards
sunil kumar mutyala
2008 Jun 17 7:03 AM
PARAMETERS:ref_no(10).
AT SELECTION-SCREEN OUTPUT.
if ref_no ca '\' or ref_no ca '/' or ref_no ca ':'.
MESSAGE 'error' TYPE 'E'.
endif.
plz reward points if dis helps
2008 Jun 17 7:08 AM
Try this program,........
PARAMETERS : p_ref TYPE string.
IF p_ref CP '\'.
MESSAGE 'Invalid Entry' TYPE 'S'.
ELSEIF p_ref CP '/'.
MESSAGE 'Invalid Entry' TYPE 'S'.
ELSEIF p_ref CP ':'.
MESSAGE 'Invalid Entry' TYPE 'S'.
ELSEIF p_ref CP '?'.
MESSAGE 'Invalid Entry' TYPE 'S'.
ELSEIF p_ref CP '"'.
MESSAGE 'Invalid Entry' TYPE 'S'.
ELSEIF p_ref CP '|'.
MESSAGE 'Invalid Entry' TYPE 'S'.
ELSEIF p_ref CO ','.
MESSAGE 'Invalid Entry' TYPE 'S'.
ELSE.
MESSAGE 'valid entry' TYPE 'S'.
ENDIF.
2008 Jun 17 7:09 AM
If u r working with a custom screen.In that case 1st populate a range table with all the special chars. like
r_char-sign = 'I'.
r_char-option = 'EQ'.
r_char-low = '/'.
append r_char.
now in 'at selection-screen' event validate ur selection screen field
p_ref.
if not p_ref is initial.
if p_ref in r_char[].
message e(XXX) with 'XXXXXXXXXXXX'.
endif.
endif.
2008 Jun 17 7:15 AM
Hi anbulakshmi arul,
AT SELECTION-SCREEN ON P_REF.
IF P_REF CA '(\ / : * ? " |, )'.
message E000(R1) with 'Do not use special characters'.
ENDIF.
Regards,
Clemens
2008 Jun 17 7:26 AM
hi,
please go through the code.... it will help you.
data: str type string value '/\:";|?~`@#$%^&*()-_+=}{][''><'.
parameters: p_ref type char20.
at selection-screen.
if p_ref ca str.
message 'Cannot have special characters' Type 'E'.
endif.
start-of-selection.
write:/ p_ref.
Edited by: nitya sundar mohanty on Jun 17, 2008 11:57 AM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |