Skip to Content
0
Former Member
Jan 03, 2008 at 07:02 AM

Month Range from Single Month Entry

16 Views

Hi Gurus,

In a particular query, the mandatory input is 0calmonth. Variable used is 0PCALMON.

When user inputs 12.2007, then during runtime one of the keyfigure i need to calculate is quarter quantity for the month range 10.2007 to 12.2007 as 12.2007 falls in this quarter.

Similarly if user inputs 03.2008, quarter quantity will be for these months 01.2008 to 03.2008.

have written this code in cmod and activated.

when 'ZMQ_RNG'.

Data : ZYear(4) .

Data : ZMon(2) type N .

loop at i_t_var_range into loc_var_range

where vnam = '0PCALMON'.

clear l_s_range.

l_s_range-sign = 'I'.

l_s_range-opt = 'BT'.

ZYear = loc_var_range-low(4) .

ZMon = loc_var_range-low+4(2) .

If ( ZMon = '04' or ZMon = '05' or ZMon = '06' ) .

l_s_range-high+4(3) = '06' .

l_s_range-high(4) = ZYear .

l_s_range-low+4(3) = '04' .

l_s_range-low(4) = ZYear .

Endif .

If ( ZMon = '07' or ZMon = '08' or ZMon = '09' ) .

l_s_range-high+4(3) = '09' .

l_s_range-high(4) = ZYear .

l_s_range-low+4(3) = '07' .

l_s_range-low(4) = ZYear .

Endif .

If ( ZMon = '10' or ZMon = '11' or ZMon = '12' ) .

l_s_range-high+4(3) = '012' .

l_s_range-high(4) = ZYear .

l_s_range-low+4(3) = '010' .

l_s_range-low(4) = ZYear .

Endif .

If ( ZMon = '01' or ZMon = '02' or ZMon = '03' ) .

l_s_range-high+4(3) = '03' .

l_s_range-high(4) = ZYear .

l_s_range-low+4(3) = '01' .

l_s_range-low(4) = ZYear .

Endif .

append l_s_range to e_t_range.

exit.

endloop.

ZMQ_RNG variable is customer exit, not ready for input, and mandatory field whereas oPcalmon variable is user entry, ready for input, mandatory.

I have a RKF with 0CALMONTH restricted with ZMQ_RNG on quantity. free characteristics i have ocalmonth with variable 0pcalmon.

Still my RKF doesnot calculate quantities for the 3 month range..

Plz help.

Rgrds,

Thanks in advance.

Vaishnavi.