cancel
Showing results for 
Search instead for 
Did you mean: 

Customer Exit For Variables

Former Member
0 Kudos

Hi Experts,

I am getting an error while using a varible created by customer exit.

The Requirement is that when the user entered the date value in the 0CALDAY,it will display the

data from the 1st date of the month to the date entered in the selection.(single entry)

I am using the field 0CALDAY on which created a variable ZCMTD1(by customer exit).

when running the report,it is displaying only the value of the same date.

Please any body can check and give me the idea so that i can proceed.

i have written the below codes....

DATA: L_S_RANGE TYPE RSR_S_RANGESID.

CASE I_VNAM.

WHEN 'ZCMTD'.

data: ZCMTD_LOW like sy-datum.

ZCMTD_LOW = sy-datum.

ZCMTD_LOW+6(2) = '01'.

CLEAR L_S_RANGE.

L_S_RANGE-LOW = ZCMTD_LOW.

L_S_RANGE-HIGH = SY-DATUM.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

APPEND L_S_RANGE TO E_T_RANGE.

IF I_STEP = 1.

RAISE NO_PROCESSING.

ENDIF.

ENDCASE.

Regards

Debasish

Accepted Solutions (1)

Accepted Solutions (1)

mansi_dandavate
Active Contributor
0 Kudos

Make the following changes and try...

also chk once if the customer exit variable you are using is a range variable and not a single value...

DATA: L_S_RANGE TYPE RSR_S_RANGESID.

CASE I_VNAM.

WHEN 'ZCMTD'.

data: ZCMTD_LOW(6) type n.

concatenate sy-datum0(4) sy-datum4(2) '01' into ZCMTD_LOW.

CLEAR L_S_RANGE.

L_S_RANGE-LOW = ZCMTD_LOW.

L_S_RANGE-HIGH = SY-DATUM.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

APPEND L_S_RANGE TO E_T_RANGE.

IF I_STEP = 1.

RAISE NO_PROCESSING.

ENDIF.

ENDCASE.

Edited by: mansi dandavate on Jun 3, 2009 11:41 AM

Former Member
0 Kudos

Hi Mansi,

I have taken the variable as single entry if i will create it as selection range then I think its not required to go for customer exit.

i am having ocalday as a single entry,for examply if you enter date 06-05-08,then it has to display

the values from 01-05-08 to 06-05-08.

So please guide me how to proceed.

Regards

Debasish

Former Member
0 Kudos

Define offset for the variable with range and give range as

-31 and 0.Then it will display values of one month.

No need of customer Exit for it if user enters the date.

Edited by: sujatha on Jun 3, 2009 4:31 PM

Former Member
0 Kudos

Hi Debasish,

First of all some basics for variable exit:

1. You canu2019t overwrite user inpit, you can just derive other variables from it.

2. this happen at I_step = 2 (after the variable pop up)

Therefore you should use e.g.. content variable 0I_DAYWT for input of IO =CALDAY.

Restrict it to a 'dummy' RKf, just to make it available in variable pop up. Then hide RKF.

Define ZCMTD as interval.. Based on this try following code:

WHEN 'ZCMTD'.
    IF I_STEP = 2.
      LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
              WHERE VNAM = '0I_DAYWT'.
        CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
    L_S_RANGE-LOW+6(2) = '01'.
    L_S_RANGE-HIGH     = LOC_VAR_RANGE-LOW.
    L_S_RANGE-SIGN     = 'I'.
    L_S_RANGE-OPT      = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
  ENDLOOP.
ENDIF.

Regards

Joe

Former Member
0 Kudos

Hi Joe,

i am taking the field 0CALDAY

mansi_dandavate
Active Contributor
0 Kudos

Hi Debashish,

You need to take one variable as user input which will be single entry and then one variable for customer exit which will be a range variable...

You cant do this using a single variable..

The code which you have written you are reading ZCMTD and again modifying it in exit..

But since its a single value variable it is showing you only the value of sy-datum

Edited by: mansi dandavate on Jun 4, 2009 8:16 AM

Former Member
0 Kudos

Hi Joe,

I am taking the field 0CALDAY for calender day entry,but for that i can use the variable 0I_DAYWT.

i am unable to understand how to Restrict it to a 'dummy' RKf and how to hide RKF.

could you please explain little bit so that i can proceed.

Thank you for your valuable solution.

Thanks & Regards

Debasish

mansi_dandavate
Active Contributor
0 Kudos

Right click on key figure structure and create new selection.

Drag any key figure and the variable.

Now in the properties of the key figure Choose Display --> Always hide.

Thus you can use the 0I_DAYWT as user entry reference and then calculate the range in the ZCMTD variable by reading in the exit.

Edited by: mansi dandavate on Jun 4, 2009 8:23 AM

Former Member
0 Kudos

Hi Debasish,

Mansi descibes the procedure to create and hide the keyfigure in a fine way.

Reason for use:

If you restrict query just using variable 0I_DAYWT in global filters or free charcateristics,

only records will pass with date matching the user entry to this variable. Exit variable ZCMTD will

not affect any selection in this case. Using variable 0I_DAYWT in a RKF only affects this

key figure and selections and/or restrictions with variable ZCMTD will provide expected

values.

Regards

Joe

Answers (0)