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: 

Error message in Selection Screen

Former Member
0 Kudos

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

former_member188827
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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

former_member156446
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

at selection-screen.

if p_ref ca '\' or

ca '/'...

message e(000).

endif.

regards

sunil kumar mutyala

former_member188827
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Clemenss
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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