04-18-2008 12:14 PM
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....
04-18-2008 1:08 PM
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.
04-18-2008 1:21 PM
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