‎2010 Feb 08 12:26 PM
Hi all,
Want a select statement as follows:
[1]
SELECT mastmatnr knvvkunnr kna1~loevm FROM mast
INNER JOIN knvv ON knvvkunnr = mastmatnr
INNER JOIN kna1 ON kna1kunnr = mastmatnr
INTO CORRESPONDING FIELDS OF TABLE itab
WHERE mastwerks = 0001 AND maststlan = 8
AND knvv~vkorg = 0200
AND knvv~vtweg = 00
AND knvv~spart = 01
AND knvv~kdgrp = 'T1'
AND kna1~loevm <> 'X' .
But it gives me a sy-subrc = 4.
Tried something to find out the problem
The following worked.
SELECT mast~matnr FROM mast
INTO CORRESPONDING FIELDS OF TABLE
itab.
The following didnt work.
SELECT mast~matnr FROM mast
INTO CORRESPONDING FIELDS OF TABLE
itab where mast~werks = 0001.
AND mast~stlan = 8.
Is it something to do with primary Key?
How should I modify [1-see above],A modified statement would be helpful.
Eagerly waiting for a reply.....
P
‎2010 Feb 08 12:35 PM
WERKS is a char4 field...
so 0001 and '0001' are different.... right!!! .... 0001 means 1 only...
can try by putting quote
‎2010 Feb 08 12:35 PM
WERKS is a char4 field...
so 0001 and '0001' are different.... right!!! .... 0001 means 1 only...
can try by putting quote
‎2010 Feb 08 12:40 PM
hi,
the join condition you are using is invalid.
You are checking the Material number in MAST table to be equal to KUNNR in KNVV table.
Please check the condition again.
Regards,
Komal.
‎2010 Feb 08 12:43 PM
Thanks a lot guys for the prompt reply..
I put quotes and it worked.
The kunnr and materialnummer is the same in this case.Its a customisation we have done....
Thanks a lot.