Fiscal period dates
Hi,
How can i get the perid start and end dated by giving month and year.
Can any ine tell me the function module,
and also first and last date from calender by giving the month and year.
Thanks
Hi,
check this below fun module
CALL FUNCTION 'FI_PERIOD_DETERMINE'
EXPORTING
i_budat =
I_BUKRS = ' '
I_RLDNR = ' '
I_PERIV = ' '
I_GJAHR = 0000
I_MONAT = 00
X_XMO16 = ' '
IMPORTING
E_GJAHR =
E_MONAT =
E_POPER =
EXCEPTIONS
FISCAL_YEAR = 1
PERIOD = 2
PERIOD_VERSION = 3
POSTING_PERIOD = 4
SPECIAL_PERIOD = 5
VERSION = 6
POSTING_DATE = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Similar Messages
-
Restricting Calculated KF on Fiscal Period - Data constant 1.00
Hello,
I am using planning and forecasting infocube, where I created Calculated Key Figures , Margin(Actual), Margin(Forecast). They are working fine by themselves but when I restrict Margin(Forecast), it gives me result constant 1.00 and Margin(Actual) result 0.00.
Has anyone came across this problem earlier, please guide how to solve this and where can be the problem ??
Thanks in Advance,
Regards,
JasmiExplain your problem in more detail and with an example.
-
Option to show values up to last closed fiscal period or up to current date
Hello,
How would I create a query that would ask if I want it to calculate values 'up to the current date' or for the 'latest closed fiscal period'.
Currently I have setup a report, within which, has restricted key figures that will give the 'Period to date', 'Year to Date', and 'Last Year Year to Date' values for some RKFs, however, it would be very helpful if this report could be setup so that the user could choose whether the report provides:
1. Values only through the last closed fiscal period
or
2. Values up to the current date.
<b>For example</b> if we are in period 7 of 2006, the user could have the report show all values up to the last closed fiscal period, which in this case would be period 6 of 2006.
Or the user could have the report show all the values up to the current date.
Hopefully I have been clear,
Thanks,
Nick
Message was edited by:
Nick BertzNick,
What is the problem you are facing? As San mentioned you can only report till Last Fiscal Period using Customer Exit Variables(Calculate Current Fiscal Period using Current Month and Fiscal Year Variant).
Or as you mentioned you can create restricted Key Figures using Date or month (YTD etc)
If i miss your requirement, please guide me.
Regards,
Nagesh Ganisetti.
*Assign Points if it helps. -
Current month and previous months of fiscal year period data
Hi All,
My requirement is end user will enter month ie (fiscal year period ) and in report my requiremnt is to show data in two columns 1.Current month data and
2.April till date.
Please let me know how to do this and please send the coding to be done in CMOS.
RegardsHi,
In your query, you should have following object :
in filters:
fiscal period object, with an user entry variable on it (UE_MONTH)
in rows/ratios:
Current month column, with your KF and a restriction on 0calmonth2 with an customer exit variable on it (ie: CE_VAR1)
same for April column. (CE_VAR2)
in your customer exit, CMOD, step 2, add these two cases :
WHEN 'CE_VAR1'.
READ TABLE i_t_var_range WITH KEY vnam = 'UE_MONTH' INTO
intern_range.
CONCATENATE intern_range-low(6) sy-datum+4(2) INTO l_s_range-low.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
Same for April, add a new case and just replace sy-datum+4(2) by '04'.
Hope it helps, -
HOW TO GET FISCAL PERIOD WISE DATA BY GIVING FISCAL YEAR AS INPUT
Hi All,
I am creating a report where input field is FiscYear(0FISCYEAR). My fiscal year is Oct to Sep and 4 spl periods.
If we give input as 2014 (current FY) it has to show all fiscal periods as on date. i.e., Oct’13 to Feb’14. Which should show in columns each period
separately, like Oct 13, Nov’13, …. Feb’14.
If we give 2013, it has to show all fiscal periods separately each period in columns. i.e., Oct’12 to Sep’13.
InfoProvider Data: We have a cube, containing data for 0CALMONTH and Fiscal Year. No fiscperiod in the cube.
Could any one assist here as it’s a bit odd scenario never come across. All your suggestions and assistance are highly appreciable.
Best Regards
Venkat...Hi Anshu,
I am getting the below error when I try to execute in Analyser.
"No value could be determined for variable". Here is my code in CMOD.
*Variables for ESAS Project
DATA: curr_yy TYPE /BI0/OICALYEAR,
input_yy TYPE /BI0/OICALYEAR,
prev_yy TYPE /BI0/OICALYEAR,
zmonth(2) TYPE N.
WHEN 'ZCALMONTH_ESAS'.
IF i_step = 2. "tried with i_step 1 also, same error message is showing
READ TABLE i_t_var_range INTO loc_var_range
WITH KEY vnam = 'ZFISCYEAR_ESAS'.
IF sy-subrc EQ 0.
curr_yy = loc_var_range.
prev_yy = curr_yy - 1.
zmonth = SY-DATUM+4(2).
IF SY-DATUM+0(4) = curr_yy.
CONCATENATE prev_yy '10' into l_s_range-low.
CONCATENATE curr_yy month into l_s_range-high.
ELSEIF prev_yy EQ loc_var_range.
input_yy = loc_var_range.
prev_yy = input_yy - 1.
CONCATENATE prev_yy '10' INTO l_s_range-low.
CONCATENATE input_yy '09' INTO l_s_range-high.
ENDIF.
l_s_range-opt = 'BT'.
l_s_range-sign = 'I'.
APPEND l_s_range TO e_t_range.
ENDIF.
ENDIF.
Everything is fine in CMOD. However, its giving error in execution. Any idea on this pls...
Best Regards
Venkat... -
Routine in DTP to load data from previous fiscal period - current
Hi Friends,
I want to load data for previous & current fiscal period and I want to write a routine in DTP to automate this process, can any one help me with this routine!
Thanks & Regards,
vidiyalaHi Bilal,
We cant create ABAP routine in DTP, instaed we can create in Info package.
$$ begin of routine - insert your code only below this line -
data : v_date like sy-datum.
data : v_new_date like sy-datum.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = ' '.
l_idx = sy-tabix.
v_date = sy-datum.
l_t_range-low = v_date+0(6).
CALL FUNCTION 'DATE_CREATE'
EXPORTING
*anzahl_jahre =
anzahl_monate = 8
*anzahl_tage =
datum_ein = v_date
IMPORTING
datum_aus = v_new_date.
l_s_range-sign = 'BT.
l_s_range-opt = 'I'.
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 -
Function module reqd for fiscal period using current date
Hi,
Is there any function module which gives fiscal period using current date.
Thnaks,
MaheedharHi Maheedhar,
Try the code below.
CALL FUNCTION 'GET_CURRENT_YEAR'
EXPORTING
BUKRS = '1000' " Company Code
DATE = SY-DATUM " Date to find fiscal year for
IMPORTING
CURRM = w_currm " Current Fiscal Month
CURRY = w_curry " Current Fiscal Year
PREVM = w_prevm " Previous Fiscal Month
PREVY = w_prevy. " Previous Fiscal Year
Regards,
Amit. -
Date range From Fiscal period range
Hi All,
How can we get the date range for a given fiscal period range?
please help.
Thanks
Gaurav Mittalhi
good
pls check this code
declare a range like
ranges: r_date for s021-spmon. (declare as per your data type for the date)
in initialization event write.
r_date-low = '012007'. (enter the required lower range of value)
r_date-sign = 'I'.
r_date-option = 'BT'.
r_date-high = '122007'.
append r_date.
now use the r_date field in the program code.
thanks
mrutyun^ -
Function module to find get the Fiscal period using date
Hi Experts,
I am need of getting fiscal period and year from the given date. Is there any function module exists. Please advise.
Thanks in advance,
VivenDATA: I_FYV1 LIKE T009-PERIV.
CALL FUNCTION 'CCODE_GET_FISCAL_YEAR_VARIANT'
EXPORTING
COMPANY_CODE = i_billno-bukrs
COMPANY_CODE = S_BUKRS-LOW
IMPORTING
FISCAL_YEAR_VARIANT = I_FYV1
EXCEPTIONS
COMPANY_CODE_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'ME_DETERMINE_GJAHR'
EXPORTING
I_BSTYP =
I_BEDAT = P_DATE
I_PERIV = I_FYV1
IMPORTING
E_H_MONAT =
E_H_GJAHR = GJAHR1
E_H_DATUM = -
Dynamic VARIANT FOR Fiscal Period and dates
Hi
We have a custom transaction with date and fiscal period as vairable parameters and need to know if we can generate a DYNAMIC VARIANT for these based on FISCAL PERIOD.
Replies will rewardedHi,
Use transaction OB29, this is in the IMG.
Or
Path..
SPRO -> SAP REFERENCE IMG -> FINANCIAL ACCOUNTING -> FINANCIAL ACCOUNTING GLOBAL SETTINGS -> FISCAL YEAR -> MAINTAIN FISCAL YEAR...
<b>Reward points</b>
Regards
Message was edited by:
skk -
Deriving previous Fiscal Period based on current date
Hi All,
I have a requirement wherein I need to derive the previous fiscal period based on the current date. Is there any standard FM to get the same? If not can you let me know if there is any other way of deriving it?
Thanks
SundarHi Srinivas, thanks for your reply. What you have suggested will work fine if I am looking for current fiscal period. I want previous fiscal period. How do I get that?
Thanks
Sundar -
Creating backdated invoices after last date of fiscal period
Hello experts
In our business, it is a rule to keep the billing period open for two days even after the last day of the fiscal period. For example,
P10 ends on 29/10/2011, but that period is not closed until 31/10/2011(P11 date) so that the users can create all the invoices for that month. Please note that period 11 is not opened till 1/11/2011 (after closing p10).
Now,order related invoices are created thru an interface program. The user only sends in the "service date" which is mapped to the fixed value date field in SAP and we have defaulted the system date as the billing date to enable posting. The problem arises for the invoices created on the two days mentioned above as the invoices will not post into accounting if the billing date is 30/10 and 31/10 as P11 is not open yet.
How do i make sure that invoices created on the two month end days post into accounting with a billing date of 29/10 (a P10 date)? I can use the FM- FI_PERIOD_CHECK to check if the billing date is in the open period, but how do i populate the billing date field as an open period date automatically without manually changing it for all the invoices that have not posted?
The service date sent in has to be mapped to the fixed value date field because of aging purposes.
Would appreciate your valuable help here.
ThanksHi,
Function module FI_PERIOD_CHECK can be included in the program to check if the fiscal period is open or not.
Discuss with the ABAPER and include logic that in case the fiscal period is not open the default date should not be system date. Instead another date which is calculated using the FM - CALCULATE_DATE.
In the FM- CALCULATE_DATE give the logic how the date should be calculated.
Discuss with ABAPER for this.
Regards,
Sharan -
How to get the date range for a given fiscal period.
Hi All,
There is two fields (select options) on my selection screen
1. Fiscal Year
2. Fiscal Period.
I just want the date range between the given year and period on selection screen.
Thanks,
Gaurav MittalCheck FM's FIRST_DAY_IN_PERIOD_GET and LAST_DAY_IN_PERIOD_GET.
-
How to get fiscal period based on date and Fiscal year?
Hi Guys,
Can anybody tell me how to get Fiscal period based on date and Fiscal Year or fiscal year variant?
Thanks,
Gopi.Hi,
Please refer the code below:
*: Report: ZFISCALYR :
*: Date : 2004 :
*: Description: Demonstrates how to return the corresponding fiscal :
*: year and posting period for a company code and posting :
*: date or posting date and fiscal year variant. :
REPORT zfiscalyr NO STANDARD PAGE HEADING.
TABLES: ekko.
PARAMETERS: p_bukrs TYPE ekko-bukrs,
p_bedat TYPE ekko-bedat.
DATA: gd_fiscalyr TYPE bapi0002_4-fiscal_year,
gd_fiscalp TYPE bapi0002_4-fiscal_period.
DATA: gd_fiscalyr2 TYPE T009B-BDATJ,
gd_fiscalp2 TYPE bapi0002_4-fiscal_period.
DATA: gd_periv TYPE t009-periv.
*START-OF-SELECTION.
START-OF-SELECTION.
* get fiscal year and period - (requires date and company code)
CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
EXPORTING
companycodeid = p_bukrs
posting_date = p_bedat
IMPORTING
fiscal_year = gd_fiscalyr
fiscal_period = gd_fiscalp.
* Alternative fiscal year function module
* - (requires date and fiscal year variant code from T009 table)
* gets first entry in fiscal year variant table (will need to choose
* correct one from table rather than just using first entry)
SELECT SINGLE periv
FROM t009
INTO gd_periv.
* get fiscal year and period
CALL FUNCTION 'DETERMINE_PERIOD'
EXPORTING
date = p_bedat
* PERIOD_IN = '000'
version = gd_periv
IMPORTING
period = gd_fiscalp2
year = gd_fiscalyr2
EXCEPTIONS
period_in_not_valid = 1
period_not_assigned = 2
version_undefined = 3
OTHERS = 4.
*END-OF-SELECTION.
END-OF-SELECTION.
WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',
/ 'Fiscal year is:', gd_fiscalyr,
/ 'Fiscal period is:', gd_fiscalp.
SKIP.
WRITE:/ 'From function module: DETERMINE_PERIOD',
/ 'Fiscal year is:', gd_fiscalyr2,
/ 'Fiscal period is:', gd_fiscalp2.
Thanks,
Sriram Ponna.
Edited by: Sriram Ponna on Apr 17, 2008 8:59 PM -
How to get starting date and ending date of the given Fiscal Period
Hi Friends,
In my Selection screen parameter, I've Fiscal year and Period , I want to get the starting date and ending date with the Fiscal period.
How to get and throught which FM.
Pls advise.
thanks®ards
Sankar.Hello Sankar,
Check the FM PERIOD_DAY_DETERMINE.
DATA :
l_periv TYPE periv,
l_blart TYPE blart,
l_fday TYPE bkpf-budat, "First day in period
l_lday TYPE bkpf-budat. "Last day in period
* Fetch the fiscal year variant from T001
SELECT SINGLE periv INTO TABLE l_periv
FROM t001
WHERE bukrs EQ p_bukrs.
* Get first day/last day
CALL FUNCTION 'PERIOD_DAY_DETERMINE'
EXPORTING
i_gjahr = p_gjahr
i_monat = p_monat
i_periv = l_periv
IMPORTING
e_fday = l_fday
e_lday = l_lday
EXCEPTIONS
error_period = 1
error_period_version = 2
firstday_not_defined = 3
period_not_defined = 4
year_invalid = 5
OTHERS = 6.
Hope this helps.
BR,
Suhas
Edited by: Suhas Saha on Jan 9, 2009 2:08 PM
Maybe you are looking for
-
PseudoResources in Automation Plugin
My company has published a small automation plugin for Photoshop using the Adobe Photoshop 5.0 SDK. It currently works on my machine (Windows 2000) using Photoshop 7.<br /><br />I'm trying to modify the plugin so that it saves some data in the curre
-
How to transfer iBooks from one iPad account to another.
I am a teacher who will be taking on a new role at the school. The school is going to give me an iPad with all the literature books the students will be reading. These books were purchased through iBooks. I already have an iPad and was curious if
-
ASP / PHP pages: How to get streaming info from a XML file?
Hi all I am using Adobe Flash Media Streaming Server 3.5 but I can't find any output file (fx a xml file) that I can pull out info from and use on my website via a PHP or ASP script. It could be nice - in the website - to retrieve info like "online u
-
Need to read a field from flat file
Hi All, In flat file i have one field which may contain 100 enteries separated by delimanator ',' (comma). There can be 1 , 10 or 100 enteries. I need to put them in the internal table . Please suggest me . I have used the below logic . i
-
I would like to use my Outlook 2003 with my Blackberry Tour 9630 to use the Calendar, Memo & Task features instead of entering everything on the BB. I use my Outlook Express 6 for my email input and output. The Outlook 2003 is not connected to the in