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

include and exclude status

i need to take all the status of "objnr" but there are status that i dont want to see exclude

this is the select that take all the status

select-option: z_stat_i FOR jest-stat,

z_stat_e FOR jest-stat.

SELECT stat

FROM jest

INTO mdstat-zs_stat

WHERE objnr = mdeqp-objnr

AND stat IN z_stat_i

AND inact = ' '.

APPEND mdstat.

any ideas?

thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 10:09 AM

    n.b

    there is an example in trans IE05

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 10:11 AM

    Hi,

    I would think it is as simple as this:

    SELECT stat

    FROM jest

    INTO mdstat-zs_stat

    WHERE objnr = mdeqp-objnr

    AND stat IN z_stat_i

    <b>AND NOT stat IN z_stat_e</b>

    AND inact = ' '.

    APPEND mdstat.

    regards

    Thomas

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I'm not familiar with IE05. But this select works this way:

      If EX is empty you get nothing returned.

      If EX has data - this is the only thing you don't get.

      If IN has data - this is the only thing you get as long as the result don't match your EX.

      To be sure you get all if the EX is empty, you should validate the input before select and make a nonexisting entry in your EX-select-option. Or simply make 2 select-statements: 1 with the EX and 1 without.

      Regards

      Thomas

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 10:38 AM

    Hi Please try with the following code snippet.

    SELECT stat

    FROM jest

    INTO mdstat-zs_stat

    WHERE objnr = mdeqp-objnr

    AND stat IN z_stat_i

    AND NOT stat IN z_stat_e

    AND inact = ' '.

    APPEND mdstat.

    clear mdstat.

    endselect.

    satish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 12:14 PM

    Hi yehiel,

    1. It is clear that the normal sql statement

    won't work in the way we won't.

    2. Thats why, some extra logic needs to be applied.

    As already mentioned,

    The RANGE for EXCLUDE

    must be filled with some DUMMY Data.

    Just write this CODE

    JUST BEFORE CALLING THE SQL.

    IF z_stat_eIS INITIAL.

    z_stat_e-sign = 'I'.

    z_stat_e-option = 'EQ'.

    z_stat_e-low = 'XXX'.

    z_stat_e-high = 'XXX'.

    APPEND z_stat_e.

    ENDIF.

    HOPE THIS WORKS.

    Regards,

    Amit M.

    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.