Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Conditional Select - How to retrieve data based on different cond.

Former Member
0 Likes
772

Hi

I have a requirement to retrieve Equipments for Sales orders. But the selection criteria includes that if an Equipment with a EQTYp = 0 exists, only that record needs to be retrieved. And if no such equipment (Eqtyp = 0) exists, then retrieve any equipment from the Sales Order.

I have for this reason selected a process as follows:

First collect all sales orders, collect Equipments for them from SER02 and OBJK. And then look for a EQtyp = 0 equipment for each sales order line item. If no such one is found, then one of the other equipments is selected.

As the report needs to be run open (without specifying any sales orders) at times, the amount of sales orders that are to be checked becomes huge and so retrieving the equipmets also becomes hectic in my current process.

So, is there any other way to retrieve this information? or can a select be formulated in such a way that it can decide to pick a EQTYP <> 0 equipment when a EQTYP = 0 equipment is not found.

Thanks in advance.

Jr.

Message was edited by:

Jr Abaper

2 REPLIES 2
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
440

Hi

Is Equipment is an selection-screen field?

If so give Equipment value = o and # in the selection-screen while executing?

If that is not an selection-screen field in the select query in the where condition you can mention Equipment = 0 or

equipment # 0.

This can optimize the code some what.

Regards,

Sreeram

Read only

0 Likes
440

Thanks for the answer sree ram.