Skip to Content
0
Former Member
Apr 16, 2010 at 02:18 PM

fetch data based on year and period

69 Views

Hi,

I want to fetch all entries for year and period less than entered in parameters as below.

SELECT rprctr racct matnr hsl

FROM glpca

INTO TABLE git_glpca_2

WHERE rbukrs = p_bukrs

AND ( ryear LE p_gjahr )

AND poper <= p_perio

AND racct = p_hkont2

AND rprctr IN s_prctr2.

Suppose user entered period as 6 and year 2010 then if there are entries with 2009 it will take from period 6 but it should take all periods of 2009 and less than or equal to 6 for 2009.

Kindly advice.

Rgds