I am still struggling with making this work. Below is the code I have in the routine.
1. l_t_range-fieldname is in the code beginning and end. Should these be blank or FISCPER?
2. should l_t_range-iobjnm be 0FISCPER?
Code Below
*&---------------------------------------------------------------------*
*& Include RSBC_SEL_ROUTINE_TPL
*&---------------------------------------------------------------------*
program conversion_routine.
* Type pools used by conversion program
type-pools: rsarc, rsarr, rssm.
tables: rssdlrange.
* Global code used by conversion rules
*$*$ begin of global - insert your declaration only below this line *-*
* TABLES: ...
* DATA: ...
*$*$ end of global - insert your declaration only before this line *-*
* -------------------------------------------------------------------
* Fieldname = F46
* data type = NUMC
* length = 000007
* -------------------------------------------------------------------
form compute_F46
tables l_t_range structure rssdlrange
using i_r_request type ref to IF_RSBK_REQUEST_ADMINTAB_VIEW
i_fieldnm type RSFIELDNM
changing p_subrc like sy-subrc.
* Insert source code to current selection field
*$*$ begin of routine - insert your code only below this line *-*
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = ' '.
l_idx = sy-tabix.
break-point.
DATA: w_curper TYPE /bi0/oifiscper,
w_preper TYPE /bi0/oifiscper,
w_month(3) TYPE n,
w_year(4) TYPE n,
w_buper TYPE t009b-poper,
w_gjahr TYPE t009b-bdatj.
CLEAR: w_curper, w_year, w_month,w_preper .
CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
EXPORTING
i_date = sy-datum
* I_MONMIT = 00
i_periv = 'K9'
IMPORTING
e_buper = w_buper
e_gjahr = w_gjahr
* EXCEPTIONS
* INPUT_FALSE = 1
* T009_NOTFOUND = 2
* T009B_NOTFOUND = 3
* OTHERS = 4
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
CONCATENATE w_gjahr w_buper INTO w_curper.
w_year = w_curper+0(4).
w_month = w_curper+4(3).
IF w_month = 01.
w_month = 12.
w_year = w_year - 1.
CONCATENATE w_year w_month INTO w_preper .
ELSE.
w_month = w_month - 2. "was originally -8
CONCATENATE w_year w_month INTO w_preper .
ENDIF.
l_t_range-fieldname = ' '.
l_t_range-sign = 'I'.
l_t_range-iobjnm = '0FISCPER'.
l_t_range-option = 'BT'.
l_t_range-low = w_preper.
l_t_range-high = w_curper.
APPEND l_t_range.
*....
* if l_idx <> 0.
* modify l_t_range index l_idx.
* else.
* append l_t_range.
* endif.
p_subrc = 0.
*$*$ end of routine - insert your code only before this line *-*
endform.