Application Development and Automation 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: 
Read only

Error message in Selection Screen

Former Member
0 Likes
3,908

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

1 ACCEPTED SOLUTION
Read only

former_member188827
Active Contributor
0 Likes
1,714

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

11 REPLIES 11
Read only

Former Member
0 Likes
1,714

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

Read only

0 Likes
1,714

it is not standard program. I want to validate this in Zprogram only

Read only

0 Likes
1,714

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

Read only

0 Likes
1,714

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*********************&

Read only

former_member156446
Active Contributor
0 Likes
1,714

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.

Read only

Former Member
0 Likes
1,714

at selection-screen.

if p_ref ca '\' or

ca '/'...

message e(000).

endif.

regards

sunil kumar mutyala

Read only

former_member188827
Active Contributor
0 Likes
1,715

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

Read only

Former Member
0 Likes
1,714

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.

Read only

Former Member
0 Likes
1,714

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.

Read only

Clemenss
Active Contributor
0 Likes
1,714

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

Read only

Former Member
0 Likes
1,714

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