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: 

How to fetch vendors corresponding to particular plant

Former Member
0 Kudos

how to get all the vendors corresponding to plant 4014 where purchase oragnisation is 1000.i fetched all the vendors from LFB1 and LFM1..

select a~lifnr

a~bukrs

b~ekorg

INTO TABLE t_vendor

FROM lfb1 AS a INNER JOIN lfm1 AS b

ON alifnr = blifnr

WHERE a~bukrs EQ p_bukrs

AND b~ekorg = c_1000.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI ANU,

I DONT KNOW THIS IS THE CORRECT SOLUTION BUT STILL TRY IT..

FIRST FETCH ALL THE VENDORS FROM LFA1 WITH UR PLANT NUMBER

THEN READ THIS INTERNAL TABLE AND CHECK WHETHER ALL THE VENDORS IN UR INTERNAL TABLE ARE ASSIGNED PURCHASING ORG AS 1000 FROM LFM1 TABLE....

HOPE U UNDERSTAND..STILL IF U R NOT ABLE THEN LET ME KNOW...

2 REPLIES 2

Former Member
0 Kudos

HI ANU,

I DONT KNOW THIS IS THE CORRECT SOLUTION BUT STILL TRY IT..

FIRST FETCH ALL THE VENDORS FROM LFA1 WITH UR PLANT NUMBER

THEN READ THIS INTERNAL TABLE AND CHECK WHETHER ALL THE VENDORS IN UR INTERNAL TABLE ARE ASSIGNED PURCHASING ORG AS 1000 FROM LFM1 TABLE....

HOPE U UNDERSTAND..STILL IF U R NOT ABLE THEN LET ME KNOW...

Former Member
0 Kudos

Hi,

You can get all vendor's details with the address number with reference of LFA1 and ADRC tables,

SELECT SINGLE * FROM LFA1 WHERE LIFNR = ZRFQ-LIFNR.

SELECT SINGLE * FROM ADRC WHERE ADDRNUMBER EQ LFA1-ADRNR.

IF USEFULL REWARD