Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
Read only

User Exit Problem

Former Member
0 Likes
321

Hi,Gurus~

Is there anyone who can help me out?

In order to describe my requirement clearly,here's an example.

If today is 8/1,i have to give the forecast amount of July.

If today is 7/31,i also have to give the  forecast amount of July.

Below is the user exit that i added into ZXRSRU01 (Customer Exit Global Variables in Reporting)

I can attach more information if you need!


------------------------------------------------------------------

WHEN 'ZMON_YESTERDAY'.

    CLEAR l_s_range.

    day1 = sy-datum - 1.

    l_s_range-low = day1.

    l_s_range-sign = 'I'.

    l_s_range-opt = 'EQ'.

    APPEND l_s_range TO e_t_range.

    IF i_step = 1.

      CLEAR l_s_range.

      day1 = sy-datum - 1.

      l_s_range-low = day1.

      l_s_range-sign = 'I'.

      l_s_range-opt = 'EQ'.

      APPEND l_s_range TO e_t_range.

    ENDIF.

    IF i_step = 2 OR i_step = 3.

      READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'Zyesterday'.

      IF sy-subrc = 0 AND loc_var_range-low(8) = '99991231'.

        CLEAR l_s_range.

        day1 = sy-datum - 1.

        l_s_range-low = day1.

        l_s_range-sign = 'I'.

        l_s_range-opt = 'EQ'.

        APPEND l_s_range TO e_t_range.

      ENDIF.

    ENDIF.

--------------------------------------------------------------------

1 REPLY 1
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
300

Hello Ninja.

As per my observation, only one thing you have to do.

1) Check sy-datum (YYYYMMDD) value.

     if sy-datum+6(2) = '01' "First date of month

          YOUR BUSINESS LOGIC- Fetch previous month report. "tmp_date = sy-datum - 1; month = tmp_date+4(2)

     endif.

Regards.