cancel
Showing results for 
Search instead for 
Did you mean: 

variable- customer exit

Former Member
0 Kudos

Hai,

I have written a customer exit for a variable to calculate period from given date....When i have tried to execute the query in query monitor.I am getting an error message "AError for variable in customer enhancement". What could be possible solution for this problem guys???

Thanks and regards

sai ram phani

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Sairam,

Can you please give me detailed steps how to write customer exit for a variable? I am stuck here to create customer exit. Your help is greatly appreciated.

Regards,

Jyoti

Former Member
0 Kudos

WHEN 'ZCRYYTDP'.

IF I_STEP = 2.

  • to get first to current fisical period.

READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE with key VNAM =

'ZREPDTE'.

curr_date = LOC_VAR_RANGE-LOW.

curr_year = LOC_VAR_RANGE-LOW+0(4).

CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'

EXPORTING

I_DATE = curr_date

  • I_MONMIT = 00

I_PERIV = 'K4'

IMPORTING

E_BUPER = l_period.

  • E_GJAHR =

  • EXCEPTIONS

  • INPUT_FALSE = 1

  • T009_NOTFOUND = 2

  • T009B_NOTFOUND = 3

  • OTHERS = 4

clear L_S_RANGE.

Concatenate curr_year '001' into L_S_RANGE-LOW.

Concatenate curr_year L_PERIOD into L_S_RANGE-HIGH.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

APPEND L_S_RANGE TO E_T_RANGE.

clear: curr_year, curr_date, l_period.

ENDIF.

guys the code is above........

Former Member
0 Kudos

did u test your exit code first.

to test it( u might already know this), take the code in a se38 test program and do a check, compile and execute.

use the 'write' to look at the results.

if all that is fine.

make sure you code follows the template of writing the customer exit for a variable.

sample code:

when 'ZP_TXFPE'.

  • break-point.

clear: g_fiscper.

SELECT SINGLE * FROM /bic/pzrpt_grp

where /bic/zrpt_grp = 'TAX'.

if sy-subrc eq 0.

g_fiscper = /bic/pzrpt_grp-fiscper.

endif.

IF g_fiscper IS INITIAL.

  • l_fiscyear = g_fiscper(4).

  • l_fiscper3 = g_fiscper+4(3).

  • ELSE.

CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'

EXPORTING

i_date = sy-datum

i_periv = 'SP'

IMPORTING

e_buper = l_fiscper3

e_gjahr = l_fiscyear

EXCEPTIONS

input_false = 1

t009_notfound = 2

t009b_notfound = 3

OTHERS = 4

.

IF sy-subrc <> 0.

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

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

ENDIF.

    • Get the previous period ie., closed period before current one.

l_fiscper3 = l_fiscper3 - 1.

IF l_fiscper3 = 0.

l_fiscper3 = 12.

l_fiscyear = l_fiscyear - 1.

ENDIF.

CONCATENATE l_fiscyear l_fiscper3 INTO g_fiscper.

ENDIF.

CLEAR l_s_range.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

l_s_range-low = g_fiscper.

APPEND l_s_range TO e_t_range.

if possible post your code here. and also check for sm21 / st22 for any error messages,so that we can understand it better.

did u check the fm DATE_TO_PERIOD_CONVERT ?

hope this helps. Assign points if helpful.

Regards,

BWer

Former Member
0 Kudos

Have a look at this:

Regards