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

Former Member
0 Likes
506

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....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
476

Hi,

See below eg:

tables: t001w.

select-options: s_ekorg for t001w-ekorg.

data: begin of it_t001w occurs 0,

werks type t001w-werks,

ekorg type t001w-ekorg,

end of it_t001w.

select werks ekorg from t001w into table it_t001w

where ekorg in s_ekorg.

if not it_t001w[] is initial.

select * from marc into table <itab>

for all entries of it_t001w

where werks = it_t001w-werks.

endif.

Regards

Ganesh

2 REPLIES 2
Read only

Former Member
0 Likes
477

Hi,

See below eg:

tables: t001w.

select-options: s_ekorg for t001w-ekorg.

data: begin of it_t001w occurs 0,

werks type t001w-werks,

ekorg type t001w-ekorg,

end of it_t001w.

select werks ekorg from t001w into table it_t001w

where ekorg in s_ekorg.

if not it_t001w[] is initial.

select * from marc into table <itab>

for all entries of it_t001w

where werks = it_t001w-werks.

endif.

Regards

Ganesh

Read only

Former Member
0 Likes
476

Hi,

If you face in problem in 1st Eg.

You try this, it is working I teted.

EG:

tables: t001w.

select-options: s_ekorg for t001w-ekorg.

data: begin of it_t001w occurs 0,

werks type t001w-werks,

ekorg type t001w-ekorg,

end of it_t001w.

data: begin of itab occurs 0,

matnr type marc-matnr,

werks type t001w-werks,

end of itab.

select werks ekorg from t001w into table it_t001w

where ekorg in s_ekorg.

sort it_t001w by werks.

if not it_t001w[] is initial.

select matnr werks from marc into table itab

for all entries in it_t001w

where werks = it_t001w-werks.

endif.

Regards

Ganesh