cancel
Showing results for 
Search instead for 
Did you mean: 

User exit for display of first day in report

Former Member
0 Kudos

Hello friens,

I have to design a query in which my user want to see following way

-


Billed Packs----


-


Week1 Week 2...................week 52

packA

packB

Now user want to see the aggregated bill packs for each week.

And user does not want to see Week numbers , for e.g.

-


Billed Packs----


-


01/20xx 02/20xx 03/20xx ....................

packA

packB

User want to see the Start date of that week which means Date of Monday for each week instead.

Now it is not defined, for how much weeks user want to see , so i created a interval range variable for Week selection.

Now from previous posts i learnt that to display Start date of Monday for each week I HAVE TO CREATE A USER EXIT.

And also create text variable which then i will be using in Description to do the same.

Can you please send me STEP BY STEP for same.

Can all of you please send me Code for creating user exit

Can you please send me some sample codes and sample documents for the same.

My email id is pd.sapbi@gmail.com

Points will be awarded.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

As you said "<i>Now it is not defined, for how much weeks user want to see , so i created a interval range variable for Week selection</i>.", how can you decide about the number of KFs in the structures?? (Because u'll have to create as many text variables as the no. of weeks)

<b>But if that is not the case, following are the steps -


1. Go to cmod to create customize project.

2. Click on Enhancement Assignment & key in 'RSR00001'

3. Click on Components & double click on the function exit EXIT_SAPLRRS0_001.

4. Here you write the above code before the "Endcase" statement.

5. Repeat the above code for rest of the text variables with slight modification as follows...

insert modification between function module call & filling l_s_range9 --</b>i.e.

<i>CALL FUNCTION 'WEEK_GET_FIRST_DAY'

EXPORTING

WEEK = wa9-low

IMPORTING

DATE = l_fst_day

  • EXCEPTIONS

  • WEEK_INVALID = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.</i>

<b>data: n_fst_day type sy-datum.

clear n_fst_day.

n_fst_day = l_fst_day + 8.

l_s_range9-low = n_fst_day.</b>

<i>l_s_range9-sign = 'I'.</i>

Please assign the points if this is useful.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kartikey,

<i>Sample Code, check for data types and systax....</i>

WHEN '<b><Text Varibale></b>'.

DATA : wa9 LIKE     LINE OF i_t_var_range,
       l_s_range9   TYPE rsr_s_rangesid.
DATA: l_fst_day type sy-datum.

CLEAR l_s_range9.

IF i_step = 2.

  LOOP AT i_t_var_range INTO wa9 WHERE vnam = '<b><week variable></b>'.
    EXIT.
  ENDLOOP.

  IF sy-subrc EQ 0.

      CALL FUNCTION 'WEEK_GET_FIRST_DAY'
  EXPORTING
    WEEK               = wa9-low
 IMPORTING
   DATE               =  l_fst_day
* EXCEPTIONS
*   WEEK_INVALID       = 1
*   OTHERS             = 2
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

    l_s_range9-low =  l_fst_day.
    l_s_range9-sign   = 'I'.
    l_s_range9-opt    = 'EQ'.
    CLEAR wa9.
  ENDIF.

  APPEND l_s_range9 TO e_t_range.
ENDIF.