Periv and Monmit for calculating posting dates from fiscal period
i am taking fiscal period and fiscal year as input from selection screen.
here i am supposed to find the range of posting date when fiscal period and year is given. i am using the function modules FIRST_DAY_IN_PERIOD_GET and LAST_DAY_IN_PERIOD_GET to get the range.
but both the function modules ask for two more inputs. MONMIT and PERIV i.e. first day of second period (which is 00 by default) and fiscal year varint respectively.
what does these two variables mean? are they dependent on company codes (bukrs)?
does the MONMIT change depending on PERIV or BUKRS? my seniors suggested me table T001 and T093C. i can find PERIV from T001 but, does MONMIT change depending on BUKRS or PERIV?
please provide the details on how to get them...
thanks in advance
Check this may be helpful
CALL FUNCTION 'SD_GET_KOKRS_BUKRS_FROM_WERKS' EXPORTING i_werks = p_werks i_gsber = ' ' IMPORTING e_bukrs = v_bukrs e_kokrs = v_kokrs EXCEPTIONS plant_not_valid = 1 valuation_area_not_valid = 2 no_kokrs_found = 3 OTHERS = 4.
First go for this FM to fill to get fl_tka01
CALL FUNCTION 'CO_TA_TKA01_READ' EXPORTING kokrs_imp = v_kokrs IMPORTING struct = fl_tka01 EXCEPTIONS not_found = 1 OTHERS = 2.
Check this for 1st FM -
DATA : v_gjahr LIKE t009b-bdatj, v_poper LIKE t009b-poper, v_first_day LIKE scal-date. DATA: BEGIN OF fl_tka01. INCLUDE STRUCTURE tka01. DATA: END OF fl_tka01. * determine the first day of the period CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET' EXPORTING i_gjahr = v_gjahr * I_MONMIT = 00 i_periv = fl_tka01-lmona i_poper = v_poper IMPORTING e_date = v_first_day EXCEPTIONS input_false = 1 t009_notfound = 2 t009b_notfound = 3 OTHERS = 4.
*- Getting Last day
CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET' EXPORTING i_gjahr = v_gjahr * I_MONMIT = 00 i_periv = fl_tka01-lmona i_poper = v_poper IMPORTING e_date = v_edate1 EXCEPTIONS input_false = 1 t009_notfound = 2 t009b_notfound = 3 OTHERS = 4.
Edited by: Raj on Jun 12, 2008 2:46 PM
Edited by: Raj on Jun 12, 2008 2:47 PM
Edited by: Raj on Jun 12, 2008 2:48 PM