Fiscal Year - Help needed
I am in ECC 6.0. My Company has a 4-4-5 calender. In my selection screen, I have to default the current and previous fiscal year. For that I have called the below function module. Everything is good. But when I do a extended code check it says
"Current ABAP Command is Obselete. An explicit work area is necessary in the 00 context. use "append wa to s_gjahr [sorted by]"
Can anyone suggest me how to write the code so that my error will be solved.
DATA: lv_poper TYPE poper, "Fiscal Period
lv_gjahr TYPE gjahr. "Fiscal Year
*Get current fiscal year
CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
i_date = sy-datum
i_periv = gc_fiscal_variant
e_buper = lv_poper
e_gjahr = lv_gjahr
input_false = 1
t009_notfound = 2
t009b_notfound = 3
OTHERS = 4.
CHECK sy-subrc = 0.
*Get previous fiscal year
s_gjahr-low = lv_gjahr - 1.
s_gjahr-high = lv_gjahr.
s_gjahr-sign = 'I'.
s_gjahr-option = 'BT'.
ENDFORM. " SET_DEFAULT_FISCAL_YEAR
While using select single you need to use full key in the where clause
Here in CSKT you missed in the primary key field DATBI and in CSKU you missed field KTOPL
and the messages from SLIN is are warning and not errors