Skip to Content
author's profile photo Former Member
Former Member

SELECT

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

10 Answers

  • Posted on Sep 07, 2007 at 12:03 PM

    Hi,

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

    Regards,

    Sesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 12:04 PM

    hi,

    r u using parameters or select-option?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 07, 2007 at 12:05 PM

    hi Raja,

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

    ec

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 12: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 07, 2007 at 12:08 PM

    Hi..

    How did u declare ZPL..

    Give the code to identify..

    regards..

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 07, 2007 at 12: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 12: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 12: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 01: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.