07-09-2009 11:02 AM
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,
07-09-2009 11:03 AM
hi ,
Use
AT Selection-screen output event.
and validate your requirement.
Regards,
Vijay
07-09-2009 11:16 AM
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.
07-09-2009 11:23 AM
07-09-2009 11:25 AM
there is one column for printing all error messages in O/P list how can we do it
07-09-2009 11:30 AM
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..
07-09-2009 11:31 AM
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
07-09-2009 11:58 AM
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