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: 

validation of selection screen

Former Member
0 Kudos

Hi all,

I need logic for validation.my requirement is:

i need to take a material No.s (MARC-MATNR) from selection screen then check to see if any plants have that material setup as QM active (MARC-QMATV). if no, then issue message on report O/P that "no active plants are Vailable".

Thanks,

7 REPLIES 7

Former Member
0 Kudos

hi ,

Use

AT Selection-screen output event.

and validate your requirement.

Regards,

Vijay

Former Member
0 Kudos

Hi Mythily,

parameters: p_matnr type marc-matnr.

at selection-screen on field p_matnr.

//validate as required using the select query..

if sy-subrc ne 0.

message 'no active plants available' type 'E'.

endif.

Regards.

0 Kudos

The message as to display on O/P List

0 Kudos

there is one column for printing all error messages in O/P list how can we do it

Former Member
0 Kudos

Hi,

In your final internal table add one more column for error message.. And while doing the validation append this to your final internal table:

Sample code:

Do your vaildation.

if sy-subrc ne 0.

ls_final-message = 'no active plants are Vailable'.

append ls_final to lt_final.

endif.

Now display this table.. It will hold the error message as well..

I355602
Advisor
Advisor
0 Kudos

Hi,

You can use the Event AT SELECTION-SCREEN OUTPUT

Fire a select query as per your requirement and then check for valid data.

If no valid data found then raise error.

Hope this helps you.

Regards,

Tarun

Former Member
0 Kudos

hi

try this code

PARAMETERS: p_matnr LIKE marc-matnr,

p_werks LIKE marc-werks.

DATA: lv_qmatv LIKE marc-qmatv,

lv_werks like marc-werks.

AT SELECTION-SCREEN.

IF p_matnr IS NOT INITIAL.

SELECT SINGLE qmatv INTO lv_qmatv FROM marc WHERE matnr = p_matnr

AND werks = p_werks.

IF lv_qmatv IS INITIAL .

MESSAGE 'no active plants are Vailable' TYPE 'E'.

ENDIF.

ENDIF.

thanx

surya