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

list process orders and work orders

Former Member
0 Likes
389

Hi Experts,

I am listing maintenance work orders, maintenance work centers ( arbpl or vaplz ) and process orders based on production work center ( arbpl ) and start dat.

First im trying to get objid from CRHD based on work center ( arbpl ) and then,

AUFPL OBJNR from AFVC based on arbid and then,

AUFNR VAPLZ from CAUFV based on aufpl and s_date.

these are the select statements for maintenance work orders.

SELECT objid

FROM crhd

INTO TABLE crhd_tab[]

WHERE arbpl IN s_arbpl.

SELECT aufpl objnr aplfl vornr INTO CORRESPONDING FIELDS OF TABLE lts_objnr[]

FROM afvc

FOR ALL ENTRIES IN crhd_tab[]

WHERE arbid = crhd_tab-objid.

SELECT gstrp aufnr vaplz ktext INTO TABLE it_tab1

FROM caufv

FOR ALL ENTRIES IN lts_objnr[]

WHERE aufpl = lts_objnr-aufpl

AND gstrp IN s_date.

also i wrote separate select statement for listing process orders.

SELECT agstrp aaufnr aernam carbpl

INTO TABLE it_tabp FROM caufv AS a

INNER JOIN afru AS b ON aaufnr = baufnr

INNER JOIN crhd AS c ON barbid = cobjid

WHERE

a~gstrp IN s_date

AND c~arbpl IN s_arbpl.

and im collecting both the orders in final internal tables.

when i enter only date in selection screen im getting both process orders and work orders, maintenance work centers.

But when i enter date and work center, its displaying only process orders.

I looked into the tables but unable to find the relation between maintenance work orders, maintenance work center and production work center.

1 REPLY 1
Read only

Former Member
0 Likes
320

Hi Experts,

Is there any table from which we can get work orders(aufnr) based on work center (arbpl ).