Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SELECT

Former Member
0 Kudos

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

15 REPLIES 15

0 Kudos

Hi,

Check if <b>zpl</b> is having any values.

Regards,

Sesh

Former Member
0 Kudos

hi,

r u using parameters or select-option?

0 Kudos

Parameter.

0 Kudos

am using select-option

0 Kudos

ok so send me ur code.

JozsefSzikszai
Active Contributor
0 Kudos

hi Raja,

first you have to check during runtime (in debug), if zpl contains the right data.

ec

Former Member
0 Kudos

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

varma_narayana
Active Contributor
0 Kudos

Hi..

How did u declare ZPL..

Give the code to identify..

regards..

raymond_giuseppi
Active Contributor
0 Kudos

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

0 Kudos

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').

0 Kudos

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

Former Member
0 Kudos

hi raja,

plz send ur code of declaration of both parameters which u r comparing.

then i hope i can help u.

thanks

seema

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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