on 09-29-2008 9:41 PM
I need to calculate the Month to date and Year to date from my fiscal calendar, if the end date is given as a variable user input.
Eg.,
If my end date variable1 --> was 01Aug 07 and end date 2 --> 01Aug 08
Output
AUG 08 AUG 07 VAR
$400 $500 $100
Pls send me your insights!!
Hi,
Please follow the following steps for MTD:
1.You can create a variable on Calendar Day which is of type "manual Input/default values".In the "Details tab check-"Mandatory" and it should be of type "single value".
Say variable name is ZDAY.
Now you can restrict your query with this variable.
So you would get a screen where the user can enter a date.
2.Now create another variable on Calendar Year/Month which is of type "Customer Exit".In the "Details" tab check-"Mandatory" and it should be of type "single value".
Say variable name is ZMTD.
3.You can create a restricted keyfigure using your keyfigure and restricting it with ZMTD.
4.Go to CMOD-->Proceed to your customer exit code and you can add this code:
******************************************************
when 'ZMTD'.
data: loc_var_range LIKE RRRANGEEXIT,
d type sy-datum.
If i_step = 2.
loop at i_t_var_range into loc_var_range where vnam = 'ZDAY' .
d = loc_var_range-low(6).
clear ra_l_s_range.
ra_l_s_range-low = d.
ra_l_s_range-high = d.
ra_l_s_range-sign = 'I'.
ra_l_s_range-opt = 'EQ'.
APPEND RA_L_S_RANGE TO E_T_RANGE.
endloop.
endif.
*******************************************************
Similarly you can create another variable on calendar year for YTD and use it in the restriction for keyfigure.
You can also refer the link:
<<https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a>>
Thanks,
Divya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
SAP has provide the YTD variables check it ( can't remember the name right now).
Best Regards,
Hima
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.