cancel
Showing results for 
Search instead for 
Did you mean: 

Needs to create u0091customer exitu0092 in a variable

Former Member
0 Kudos

Hi Experts,

Issue: Needs to create ‘customer exit’ in a variable.

Query build on a Cube.

In that query the time dimension is the YEAR. (‘period’ will gives the value for whole year (Not for specific months).)

When we are in January 2008, the report must display the data of year 2007.

When we are in the other months( from Feb'08), the report must display the data of 2008.

Here we are trying to create “customer exit” on “Period” Variable, for the query.

Let me say like this for Example:

‘Date’ = Sy_datum {Assume date is 20080129}

'Year' = 'Date'(4) {here ‘4’ calls value of the year 2008}

'Month' = 'Date'+4(2) {here ‘2’ calls value of the month 01}

If 'Month' EQ '01'

0calyear = 'year' -1

Else

0calyear = 'year'

End if.

I feel the logic mentioned above is correct.But I need the structured ABAP code for this.

Please do the needful and let me give your valuable solution regarding the particular issue.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Private_Member_9643
Active Contributor
0 Kudos

Create a customer exit variable say 'ZCALY', and write this code for i_step = 1. It will populate the value for 0CALYEAR automatically.

CASE i_vnam.

WHEN 'ZCALY'.

IF i_step = 1.

CLEAR l_s_range.

t_date = sy-datum.

t_year = t_date+0(4).

t_mon = t_date+4(2).

if t_mon = '01'.

l_s_range-low = t_year - 1.

else.

l_s_range-low = t_year.

endif.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.

ENDIF.

WHEN OTHERS.

ENDCASE.

Answers (1)

Answers (1)

Former Member
0 Kudos

thanks