2007 Sep 07 1:00 PM
HI Guys
iam using following part of query,
SELECT
mseg~BWART
from mseg
inner join
mkpf on mkpfmblnr EQ msegmblnr
into table itab
where mkpf~budat in zdate and
mseg~werks in zpl.
mseg~werks in zpl is not working, it gives invalid data. its not giving the range of values, returns all values.
how to solve , pls give me any suggestion.
Regards
Rajaram
2007 Sep 07 1:03 PM
2007 Sep 07 1:04 PM
2007 Sep 07 1:09 PM
2007 Sep 07 1:22 PM
2007 Sep 07 1:24 PM
2007 Sep 07 1:05 PM
hi Raja,
first you have to check during runtime (in debug), if zpl contains the right data.
ec
2007 Sep 07 1:07 PM
HI,
SELECT
mseg~BWART
into table itab
from mseg
inner join
mkpf ON mkpfmblnr EQ msegmblnr
where mkpf~budat IN zdate AND
mseg~werks in zpl.
The above code should not give any error.
Regards,
Rama Murthy.P
2007 Sep 07 1:08 PM
Hi..
How did u declare ZPL..
Give the code to identify..
regards..
2007 Sep 07 1:17 PM
I got no problem with your syntax, i defined select-options:
SELECT-OPTIONS zdate FOR mkpf-budat.
SELECT-OPTIONS zpl FOR mseg-werks.
Could you give more lines of your code
Regards
2007 Sep 07 1:24 PM
SELECT-OPTIONS: zpl FOR mseg-WERKS OBLIGATORY.
SELECT mseg~mblnr
mkpf~budat
mseg~kdauf
mseg~kdpos
mseg~matnr
mseg~werks
mseg~erfmg
mseg~erfme
mseg~BWART
from mseg
inner join
mkpf on mkpfmblnr EQ msegmblnr
into table itab
where mkpf~budat in zdate and
mseg~werks in zpl and
mseg~kdauf ne ' ' and
( mseg~BWART = '601' or
mseg~bwart = '602').
2007 Sep 07 1:44 PM
Look at your actual code with space between constants and bracket, maybe there is a bracket or OR/AND operator in the wrong place ?
Regards
2007 Sep 07 1:17 PM
hi raja,
plz send ur code of declaration of both parameters which u r comparing.
then i hope i can help u.
thanks
seema
2007 Sep 07 1:39 PM
hi,
I wrote this code and its giving right output.
TABLES : mseg,mkpf.
DATA : BEGIN OF itab OCCURS 0,
mblnr LIKE mseg-belnr,
budat LIKE mkpf-budat,
matnr LIKE mseg-matnr,
werks LIKE mseg-werks,
END OF itab.
SELECT-OPTIONS: zpl FOR mseg-werks OBLIGATORY,
zdate FOR mkpf-budat.
SELECT msegmblnr mkpfbudat msegmatnr msegwerks
FROM mseg INNER JOIN mkpf
ON mkpfmblnr EQ msegmblnr
INTO TABLE itab
WHERE mkpf~budat IN zdate AND
mseg~werks IN zpl.
LOOP AT itab.
WRITE:/ itab-mblnr.
ENDLOOP.
2007 Sep 07 2:12 PM
hi raja,
dhwani has given u correct code. i check also on my system it is giving correct result. but when u r keeping date select option blank.
then it could nt find any value equal to empty date. thats the reason. it could nt read any value in ur case. as much i understand ur probs.
(n try to check really space in ur code also).
n come back if u still could nt solve ur prob.
thanks.
seema
2007 Sep 07 3:20 PM
The first response was the correct one:
CHECK NOT zpl[] IS INITIAL.
SELECT mseg~bwart
FROM mseg
INNER JOIN mkpf ON
mkpf~mblnr EQ mseg~mblnr
INTO TABLE itab
WHERE mkpf~budat IN zdate
AND mseg~werks IN zpl.
Rob