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

some probleam in my select statement

HI,

in my select statement data is not fetching when i am giving in my input fields value

plant = wmd1 and stlal = 02.But when i am giving the input value stlst = 01. then the select statement is working.

i checked in my view , giving werks and stlal values 11 recoeds availavle in data base.but why in my int. table gt_mast contains

no record at this time. please help me..

INITIALIZATION.

r_lkenz-sign = 'I'.

r_lkenz-option = 'NE'.

r_lkenz-low = 'X'.

APPEND r_lkenz.

CLEAR r_lkenz.

SELECT matnr

werks

stlal

FROM zv_mast_stko

INTO TABLE gt_mast

WHERE matnr IN so_matnr

AND werks IN so_werks

AND lkenz IN r_lkenz

AND stlal EQ po_stlal

AND stlst EQ po_stlst.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jan 28, 2010 at 06:23 AM

    Check if any conversion exits are maintained for those particular fields

    Add a comment
    10|10000 characters needed characters exceeded

    • >

      > but for this selection already in database 11 entries available.so why i am getting sy-subrc = 4??

      Hello Asis,

      For the 11 records in the DB what is the value for STLST (do you have any recs with STLST = space) ? As per your SELECT stmt:

      stlst EQ po_stlst

      The system tries to search for STLST = space & hence you get SUBRC = 4.

      BR,

      Suhas

      Edited by: Suhas Saha on Jan 28, 2010 12:07 PM

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2010 at 06:35 AM

    Hi,

    Just try to write the query in start of selection.

    Jatender

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2010 at 06:40 AM

    hi ,

    you are given the following values in the where condition..

    >

    > WHERE matnr IN so_matnr

    > AND werks IN so_werks

    > AND lkenz IN r_lkenz

    > AND stlal EQ po_stlal

    > AND stlst EQ po_stlst.

    but you pass only the WERKS and STLAL then the values is not comming write

    i think the region is when you are not passing the value in the LKENZ nad STLST they automatecally pass initial,may be they are not initial on the condition which u are passing

    so go to database table pass them as initial and the value of the werks and stlal and see record is comming or not

    hope this helps

    Regards

    Ritesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2010 at 06:56 AM

    hI

    your query below

    SELECT matnr

    werks

    stlal

    FROM zv_mast_stko

    INTO TABLE gt_mast

    WHERE matnr IN so_matnr

    AND werks IN so_werks

    AND lkenz IN r_lkenz

    AND stlal EQ po_stlal

    AND stlst EQ po_stlst.

    Checks for the And condition , so here it wil fetch the values which you have provided , if you doesn't provide any value for search criteria , it will serch for blank values for that field with combination of other fields.

    If you want get the values even if you doen's provide for particular field use 'OR'

    Regards,

    svj

    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.