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 for this at selection

Former Member
0 Likes
437

hi.

i want to throw thw error message if the user enters the value not valid for the zregion1 of zbwcntry

and user should be able to correct it before moving ahead.

Also,iis not a mandatory field,So if it is initial,it can b blank.

but if the input doesnot lie in the range,it should give error message.

please suggest the line of code and where it is to be added.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_REGN1-LOW.

SELECT LAND1

ZREGION1

FROM ZBWCNTRY

INTO CORRESPONDING FIELDS OF TABLE IT_ZBWCNTRY UP TO 1000 ROWS.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'ZREGION1'

  • PVALKEY = ' '

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

DYNPROFIELD = 'S_REGN1'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = IT_ZBWCNTRY

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_REGN1-HIGH.

SELECT LAND1

ZREGION1

FROM ZBWCNTRY

INTO CORRESPONDING FIELDS OF TABLE IT_ZBWCNTRY UP TO 1000 ROWS.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'ZREGION1'

  • PVALKEY = ' '

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

DYNPROFIELD = 'S_REGN1 '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = IT_ZBWCNTRY

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

2 REPLIES 2
Read only

Former Member
0 Likes
415

after executing the program u have to write the vaildation code . while selection u r not able to do

Regards,

ajay

Read only

Former Member
0 Likes
415

start-of-selection:

you can do validations for the input fields

check ur parameter value in table IT_ZBWCNTRY. if subrc fails MESSAGE...