Application Development 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: 

select

Former Member
0 Kudos

In selection screen i have purchase organisation as select option..

Based on this purchase organisation i have to write a query with all the plants that is associated wid purchase organisation Can u pls tell me how 2 do??

Ekorg(PO)-T001w.

Select..........

from Marc where werks in........

how shud i get werks for the PO into select query.

Points will b rewarded....

2 REPLIES 2

Former Member
0 Kudos

hi ...

See u have to use 2 tables ....

1. Ekko -- Purchasing Document Header

2. Ekpo -- Purchasing Document Item

select-options : s_ekorg for ekko-ekorg.

Select ekorg

werks

from ekpo as a

join ekko as b

where aebeln = bebeln

and ekorg = s_ekorg.

Former Member
0 Kudos

SELECT-OPTIONS : s_ekorg type T001W-EKORG.

DATA : BEGIN OF I_WERKS OCCURS 0,

werks type T001W-WERKS,

END OF I_WERKS.

Select Werks into table i_werks from T001W where EKORG in s_ekorg.

This will fetch all related data for s_ekorg in internal table i_werks

Regards,

Mohaiyuddin