Skip to Content
0
Former Member
Mar 03, 2007 at 04:56 AM

Customer Exit - Help

15 Views

Gurus,

I have created a Customer Exit for "Month to date" calculation, but its not

working and also am getting warning message that "Value is too long for

variable ZCUR_MTD". Am trying to get date range from 03/01/2007 to 03/10/2007

if today is 03/11/2007. Please suggest any changes to the code.

Following is my code;

WHEN 'ZCUR_MTD'.

CLEAR: L_S_RANGE, l_poper, w_gjahr, l_firstpostingdate.

call function 'DATE_TO_PERIOD_CONVERT'

EXPORTING

i_date = sy-datum

i_monmit = '00'

i_periv = 'Z1'

IMPORTING

e_buper = l_poper

e_gjahr = w_GJAHR

EXCEPTIONS

input_false = 1

t009_notfound = 2

t009b_notfound = 3

others = 4.

check sy-subrc eq 0..

call function 'FIRST_DAY_IN_PERIOD_GET'

EXPORTING

i_gjahr = w_GJAHR

i_monmit = '00'

i_periv = 'Z1'

i_poper = l_poper

IMPORTING

e_date = l_firstpostingdate

EXCEPTIONS

input_false = 1

t009_notfound = 2

t009b_notfound = 3

others = 4.

IF SY-SUBRC EQ 0.

move l_firstpostingdate to L_S_RANGE-LOW.

L_S_RANGE-HIGH = sy-datum - 1.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

APPEND L_S_RANGE TO E_T_RANGE.

ENDIF.

Thanks a ton..

Message was edited by:

Geni Sap