on 10-13-2006 6:34 PM
Hello all,
I have a report which should give detail transaction for that particular month when run at the end of the month. right now I am giving posting date as the variable as Day Interval and the user inputs the start and end date.
Is there any way we can make it that when it is run at the end of month it should take the value for 1st of month and final day of month?
Thanks,
KM
Yes, you can do it by deriving and assigning this interval in user-exit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First logic->
Create a variable of User-entry (ZPOSTDATE)for user to enter the start and end date. Now you want the report runs for first and last date of the month.so we have derive the value of month and then use a function module to get the
1)Create a Variable of type Customer Exit on posting date with inetrval value. Name as ZCEPDT
2)Enter Tcode CMOD in BW.
3)Write ABAP code to derive first and last day of the month.
Try with this code.
&----
*& Include ZXRSRU01 *
&----
DATA: loc_var_range LIKE rrrangeexit.
DATA: l_s_range TYPE rsr_s_rangesid.
DATA: zmonth(2) type char, zday (2) type char.
DATA: zdate like sy-datum 'check sytnax
CASE i_vnam.
*********************************************************************
*********************************************************************
WHEN 'ZCEPDT'.
IF i_step = 2. "after the popup
LOOP AT i_t_var_range INTO loc_var_range
WHERE vnam = 'ZPOSTDATE'.
CLEAR l_s_range.
zmonth = loc_var_range-low+4(2).
'14.10.2006 then zmonth= 10
zday = '01' 'first day of month
'concatenate 2006 + 10 + 01
Concatenate loc_var_range(4) zmonth zday to l_s_range-low.
'Now Last day of the month
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
EXPORTING
DAY_IN = loc_var_range-low
IMPORTING
LAST_DAY_OF_MONTH = zdate
EXCEPTIONS
DAY_IN_NOT_VALID.
if sy-subrc eq 0.
l_s_range-HIGH = zdate
endif.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
APPEND l_s_range TO e_t_range.
ENDLOOP.
ENDIF.
ENDCASE.
***********************************
any issues, revert back.
Regards,
San!
User | Count |
---|---|
83 | |
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.