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

value check in selection screen

Former Member
0 Likes
7,018

Dear Abapers,

i want to check value at selection screen , how to do this.

e.g. My selection screen contain matnr(select-option) and i want to check values of matnr from check table mara. also if the value is not in mara then i want to show error message .

pl suggest how to do this

Regards,

Kapil Soni

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,586

Hi..,

use the event AT SELECTION-SCREEN.

<b>report zprogram .

tables mara.

select-options s_matnr for mara-matnr.

AT SELECTION-SCREEN.

select single matnr from mara into mara-matnr where matnr in s_matnr.

if sy-subrc ne 0.

message 'Material doesnot exist' type 'E'.

endif.

START-OF-SELECTION.

........</b>

reward if it helps u..

sai ramesh

Message was edited by:

Sai ramesh

Dear Abapers,

i want to check value at selection screen , how to do this.

e.g. My selection screen contain matnr(select-option) and i want to check values of matnr from check table mara. also if the value is not in mara then i want to show error message .

pl suggest how to do this

Regards,

Kapil Soni

7 REPLIES 7
Read only

Former Member
0 Likes
2,587

Hi..,

use the event AT SELECTION-SCREEN.

<b>report zprogram .

tables mara.

select-options s_matnr for mara-matnr.

AT SELECTION-SCREEN.

select single matnr from mara into mara-matnr where matnr in s_matnr.

if sy-subrc ne 0.

message 'Material doesnot exist' type 'E'.

endif.

START-OF-SELECTION.

........</b>

reward if it helps u..

sai ramesh

Message was edited by:

Sai ramesh

Read only

Former Member
0 Likes
2,586

Hi Kapil,

You can use the AT SELECTION-SCREEN event.

The code will be as follows :

AT SELECTION-SCREEN ON <Material Field say P_MATNR>.

SELECT SINGLE * FROM MARA where MATNR = P_MATNR.

IF SY-SUBRC <> 0.

Error message.

ENDIF.

Regards,

Himanshu

Read only

Former Member
0 Likes
2,586

Hi,

  • Validation of material clear t001w.

if not s_matnr is initial.

select matnr from mara up to 1 rows

into mara-matnr

where matnr in s_matnr.

endselect.

if sy-subrc ne 0.

message e004. " Invalid Material Number

endif.

endif.

regards,

Anji

Read only

Former Member
0 Likes
2,586

hi,

do this way ..


at selection-screen.
if not s_matnr is initial.
  select single * from mara where matnr = s_matnr.
  if sy-subrc <> 0.
   message e000 with ' No material found for the selection criteria'.
  endif.
endif.

Regards,

Santosh

Read only

Former Member
0 Likes
2,586

at selection-screen on s_matnr.

select single matnr from mara where matnr = p_matnr.

if sy-subrc <> 0.

message e000(zz) with 'Enter another material number'.

endif.

regards,

keerthi

Read only

Former Member
0 Likes
2,586

Thanks ,

I know At selection-screen event where we can check validation. but in select-option there is one option like we can check value at select-option.

e.g. s_matnr for mara-matnr value-check.

like this there is one option, i am not too much sure in this . can any one explain me what is this.

Regards,

Kapil Soni

Read only

Former Member
0 Likes
2,586

Hi ..

The value entered in the field is checked against the check table or fixed values defined in the ABAP Dictionary. There must be a LIKE reference to an ABAP Dictionary field.

For further Reference see The Help By preesing F1 key in the VALUE CHECK .

Regards

Bala..

Message was edited by:

S Balasubramanian