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

how to get error message in selection screen?

Former Member
0 Likes
588

in selection screen I need to enter correct value in country select options for that I have to enter us,uk or ind . when we enter other than these how to get error statement enter correct one?

1 ACCEPTED SOLUTION
Read only

dani_mn
Active Contributor
0 Likes
546

HI,

PARAMETERS: country(3).
AT SELECTION-SCREEN ON country.

IF country <> 'IND' AND country <> 'US' AND
 country <> 'UK'.
  
   MESSAGE e000(SU) WITH 'Enter correct country'.

ENDIF.

in selection screen I need to enter correct value in country select options for that I have to enter us,uk or ind . when we enter other than these how to get error statement enter correct one?

4 REPLIES 4
Read only

Former Member
0 Likes
546

use at selection screen on field.

for example

AT SELECTION-SCREEN ON country.

IF country-LOW NE ind *mention all youe conditions here

MESSAGE E000 'Use IND, US'.

ENDIF.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

Read only

Former Member
0 Likes
546

if s_contry ne 'ind'.

message i001(000) with 'enter valid value'.

there is no necessity of using the events .

it is best prectise to use validation in at selection-screen.

kishan negi

Read only

dani_mn
Active Contributor
0 Likes
547

HI,

PARAMETERS: country(3).
AT SELECTION-SCREEN ON country.

IF country <> 'IND' AND country <> 'US' AND
 country <> 'UK'.
  
   MESSAGE e000(SU) WITH 'Enter correct country'.

ENDIF.

Read only

Former Member
0 Likes
546

AT SELECTION-SCREEN ON S_PERNR

IF NOT S_PERNR IS INITIAL.

  • SELECT SINGLE PERNR

  • FROM PA0001

  • INTO PA0001-PERNR

  • WHERE PERNR IN S_PERNR.

  • IF SY-SUBRC NE 0.

  • MESSAGE E000(ZMESS).

  • ENDIF.

  • ENDIF.

do above code

double click ZMESS it will take to messages(se91) and there u give whatever message u want.