Application Development and Automation 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: 
Read only

SELECT

Former Member
0 Likes
1,419

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
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,391

Hi,

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

Regards,

Sesh

Read only

Former Member
0 Likes
1,391

hi,

r u using parameters or select-option?

Read only

0 Likes
1,391

Parameter.

Read only

0 Likes
1,391

am using select-option

Read only

0 Likes
1,391

ok so send me ur code.

Read only

JozsefSzikszai
Active Contributor
0 Likes
1,391

hi Raja,

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

ec

Read only

Former Member
0 Likes
1,391

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

Read only

varma_narayana
Active Contributor
0 Likes
1,391

Hi..

How did u declare ZPL..

Give the code to identify..

regards..

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,391

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

Read only

0 Likes
1,391

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

Read only

0 Likes
1,391

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

Read only

Former Member
0 Likes
1,391

hi raja,

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

then i hope i can help u.

thanks

seema

Read only

Former Member
0 Likes
1,391

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.

Read only

Former Member
0 Likes
1,391

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

Read only

Former Member
0 Likes
1,391

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