Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Select Statement

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

Tags:
Former Member replied

>

> 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

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question