cancel
Showing results for 
Search instead for 
Did you mean: 

Customer exit for a Characteristic variable

Former Member
0 Kudos

Hi Guys,

Can anybody tell me, can we write a customer exit variable in other Z* function module rather than writting in the INCLUDE ZXRSRU01. ?

I mean can we create our own Function module for customer exit? if yes how can query will call that module for the variable?

Pleae reply in detail.

Thanks.

Harshal

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

myself

Former Member
0 Kudos

Hi Harshal,

You will have to call the FM in ZXRSRU01 ..I am not aware of any other way of processing a customer exit variable...

Is there a particular reason you are trying to avoid ZXRSRU01.

Ashish.

Former Member
0 Kudos

Yeah Ashish,

The reason is here there are some customer exits for variable, they are written in Z* Function modules not the one in INCLUDE ZXRSRU01. I have to change the code, and find out how they are being called from query. I dont understand why the hek they written there.

Thanks.

Former Member
0 Kudos

Have you checked ZXRSRU01. Are they calling the FM from ZXRSRU01..Can you check that...because we have a way of calling FMs from ZXRSRU01 based on naming conventions..

Ashish...

Former Member
0 Kudos

My Include ZXRSRU01 is like this

&----


*& Include ZXRSRU01

&----


*"----


""Local Interface:

*" IMPORTING

*" VALUE(I_VNAM) TYPE RSZGLOBV-VNAM

*" VALUE(I_VARTYP) TYPE RSZGLOBV-VARTYP

*" VALUE(I_IOBJNM) TYPE RSZGLOBV-IOBJNM

*" VALUE(I_PERIV) TYPE RRO01_S_RKB1F-PERIV

*" VALUE(I_T_VAR_RANGE) TYPE RRS0_T_VAR_RANGE

*" VALUE(I_STEP) TYPE I DEFAULT 0

*" EXPORTING

*" VALUE(E_T_RANGE) TYPE RSR_T_RANGESID

*"----


DATA:v_function LIKE rs38L-name.

data:v_active LIKE rs38L-global.

CASE i_vnam.

WHEN OTHERS.

CONCATENATE 'ZVAREXIT_' i_vnam INTO v_function.

CALL FUNCTION 'RS_FUNCTION_ACTIVE_CHECK'

EXPORTING

funcname = v_function

IMPORTING

active = v_active

EXCEPTIONS

not_found = 1

OTHERS = 2.

IF v_active = 'X'.

CALL FUNCTION v_function

EXPORTING

i_vnam = i_vnam

i_vartyp = i_vartyp

i_iobjnm = i_iobjnm

I_S_COB_PRO = I_S_COB_PRO

I_S_RKB1D = I_S_RKB1D

i_periv = 'K4'

i_t_var_range = i_t_var_range

i_step = i_step

IMPORTING

e_t_range = e_t_range

EXCEPTIONS

unknown_variable = 1

unexpected_vartype = 2

invalid_periv = 3

variable_initial = 4

no_replacement = 5

OTHERS = 6.

ENDIF.

ENDCASE.

****************************************************************

******************************************************************

*******************************************************************

And the Z* Function Module, which is written in SE37 is like this...

*FUNCTION ZVAREXIT_ZVDATE.**"-

-


""Local Interface:

*" IMPORTING

*" VALUE(I_VNAM) TYPE RSZGLOBV-VNAM

*" VALUE(I_VARTYP) TYPE RSZGLOBV-VARTYP

*" VALUE(I_IOBJNM) TYPE RSZGLOBV-IOBJNM

*" VALUE(I_S_COB_PRO) TYPE RSD_S_COB_PRO

*" VALUE(I_S_RKB1D) TYPE RSR_S_RKB1D

*" VALUE(I_PERIV) TYPE RRO01_S_RKB1F-PERIV

*" VALUE(I_T_VAR_RANGE) TYPE RRS0_T_VAR_RANGE

*" VALUE(I_STEP) TYPE I DEFAULT 0

*" EXPORTING

*" VALUE(E_T_RANGE) TYPE RSR_T_RANGESID

*"----


TYPES:BEGIN OF t_cal,

/BIC/ZDATE TYPE /BIC/AZCALDSO00-/BIC/ZDATE,

CALMONTH2 TYPE /BIC/AZCALDSO00-CALMONTH2,

CALYEAR TYPE /BIC/AZCALDSO00-CALYEAR,

/BIC/ZCDAY TYPE /BIC/AZCALDSO00-/BIC/ZCDAY,

/BIC/ZCMON TYPE /BIC/AZCALDSO00-/BIC/ZCMON,

/BIC/ZCMON_1 TYPE /BIC/AZCALDSO00-/BIC/ZCMON_1,

/BIC/ZCMON_2 TYPE /BIC/AZCALDSO00-/BIC/ZCMON_2,

/BIC/ZCMON_3 TYPE /BIC/AZCALDSO00-/BIC/ZCMON_3,

END OF t_cal.

DATA:tb_cal TYPE STANDARD TABLE OF t_cal WITH HEADER LINE,

wa_cal LIKE LINE OF tb_cal.

DATA: L_S_RANGE TYPE RSR_S_RANGESID.

DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.

Data: v_loc_date type d.

Data: v_data type p.

DATA: v_month TYPE /BIC/AZCALDSO00-CALMONTH2,

v_year TYPE /BIC/AZCALDSO00-CALYEAR.

Data: v_offset type i.

DATA: ZDAYS TYPE D.

v_loc_date = sy-datum.

V_year = v_loc_date+0(4).

v_month = v_loc_date+4(2).

IF v_month EQ '01'.

v_month = '12'.

v_year = v_year - 1.

ELSE.

v_month = v_month - 1.

ENDIF.

CONCATENATE v_year v_MONTH '01' INTO ZDAYS.

SELECT SINGLE /bic/zdate calmonth2 calyear /bic/zcday /bic/zcmon /bic/zcmon_1 /bic/zcmon_2 /bic/zcmon_3

FROM /BIC/AZCALDSO00 INTO CORRESPONDING FIELDS OF wa_cal

WHERE /bic/zdate = sy-datum.

v_data = ( ( wa_cal-/bic/zcday ) * ( wa_cal-/bic/zcmon_1 ) ) / ( wa_cal-/bic/zcmon ).

CALL FUNCTION 'ROUND'

EXPORTING

DECIMALS = 0

input = v_data

SIGN = ' '

IMPORTING

OUTPUT = v_offset.

SELECT SINGLE /BIC/ZDATE

FROM /BIC/AZCALDSO00

INTO v_loc_date

WHERE CALMONTH2 = v_month

AND CALYEAR = v_year

AND /bic/ZCDAY = v_offset.

CLEAR L_S_RANGE.

L_S_RANGE-LOW = ZDAYS .

L_S_RANGE-HIGH = v_loc_date.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'EQ'.

APPEND L_S_RANGE TO E_T_RANGE.

ENDFUNCTION.

Former Member
0 Kudos
CASE i_vnam.
WHEN OTHERS.

CONCATENATE 'ZVAREXIT_' i_vnam INTO v_function.

Looks like they are concatenating the variable name to ZVAREXIT_ and then in the following code calling the FM to calculate the variable values.

CALL FUNCTION 'RS_FUNCTION_ACTIVE_CHECK'
EXPORTING
funcname = v_function
IMPORTING
active = v_active
EXCEPTIONS
not_found = 1
OTHERS = 2.

After checking for the active flag the variable value is calculated in the FM.

IF v_active = 'X'.

CALL FUNCTION v_function
EXPORTING
i_vnam = i_vnam
i_vartyp = i_vartyp
i_iobjnm = i_iobjnm
I_S_COB_PRO = I_S_COB_PRO
I_S_RKB1D = I_S_RKB1D
i_periv = 'K4'
i_t_var_range = i_t_var_range
i_step = i_step
IMPORTING
e_t_range = e_t_range
EXCEPTIONS
unknown_variable = 1
unexpected_vartype = 2
invalid_periv = 3
variable_initial = 4
no_replacement = 5
OTHERS = 6.

So i guess any customer exit variable you create has to be in a FM name starting with ZVAREXIT_ .

If you need to look at existing FMs , try searching for FMs starting with ZVAREXIT_*

Hope it solves your problem..

Ashish...