‎2006 Aug 03 8:35 PM
Hi everybody
plz help in writing select quiery
in the spec it given as
<b>'qals-matnr selected based on the inspection lot number qals-prueflos in transaction qa32 the matnr material number will include dashes. for example 0398-0457-08-c1 MAT NO = MATNO 0398-0457--08-c1.'</b>
can u plz me how to write this select statement.
regards
siri
‎2006 Aug 03 9:16 PM
‎2006 Aug 03 9:20 PM
<b>This is about all I could get out of the "Horrible" spec that you were given.
</b>
report zrich_0001.
data: xmatnr type qals-matnr.
parameters: p_ps type qals-prueflos.
select Single matnr into xmatnr
from qals
where prueflos = p_ps.
write:/ xmatnr.
Regards,
Rich Heilman
Comment on horrible spec
Message was edited by: Rich Heilman
‎2006 Aug 03 9:21 PM
‎2006 Aug 03 9:24 PM
Rich,
You are too fast for me... lol Once again great minds thinking alike (see my reply above).
One other thing I noticed is that table QALS has multiple fields with data element MATNR. Not sure if SELMATNR or MATNR is the correct field, but I'd guess that it is MATNR.
Cheers,
James
‎2006 Aug 03 9:31 PM
‎2006 Aug 03 9:20 PM
If this is the spec you got, then it is horrible. It doesn't talk about what to select from what tables using what conditions. The information <b>'matnr material number will include dashes. for example 0398-0457-08-c1 MAT NO = MATNO 0398-0457--08-c1.'</b> doesn't tell why that is given.
Please go back to the person who wrote the spec and ask for some more details.
‎2006 Aug 03 9:23 PM
Yes, like Srinivas says, go back to the person who wrote the spec and ask for some more details (and hit him too).
‎2006 Aug 03 9:25 PM
‎2006 Aug 03 9:23 PM
Hi,
Try this:
parameters: p_lotnum type qplos.
data: wa_matnr type matnr.
select single selmatnr from qals into wa_matnr
where prueflos = p_lotnum.
if sy-subrc ne 0.
* handle "not found" case
endif.The material number is just a character field, so I don't see how the dashes come into play. If table QALS already stores the material number with the dashes, then the value you select into wa_matnr will also have the dashes.
Best Regards,
James