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

selection screen error message

sridhar_muthekepalli3
Active Contributor
0 Likes
4,230

Dear friends:

I have a report.In the selection screen,In the sales group field , I should enter only C01 , If i give C02 or other input, the system should show a error message. Please help me with sample & simple code, because i am a functional consultant.

Thanks&Regards

MSReddy

11 REPLIES 11
Read only

Former Member
0 Likes
1,312

Hello,

Do like this:


AT SELCTION-SCREEN ON P_VKGRP.
IF P_VKGRP NE 'C01'.
ERROR MESSAGE.
ENDIF.

If useful reward.

Vasanth

Read only

Former Member
0 Likes
1,312

Hi Sridhar ,

Here is the sample code for the same

If the selection screen feild name is p_VKGRP.

AT SELECTION-SCREEN.

IF P_VKGRP NE 'C01'.

MESSAGE E001.

ENDIF.

Here E001 is the error message you want to diaplay.

Regards

Arun

  • Assign points if helpful

Read only

Former Member
0 Likes
1,312

AT SELECTION-SCREEN.

If p_sgroup ne 'C01'.

Message e000(zz) with 'Please Enter C01'.

endif.

Read only

Former Member
0 Likes
1,312

hi,

AT SELCTION-SCREEN ON P_SALGRP.

IF P_SALGRP NE 'C01'.

MESSAGE E001(MESSAGE CLASS).

ENDIF.

Read only

Former Member
0 Likes
1,312

hi sridhar,

write this code,

at selection-screen output.

if parameter NE 'CO1'.

message e001(message class)."sales group should be co1.

exit.

endif.

reward points if helpful.

regards,

seshu.

Read only

Former Member
0 Likes
1,312

Hi,

at selection-screen output.

loop at screen.

if screen-name eq 'S_SALES'.

if S_slaes NE 'C01'.

message e001.

endif.

endif.

and you have to create one text element by double clickling on e001. you can give messge you want to display there.

regards,

Ruchika

reward if useful..............

Read only

Former Member
0 Likes
1,312

hi,

we can write logic for that one in

data: var type <sales group field>  value C01.
at selection-screen.
if var ne <sales group field>.
**here write error message using write statement
endif.

regards,

AshokReddy.

Read only

Former Member
0 Likes
1,312

hi,

u have to write all your validations at AT SELECTION-SCREEN event.

u can valdate a single field or no.of. fileds based on your requirement.

parameters: p_group like [salesgroup name].

AT selection-screen. [ for no of fields]

if p_group NE 'C01'.

message E000 with 'NTER ONLY C01 materials'.

endif.

for single field in selection screen then

AT selection-screen on fldname. [ for single field]

if p_group NE 'C01'.

message E000 with 'NTER ONLY C01 materials'.

endif.

if helpful reward soem points.

with regards,

suersh.

Read only

Former Member
0 Likes
1,312

parameters : p_vkorg like vbak-vkorg.

at selection-screen.

if p_vkorg ne 'C01'.

message 'Please enter C01 in sales org' type 'E'.

endif.

strat-of-selection.

regards

shiba dutta

Read only

former_member196280
Active Contributor
0 Likes
1,312

AT SELCTION-SCREEN ON <FIeld name>.

  • i.e in which field you are entering C01

IF <FIeld name> NE 'C01'.

MESSAGE E000(MU) WITH 'Sales group cannot be other than C01'..

ENDIF.

Write the above code before start-of-selection in your program

Reward points if useful.. If not send you code I will modify and send it back to you.

Regards,

Sairam

Read only

sridhar_muthekepalli3
Active Contributor
0 Likes
1,312

thanks for the answers