‎2007 Mar 14 9:29 AM
Hi,
Iam doing some validations.fileds is plant(WERKS)mateial(MATNR), ZDATBA(date from date),ZDATBI(Date to date),Zmessage.
My requirement is
1)check whether a material is selected for the given plant.if it doesn't belongs to the selected plant,display error message" Material does not
exist for this plant"
2) Check whether the message entered already exist for the plant,material,Date
Combination(Note: All fields in ZMSG table).If it exists display message " A message already exists for the material,plant,date combination"
How to write the select quires for my requirement.Please help me.It is very urgent.
Thanks & Regards,
Sairam
‎2007 Mar 14 9:36 AM
eg:
select singe * from ZMSG where
zplant = werks and
zmatnr = matnr and
zdatba = datba and
zdatbi = datbi.
if sy-subrc = 0.
message e000(0) with 'A message already exists'.
endif.
‎2007 Mar 14 9:36 AM
eg:
select singe * from ZMSG where
zplant = werks and
zmatnr = matnr and
zdatba = datba and
zdatbi = datbi.
if sy-subrc = 0.
message e000(0) with 'A message already exists'.
endif.
‎2007 Mar 14 10:23 AM
‎2007 Mar 14 12:21 PM
Hi,
let S_plant be the selection option
select matnr werks from DBTAB into itab where werks in S_plant.
if sy-subrc = 0.
message E001(0) with ' Material Doesn't exist for the given plant'.
endif.
select * from ZMSG where
zplant = werks and
zmatnr = matnr and
zdatba = datba and
zdatbi = datbi and
zmessage=message.
if sy-subrc = 0.
message E002(0) with 'A message already exists'.
endif.
In the second select we have to give the message field also in where if it is succesfull means we found the message with our given message then we have to display the error.
Think this will be helpful for u.
Reward points if found useful.
Regards,
Ravi Kumar
Message was edited by:
Selvaraj Ravi Kumar
‎2007 Mar 15 5:43 AM
Hi,
This answers is very help ful to me.I will give reward points to u.
Thanks & Regards,
sairam