cancel
Showing results for 
Search instead for 
Did you mean: 

postiong date variable should run report only for that month

Former Member
0 Kudos
68

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Yes, you can do it by deriving and assigning this interval in user-exit.

Former Member
0 Kudos

Ajay,

Instead of posting date if we use 0calmonth for current month than also it work the same way right ?

and that will avoid us writing user exit and stuff?

What do you say ?

Thanks,

KM

Former Member
0 Kudos

That is correct, ie if your posting date is going into 0calday (and not as a non-time characteristic).

Former Member
0 Kudos

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!