10-16-2008 5:05 AM
Hi,
I should pick OBJNRs from JEST whose stat EQ 'I0010' OR stat EQ 'I0009' and whose stat not equal to I0012,I0045,I0046.
For example
As OBJNRs will have different status,if an OBJNR contains status = 'I0009' and status = 'I0045' ,this OBJNR should not be picked as it has status = 'I0045' .
How to write a 'select' statement for this . Please suggest.
Thanks
Venkat
10-16-2008 5:31 AM
>
> Hi,
>
> I should pick OBJNRs from JEST whose stat EQ 'I0010' OR stat EQ 'I0009' and whose stat not equal to I0012,I0045,I0046.
> For example
> As OBJNRs will have different status,if an OBJNR contains status = 'I0009' and status = 'I0045' ,this OBJNR should not be picked as it has status = 'I0045' .
> How to write a 'select' statement for this . Please suggest.
>
> Thanks
> Venkat
Hi Venkat,
We can not do it dirctly with one select statement
First select records with 'I0010' and 'I0009'
and Select records with I0012,I0045,I0046
then Looping with first Internal table , read the second internal table to see if record exists for the same objnr of first internal table , if record exists delete that record from first internal table.
Then at end you get records what you want.
Try it out.
Regards,
Narendra.Soma
10-16-2008 5:07 AM
instead of select, you can use the Function STATUS_TEXT_EDIT, fot this pass the Objnr, you get the status in exporting parameter LINE . line consists of all statuses. using CS you can check the status which you want.
10-16-2008 5:11 AM
10-16-2008 5:16 AM
select * from jest into table ijest where ( stat = 'i0010' and stat = 'i0009' and stat ne 'i0012' ).
10-16-2008 5:18 AM
Thanks for the reply. Status should not include 'I0012','I0045','I0046'.
10-16-2008 5:27 AM
select * from jest into table ijest where ( stat = 'I0010' or stat = 'I0009' or stat ne 'I0012' and stat ne 'I0045' and stat ne 'I0046').
10-16-2008 5:28 AM
Hi,
Try like this:
Select objnr from jest
where stat IN ( 'I0009' , 'I0045' ) AND
stat NOT IN ( 'I0012', 'I0045', 'I0046' ).
Regards,
Bhaskar
10-16-2008 5:29 AM
I should pick OBJNRs from JEST whose stat EQ 'I0010' OR stat EQ 'I0009' and whose stat not equal to I0012,I0045,I0046.
select * from jest
into table it_jest
where stat not in ('I0012' , 'I0045' , 'I0046').
or
select * from jest
into table it_jest
where stat in ('I0010' , 'I0009').
or u can combine both in same select
10-16-2008 5:31 AM
>
> Hi,
>
> I should pick OBJNRs from JEST whose stat EQ 'I0010' OR stat EQ 'I0009' and whose stat not equal to I0012,I0045,I0046.
> For example
> As OBJNRs will have different status,if an OBJNR contains status = 'I0009' and status = 'I0045' ,this OBJNR should not be picked as it has status = 'I0045' .
> How to write a 'select' statement for this . Please suggest.
>
> Thanks
> Venkat
Hi Venkat,
We can not do it dirctly with one select statement
First select records with 'I0010' and 'I0009'
and Select records with I0012,I0045,I0046
then Looping with first Internal table , read the second internal table to see if record exists for the same objnr of first internal table , if record exists delete that record from first internal table.
Then at end you get records what you want.
Try it out.
Regards,
Narendra.Soma
10-16-2008 5:39 AM
Hi you can try like this..
( objnr eq 'I0010' or stat EQ 'I0009' ) and
( objnr ne 'I0012' and objnr ne 'I0045' and objnr ne 'I0046' ).
regards.
10-16-2008 5:43 AM
Hi Venkat,
Try the code
DATA : IT_JEST TYPE TABLE OF JEST.
SELECT *
FROM JEST
INTO TABLE IT_JEST
WHERE STAT IN ('I0010', 'I0009' ) AND
STAT NOT IN ('I0012', 'I0045', 'I0046' ).
WRITE 'HAI'.
Regards