cancel
Showing results for 
Search instead for 
Did you mean: 

Need to show amount with increment of one month.

Former Member
0 Kudos

Hi All,

I need help to show the following info as shown below. I am using 0CALMONTH as input and using variable to take range like 06.2009 - 07.2010.

Now I have two columns to show Key figure amount value. I am using 0CALMONTH on 1st column to restirct with imput value.

However, in 2nd column I need to show the same amount but increment with one month.

Date Column A Column B

06.2009 $100 $200

07.2009 $200 $300

08.2009 $300 $400

09.2009 $400 etc..

Please let me know how can I show the $200 onward amount in Column B.

Thanks for the help.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi NayyerIqbal ,

I think there are two solutions :

1) Restrict your second key figure also with 0calmonth with user entry variable with interval . But give an offset of +1 in it .

I have not tried the above solution . But i think it should work ,

2) through Customer code :

You can use the following logic :

Make a customer exit variable on 0calmonth which is used to restrict 2nd key figure .

Suppose your customer exit variable is :ZCE_MONTH.

Suppose your user entry variable on 0calmonth is : ZUE_MONTH

This variable should be mandatory and ready for input checkbox should be deselected. Its hould be of type interval.



data: calmonth_low(6) type c,
          calmonth_high(6) type c,
         year_low(4) type c,
          year_high(4) type c,
         mon_low(2) type c,
          mon_high(2) type c.

WHEN 'ZCE_MONTH'.

IF I_STEP = 2.
loop at i_t_var_range into loc_var_range where vnam = ZUE_MONTH.

calmonth_low = loc_var_range-low.
calmonth_high = loc_var_range-high.


endloop.

year_low = calmonth_low+0(4).
mon_low = calmonth_low+4(2).

year_high = calmonth_high+0(4).
mon_high = calmonth_high+4(2).

if mon-low = 12.
mon_low = '01'.
year_low = year_low + 1.
else.
mon_low = mon_low + 1.
endif.

if mon-high = 12.
mon_high = '01'.
year_high = year_high + 1.
else.
mon_high = mon_high + 1.
endif.


concatenate year_low mon_low into calmonth_low.
concatenate year_high mon_high into calmonth_high.

clear l_s_range.
l_s_range-low = calmonth_low.
l_s_range-high = calmonth_high.
L_S_RANGE-SIGN = 'I'. 
L_S_RANGE-OPT = 'EQ'. 

append l_s_range to e_t_range.

endif.

Kindly get the above code checked by an ABAPer for any syntax mistakes also .

Hope the above reply was helpful.

Kind Regards,

Ashutosh Singh

Edited by: Ashutosh Singh on May 15, 2011 9:11 PM