Skip to Content
0
Former Member
Dec 21, 2007 at 07:35 AM

Code modification to read fixed vendor (Urgent)

138 Views

Hi All,

The below code is basically selecting the fixed vendor as per EORD table for a given material - plant combination. But the issue is for this combination, there can be different fixed vendors but during different times

eg:

Mtl - A, Plant - 1000

Fixed vendor: Vendor1, From 1.1.2000 To 31.12.2003

Fixed vendor: Vendor2, From 1.1.2004 To 31.12.2007

Fixed vendor: Vendor3, From 1.1.2008 To 31.12.2010

So i want to add one more condition, which reads the system date & if the system date lies in-between 1.1.2000 to 31.12.2003, it selects vendor 1 or if the system date lies in between 1.1.2004 to 31.12.2007, then select vendor 2.

So how can i add this condition? The valid from field is EORD-VDATU & the valid to field is EORD-BDATU

Code:

CLEAR: Y_LIFNR, Y_FLIFN, WL_MATNR.

SELECT SINGLE LIFNR FLIFN MATNR FROM EORD INTO (Y_LIFNR, Y_FLIFN,

WL_MATNR)

WHERE MATNR EQ MARC-MATNR

AND WERKS EQ MARC-WERKS

AND FLIFN NE ' '.

Hope my question is clear, await inputs

Vivek