Skip to Content
0
Former Member
Jul 13, 2015 at 12:26 PM

Last 6 months from user entered date. Customer exit I_STEP=2

476 Views

Hi Friends,

I got to work on customer exit where if user enters a date like 7th july 2015 , he should get the data of last 6 months. So i did I_STEP =2. I wrote a code, Syntax looks fine but when i execute, it is throwing an error. Screenshot attached.

Procedure:

I created a Manual entry variable on Creation Date. SAY "ZDATE_ENTRY"

I also created a Customer exit on same creation date. SAY "ZEXIT_DATE"

I added Customer exit variable to the Creation date and for manual entry i created a dummy selection and added a key figure and added the Creation date and Restricted it with Manual entry variable of Creation date.

Code:

DATA: Month (2) TYPE N,

Month1 (2) TYPE N,

day (2) type n,

l_s_range1 TYPE rrrangesid,

loc_var_range1 LIKE rrrangeexit,

LV_DATA1 TYPE SY-DATUM.

CASE I_VNAM.

WHEN 'ZEXIT_DATE'.

IF I_STEP = 2.

LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE1 WHERE vnam = 'ZDATE_ENTRY'.

Month = LOC_VAR_RANGE1+4(2).

Month1 = Month - 6.

Day = LOC_VAR_RANGE1+6(2).

CONCATENATE LOC_VAR_RANGE1+0(4) Month1 day INTO LV_DATA1.

l_s_range1-LOW = LV_DATA1.

l_s_range1-HIGH = LOC_VAR_RANGE1-LOW.

l_S_range1-SIGN = 'I'.

l_S_range1-OPT ='BT'.

Append l_s_range1 to E_T_RANGE.

ENDLOOP.

ENDIF.

ENDCASE.


Error screenshot:


Thanks,

Ramarao.

Attachments

l6 error.png (145.0 kB)