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

select query

Former Member
0 Likes
422

Hi,

In my selection screen i have work center (ARBPL) and start date.

I want to list work orders (AUFNR) based on technical object (tidnr) .

SELECT agstrp agsuzp baufnr cvornr darbpl bktext b~autyp INTO TABLE it_tab

FROM afko AS a

INNER JOIN aufk AS b ON aaufnr = baufnr

INNER JOIN afru AS c ON aaufnr = caufnr

INNER JOIN MCAFVGV AS D ON AAUFNR = DAUFNR

WHERE

a~gstrp IN s_date

AND d~arbpl IN S_ARBPL.

The above select statement is displaying Process Orders ( autyp = '40')

but i want to list work orders also ( autyp = '30').

I would appreciate if anyone can drive me on this.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
392

First of all avoid using so many inner joins.

SELECT

agstrp agsuzp baufnr bktext b~autyp

INTO corresponding fields of table it_tab

FROM afko AS a

INNER JOIN aufk AS b ON aaufnr = baufnr

WHERE a~gstrp IN s_date.

loop at it_tab.

select single vornr from afru into it_tab-vornr where aufnr = it_tab-aufnr.

select single arbpl from MCAFVGV into it_tab-arbpl where aufnr = it_tab-aufnr.

MODIFY itab.

ENDLOOP.

hope this is helpful to u.

anju

2 REPLIES 2
Read only

Former Member
0 Likes
393

First of all avoid using so many inner joins.

SELECT

agstrp agsuzp baufnr bktext b~autyp

INTO corresponding fields of table it_tab

FROM afko AS a

INNER JOIN aufk AS b ON aaufnr = baufnr

WHERE a~gstrp IN s_date.

loop at it_tab.

select single vornr from afru into it_tab-vornr where aufnr = it_tab-aufnr.

select single arbpl from MCAFVGV into it_tab-arbpl where aufnr = it_tab-aufnr.

MODIFY itab.

ENDLOOP.

hope this is helpful to u.

anju

Read only

Former Member
0 Likes
392

hi

good

you can give the condition in where statement to display the data for autyp=40.

thanks

mrutyun^