Hi Experts,
I've written code in DTP routines, for calculating last year period 1 to current year last period
so its 2013001 to 2014016 in field fiscper.
When I'm debugging the code its generating right values but when I executing this then i'm getting error as :-
Incorrect initial value for characteristic 0FISCPER in i_t_range
Message no. DBMAN889
Diagnosis
The specified characteristic is of type NUMC (number as character), DATS (date), or TIMS (time). The initial value of ' ' is incorrect for these data types.
System Response
The call is terminated.
Procedure
Use the correct initial value for the type in the selection condition.
Any help would be appreciated DTP is failing.
code I've written is :-
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = 'fiscper'.
l_idx = sy-tabix.
*break-point.
Data: v_today type sy-datum,
v_fscpr type t009b-poper,
v_fscyr type t009b-bdatj,
* v_year type n length 4,
v_fiscper_plast_cy type /BI0/OIFISCPER,
v_fiscperp1_ly type /BI0/OIFISCPER.
constants: c_p1_ly type t009b-poper value '001',
c_pl_cy type t009b-poper value '016'.
clear:v_fscpr,v_fscyr,v_fiscper_plast_cy,v_fiscperp1_ly.
Refresh:l_t_range.
v_today = sy-datum.
CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
EXPORTING
I_DATE = v_today
* I_MONMIT = 00
I_PERIV = 'z1'
IMPORTING
E_BUPER = v_fscpr
E_GJAHR = v_fscyr.
* 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.
concatenate v_fscyr c_pl_cy into v_fiscper_plast_cy.
v_fscyr = v_fscyr - 1.
concatenate v_fscyr c_p1_ly into v_fiscperp1_ly.
l_t_range-sign = 'I'.
l_t_range-fieldname = 'fiscper'.
l_t_range-iobjnm = '0fiscper'.
l_t_range-option = 'EQ'.
l_t_range-low = v_fiscperp1_ly.
l_t_range-high = v_fiscper_plast_cy.
if l_idx <> 0.
modify l_t_range index l_idx.
else.
append l_t_range.
endif.
p_subrc = 0.