on 08-27-2015 3:21 PM
Hi,
In data-model I have 0CALMONTH. Dependent of system date the result of Exit should be range from first month of year - last month of current year + 2.
1. Example: Sys. Date: 27th of August 2015: Result: 01.2015 - 12.2017
2. Example: Sys. Date: 03rd of March 2016: Result: 01.2016 - 12.2018
Can s.b. provide code sample for function module. Thanks in advance.
Hi,
Create a variable to your 0CALMONTH with CUSTOMER EXIT as its processing by and has an INTERVAL option, let's call your variable VAR_RANGE..
Do this in CMOD:
data: zstart(6) type c,
zend(6) type c,
zyear(4) type c.
WHEN 'VAR_RANGE'.
zyear = sy-datum(4) + 2.
concatenate sy-datum(4) '01' into zstart.
concatenate zyear '12' into zend.
L_S_RANGE-LOW = zstart.
L_S_RANGE-HIGH = zend.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
endif.
Regards,
Loed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.