Skip to Content
author's profile photo Former Member
Former Member

postiong date variable should run report only for that month

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?



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2006 at 06:02 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      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 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



      DAY_IN = loc_var_range-low


      LAST_DAY_OF_MONTH = zdate



      if sy-subrc eq 0.

      l_s_range-HIGH = zdate


      l_s_range-sign = 'I'.

      l_s_range-opt = 'BT'.

      APPEND l_s_range TO e_t_range.





      any issues, revert back.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.