on 2023 Nov 06 2:34 PM
Dear Experts,
do you have an idea why I am still getting results with stat= 'E0012' and inact = SPACE although
as per below mentioned Select query they should be clearly delimited (see EXISTS Command)
I am expecting hits with:
stat= 'E0012' and inact = X
and NOT
stat= 'E0012' and inact = SPACE
<strong>
TYPES: BEGIN OF ty_s_prps,
posid TYPE ps_posid,
post1 TYPE ps_post1,
psphi TYPE ps_psphi,
pbukr TYPE ps_pbukr,
objnr TYPE j_objnr, "20160712
END OF ty_s_prps,
TYPES: ty_t_prps TYPE TABLE OF ty_s_prps.
DATA: lt_prps TYPE ty_t_prps.
SELECT a~posid
a~post1
a~psphi
a~pbukr
a~objnr
INTO TABLE lt_prps
FROM prps AS a
INNER JOIN jest AS j ON a~objnr = j~objnr
WHERE a~belkz EQ lc_on_x
AND a~loevm EQ space
AND a~pbukr IN lt_sel_bukrs_range
* AND a~plakz EQ lc_on_x
AND j~stat EQ 'I0002'
AND j~inact EQ space
AND a~fakkz EQ lc_on_x
AND EXISTS ( SELECT * FROM jest WHERE stat = 'E0012' AND inact = 'X'
OR stat NE 'E0012'). </strong><br>
Br
Ilhan
Request clarification before answering.
Hello Raymond,
this returned 0 entries unfortunatelly.
AND NOT EXISTS ( SELECT * FROM jest WHERE stat = 'E0012' AND inact = ' ')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please use the COMMENT button for comments, asking for complements, adding details, replying to a comment or a proposed solution or to the OP question, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.
If you want to target someone, if this person has posted an Answer, use the button COMMENT, if this person is the Original Poster of the question he/she will be automatically informed, otherwise copy/paste their hyperlinked name e.g. ilhan.ertas so that the person receives a warning (NB: @ doesn't work/but typing this character will suggest hyperlinked names).
| User | Count |
|---|---|
| 26 | |
| 13 | |
| 13 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 4 | |
| 4 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.