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

Problems with Selection for Werks from Eine

Former Member
0 Likes
2,392

Hi all

I surch for an way to get the Werks for Eine.

I know

EKPO

EKKO-BSTYP

LFA1

LFM1

EKKO

EKPO

EKPO

EKPO

EBAN

MT06E

EINA

EINE

EKPO

KOMP

But there is no way to select werks.

a bit coding

SELECT * FROM EINE

WHERE INFNR = I_EINE-INFNR

AND EKORG = I_EINE-EKORG.

endselect.

Chris

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,181

hii

there is a WERKS FIELD IN EINE

SELECT * FROM EINE

WHERE INFNR = I_EINE-INFNR

AND EKORG = I_EINE-EKORG AND

WERKS = I_EINE-WERKS .

ReGARDS

Naresh

15 REPLIES 15
Read only

Former Member
0 Likes
2,181

Hi Christian,

What values do you have?

What Values do you want?

Regards,

Ravi

Read only

0 Likes
2,181

WERKS is in the EINE table in my 46c system. Is it not in your system?



SELECT * FROM EINE
      WHERE INFNR = I_EINE-INFNR
        AND EKORG = I_EINE-EKORG
<b>        and WERKS in S_WERKS.</b>


If your system is not configured to have plant specific PIRs, then this field will be blank.

Regards,

Rich Heilman

Read only

0 Likes
2,181

The Problem is not the selection. I need Werks for the selection, but i can not find the connection.

Read only

Former Member
0 Likes
2,182

hii

there is a WERKS FIELD IN EINE

SELECT * FROM EINE

WHERE INFNR = I_EINE-INFNR

AND EKORG = I_EINE-EKORG AND

WERKS = I_EINE-WERKS .

ReGARDS

Naresh

Read only

0 Likes
2,181

there is a WERKS FIELD IN EINE

SELECT * FROM EINE

WHERE INFNR = I_EINE-INFNR

AND EKORG = I_EINE-EKORG AND

WERKS = I_EINE-WERKS

a nice idear. But its not correct.

A sample

SELECT * FROM EINE

WHERE INFNR = I_EINE-INFNR

AND EKORG = I_EINE-EKORG AND

endselect. -> i get all entrys from Eine

But i need a special WERKS

Read only

Former Member
0 Likes
2,181

Select single * from EINE

where infnr eq l_infnr

and ekorg eq l_ekorg

and esokz eq k_std

and werks ne space.

?

Read only

Former Member
0 Likes
2,181

If you have vendor information, then you can get WERKS from LFA1.

Regards,

Ravi

Read only

0 Likes
2,181

The Point is this is not the correct Werks.

In the Eine is an entry for Werk 100,200,300

But in the LFA1 is the Werk 500.

Read only

0 Likes
2,181

If you have Purchase order Item details, the you can get the WERKS from EKPO.

select single werks from ekpo into v_werks

where ebeln = <PO> and ebelp = <POITEM>.

then you can use it on eina.

Regards,

Ravi

Read only

0 Likes
2,181

its correct to.

But The Werks in the purchase order is not the correct one.

Purchase Order 125

Eine 130

Read only

Former Member
0 Likes
2,181

hii

try this

SELECT WERKS ..

FROM LFA1

INTO IT_LFA1

WHERE WERKS IN S_WERKS .

IF SY-SUBRC = 0.

SELECT * FROM EINE

FOR ALL ENTRIES IN IT_LFA1

WHERE INFNR = I_EINE-INFNR

AND EKORG = I_EINE-EKORG AND

WERKS IN S_WERKS .

ENDIF .

THIS WAY YOU WILL HAVE FIELDS IN BOTH .

Read only

0 Likes
2,181

Is ok, but ..

In the LFa1 the Werk is 500

in the Eine the Werk is 100.

The would be no result

Again.

On with way i can get WErks for the selection from Eine

SELECT WERKS ..

FROM LFA1

INTO IT_LFA1

WHERE WERKS IN S_WERKS .

IF SY-SUBRC = 0.

SELECT * FROM EINE

FOR ALL ENTRIES IN IT_LFA1

WHERE INFNR = I_EINE-INFNR

AND EKORG = I_EINE-EKORG AND

WERKS IN S_WERKS .

ENDIF .

Read only

0 Likes
2,181

If there is not plant specific PIR for you vendor for plant 500, then one must be created in order to make the link. It appears that the PIRs were not created for this plant, just the others. The PIR for plant 500 will need to be created.

Regards,

Rich Heilman

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
2,181

You may be able to use transaction code MEMASSIN to do a Mass maintenance of the PIRs to copy from one plant to the other.

Regards,

Rich Heilman

Read only

0 Likes
2,181

Use EINE-INFNR = EKPO-INFNR to link EKPO to EINE