Get Current financial period
Hi All,
I have used following code to get current financial period:
SAPbouiCOM.Company company = oApplication.Company;
int Period = company.CurrentPeriod;
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
SAPbobsCOM.FinancePeriodParams diPeriodParams = (SAPbobsCOM.FinancePeriodParams)oCompanyService.GetDataInterface(SAPbobsCOM.CompanyServiceDataInterfaces.csdiFinancePeriodParams);
diPeriodParams.AbsoluteEntry = Period;
SAPbobsCOM.FinancePeriod finPeriod = oCompanyService.GetFinancePeriod(diPeriodParams);
But iam gettng error "No Matching records found".
Hi Pravin,
2007 onward the company.CurrentPeriod is not available . It always returns -1, so you are getting the above error.
The other way to get the current period is through query :
select code, name from ofpr where f_refdate <= getdate() and t_refdate >= getdate()
Hope it helps.
Regards
Similar Messages
-
Hi,
I would like to be able to return the current financial period using the DI API. I can return all the periods using the example given in the help documentation but don't know how to identify the current one. Am I missing something obvious?
Manu thanks
Adrian NorthAdrian,
If you're working with UI API 2005, then use
oCompany.CurrentPeriod()
to retrieve the currect period.
If you're working with UI API 2007, then you cannot retrieve the current period has it doesn't apply to SAP Business One 2007A.
{quote]
Topic
Current Period removed.
Description
In all SAP Business One versions up to 2005 A SP1, there is 'current period setting indicating the period enabled for data entry and posting. One period only can be set as current.
From 2006 A, version on all periods will be enabled. Current period setting will be no longer used.
Impact on Add-Ons
When add-on will try to read out value from Company.CurrentPeriod, instead of period value, it will receive numeric value '-1'.
Possible Solution
Adjust the add-on to not use CurrentPeriod property.
Object-Property/Method
Company.CurrentPeriod.
{quote}
Regards,
Vítor Vieira -
Adding periods in the current fiscal period
Hi,
I need to extend the current financial period which is actually 12 periods to 18 periods.Is it possible in SAP Business One?
The financial period is already in use in transactions so i am not able to remove it.
Thks
NishaHi
No you can't change the no. of periods
Regards -
Hi Everybody,
Every time im trying to add a journalEntry it fails because of the dates.
The dates are from 2004 and the current financial period that im working with is 2004 as well but it still fails.
The financial period is the whole year so i dont need to check the month.
Anybody has ideas about the reason for the failure?
Ronen RaczHi Rasmus,
the code is not the problem because it works fine when the financial period is 2006 and the dates are also 2006.
when i change all the dates and the period to 2004, it stops working...
does it check the computer date or something like that?
Ronen
p.s.
if you still want to see the code its the first message in there
Re: adding and updating journalentries -
How to get total number of days in current Fiscal period/year
Hi,
I need to get total number of days in current Fiscal period/year (current month) and assign it to an infoobject. I need a routine for this. Is there any function module to get this.If possible pls paste the ABAP code also for this task. Thanks in advancehere is the FM:
LAST_DAY_IN_PERIOD_GET
KJ!!! -
Retrieve "Start date of Next financial Period" and "Current Period"
Hi,
T-code: cne5
I would like to display 2 new fields in cne5 report result:-
1) Start date of Next financial Period
2) Current Period
I can used
CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
EXPORTING
I_DATE = SY-DATUM
I_PERIV = 'K4'
But what is I_PERIV ?
How can I retrieve the above fields value? Any Function Module that I can used?
Appreciate helps!
THanks a lot.Hi,
Yes, i_periv is Fiscal Year Variant.
From running OB37, I can see that V3 and K4 fiscal year variant. Which one should I used when calling the function module DATE_TO_PERIOD_CONVERT?
Thanks! -
Hi All,
I want current period based on system date .Please tell me name of Function module so that i can pass system date n get period for that.
Thanks,
UlhasHi,
HR_PAYROLL_PERIODS_GET
Get the payroll period for a particular date.
Example:
call function 'HR_PAYROLL_PERIOD_GET'
exporting
payroll_area = period
date = sy-datum
importing
payroll_year = ac_year
payroll_period = a_period
exceptions
no_entry_t549a = 1
no_entry_t549q = 2
others = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
regards,
keerthi -
While posting material in mb1c i am getting error message period 012/2006
hi every one how ru n advance happy new year
while i was posting stock in mb1c i am getting an error message period 012/2006 is not open for account type S and G/L account 799999
so plz anyone help me in solving this error.
thanks & regards
venuprasadHi Venu,
Advance Happy New Year....
<b>OB52</b>
check the fiscal year variant assigned to comapny code and change the periods corresponding to account type blank, S, K to current financial year periods
spro...img...financial accounting...global settings...document...line item...fiscal year variant...define fiscal year variant
Also <b>MMPV</b>, Give the current date, company code and Run the transaction code and then try posting the document.
Hope this Resolves your Issue.
Cheers...
Santosh.
<i><b>Mark All Usefull Answers..</b></i> -
Can't define previous & current posting period date in Balance sheet PLD.
Hello Experts,
I need to print previous financial year's last date & current financial year's last date on the balance sheet in a new company.
But i am unable to do so, as i was trying to link it with posting period's date in the PLD. And in the new company currently i am having only one posting period i.e. current financial year. How can i get the date from the previous posting period's date.
Please suggest me, how can i get the previous financial year's last date & current financial year's last date on the PLD of Balance Sheet.
Regards.
ShriX.Hi,
This is one of Hard Coded PLD that no way to link to other tables. You have to create your own report if you need those dates.
Thanks,
Gordon -
Closing a production order in the previous financial period.
Hello All,
I am hoping somebody can help me with a Production order question. We have recently upgraded to SBO 2005a SP18, I know, just catching up
we have an issue when closing Production Orders at the end of the financial period. Assume that the period end is on the Sunday (end of period 2), The production from the Friday does not get booked into the system until the Monday morning (next period, period 3).
We can adjust the date of the production receipts and bookings on the Monday morning to show as a posting date of the Friday (period 2) but when we close the production order the there seems to be no way of closing it in the previous period (period 2), the transactions get posted in the current period.
We have played with the changing the periods but our testing so far has been without success.
Many thanks,
MikeSuda,
Using standard SAP when we create a standard Prod order, say for 100 units. The status is defaulted to planned. we then change the status to released. once released we have an addon that we use to book production.
The addon uses the production receipt and issue as well as other stock positngs all against the production order. At any point in time we can see how many units have been completed and what componenents have been issued against an order.
once the order is complete we change the staus manually from released to closed. this process then generated a whole bag of journal entries. It is these journal entries I need in the previous period if I am in to the new period.
Our SAP parteners say that the only way to do this with the addon is to reverse all of the journals created when closing the Prod order and re-create them in previous period but this would be a significant cost to us.
Thanks,
Mike -
Hi All
how i know that which is the current financial year of particular company in which i am logged in?Hi,
For that u need to use the company serrvice object, I guess the following sample could help u.
Dim oCompanyService As SAPbobsCOM.CompanyService
Dim oPeriodCategoryColl As PeriodCategoryParamsCollection
Dim oPerCategory As PeriodCategory
Dim oFinancePeriods As FinancePeriods
Dim oFinancePeriod As FinancePeriod
Dim i As Integer
Dim j As Integer
'get company service
oCompanyService = oCompany.GetCompanyService
'get Period Category Collection
oPeriodCategoryColl = oCompanyService.GetPeriods
'print all periods
For i = 0 To oPeriodCategoryColl.Count - 1
'get period category
oPerCategory = oCompanyService.GetPeriod(oPeriodCategoryColl.Item(i))
'print period category name
Debug.WriteLine(oPerCategory.PeriodName)
'get all finance periods (if the sub period isn't a year then it
'has more than one finance period, for example sub period month has 12 finance periods)
oFinancePeriods = oCompanyService.GetFinancePeriods(oPeriodCategoryColl.Item(i))
For j = 0 To oFinancePeriods.Count - 1
'get finance period
oFinancePeriod = oFinancePeriods.Item(j)
'print the period name
Debug.WriteLine(oFinancePeriod.PeriodName)
Next j
Next i
Hope it helps,
Vasu Natari.
P.S: For more informattion please check the DI help file -
Fm to get current + next 3 fiscal months name
hi all,
In my alv report , i need to populate the stock of current fiscal month plus stock for succeeding 3 months.Using fm 'GET_CURRENT_YEAR' i am getting current month details with input sydatum and company code.
But how to get next 3 fiscal months?Is there any fm to do the same?Hi,
try this:
DATA: PERIOD LIKE T009B-POPER,
YEAR LIKE T009B-BDATJ,
DATE LIKE SY-DATUM.
DATE = SY-DATUM.
CALL FUNCTION 'DETERMINE_PERIOD'
EXPORTING
DATE = date
VERSION = 'K4'
IMPORTING
PERIOD = PERIOD
YEAR = YEAR
EXCEPTIONS
PERIOD_IN_NOT_VALID = 1
PERIOD_NOT_ASSIGNED = 2
VERSION_UNDEFINED = 3
OTHERS = 4.
write: / date, period, year.
CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
EXPORTING
MONTHS = 1
OLDDATE = DATe
IMPORTING
NEWDATE = date.
CALL FUNCTION 'DETERMINE_PERIOD'
EXPORTING
DATE = date
VERSION = 'K4'
IMPORTING
PERIOD = PERIOD
YEAR = YEAR
EXCEPTIONS
PERIOD_IN_NOT_VALID = 1
PERIOD_NOT_ASSIGNED = 2
VERSION_UNDEFINED = 3
OTHERS = 4.
write: / date, period, year.
CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
EXPORTING
MONTHS = 1
OLDDATE = DATe
IMPORTING
NEWDATE = date.
CALL FUNCTION 'DETERMINE_PERIOD'
EXPORTING
DATE = date
VERSION = 'K4'
IMPORTING
PERIOD = PERIOD
YEAR = YEAR
EXCEPTIONS
PERIOD_IN_NOT_VALID = 1
PERIOD_NOT_ASSIGNED = 2
VERSION_UNDEFINED = 3
OTHERS = 4.
write: / date, period, year.
CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
EXPORTING
MONTHS = 1
OLDDATE = DATe
IMPORTING
NEWDATE = date.
CALL FUNCTION 'DETERMINE_PERIOD'
EXPORTING
DATE = date
VERSION = 'K4'
IMPORTING
PERIOD = PERIOD
YEAR = YEAR
EXCEPTIONS
PERIOD_IN_NOT_VALID = 1
PERIOD_NOT_ASSIGNED = 2
VERSION_UNDEFINED = 3
OTHERS = 4.
write: / date, period, year.
Regards, Dieter -
XL-Reporter - Financial Periods specified in row and column selections
Hello to all,
again I have no idea how to solve an XLR problem after I tried different ways with unwanted results and after trying to find suggestions in the samples and help files.
As a result I need a report which looks roughly like this
2007 2006 2005 ...
Jan.
Feb.
Mar.
Dec.
where each cell of the matrix is the total of invoices of a selected customer over the month in the specified year.
I mainly tried to solve this in two different ways.:
1.)
Definition of a parameter for finacial period: name=fp, dimension, type=financial period, attribute=code
Column selection summary for each year: PER(code=YearAll(@fp)) resp. PER(code=YearAll(@fp-12)) ...
Row selection expansion: BPA(CardCode=@customer) ARDT(Code=Invoice) PER(PeriodInYear=1:12) Group By PER.PeriodInYear
In each cell of the matrix the data attribute =ixGet(SO_LineTotal) is specified.
The cell in the first colum (month) of the matrix is =ixDimGet(PER; PeriodInYear).
2.)
No parameter for the financial period is defined;
Column selection summary for each year: PER(Year=2007) resp. PER(Year=2006) ...
The rest is the same as in 1.)
As a result I actually get a matrix with a column for each year and a row for each month, where the first column is 1, 2, ..., 12 (this is OK).
But for all 12 month I get the same value, which is the (correct) total value for the whole year!
Where is the failure in my intuition?
Many thanks for your help!
Regards,
Frank RomeniI found it works if I don't set the selection to period in the Column and row. Here are my selections
Row
Row 8-9 Expanding
PER( * ) Group By PER.PeriodInYear
Row 9 Expanding
FACT BPA( CardCode = @BPCode ) ARDT( Code = "Invoice" )
Column
Column C Expanding
FACT FIG( SO_TaxDate >= "01/01/2007" ) PER( * ) Group By PER.Year
then I use a Column total to total the row expansion of the SO_LineTotal with =SUM( ixRef(C9,2) ) were C9 is the expanding SO_LineTotal. Then I hide Row 9 in excel to hide the details.
If you post your email I can send you the IXR report definition
Dan -
How to incorporate Current Tax Period in Select Query.
i need to extract the data based on the Current Tax Period
say current tax perios is
06-04-2007 to 05-04-2008
how to incorporate this in my select query.
i need to fetch
PERNR
BEGDA
ENDDA
STAT2
FROM PA0001 INTO TABLE IT_P0001
for all entries in T_TXT_UPLOAD
WHERE PERNR = T_TXT_UPLOAD-PERNR.
In this t_txt_upload is an internal table.(input file which is taking using GUI_UPLOAD).Use this FM HR_ID_TAX_YEAR to get the starting and end date for tax year and pass the date to your SELECT command for BEGDA & ENDDA.
Regards,
Amit
Reward all helpful replies.
<b>P.S</b> Close the queries when get solved. -
Current year period comparison with previous year
Hello Experts,
i need to compare qty of
period 01 2006 with period 01 2005-->for this period
period 01,02 2006 with period 01,02 2005-->for next period
period 01,02,03 2006 with period 01,02,03 2005 -->
after that...etc...
Note:
-i am having time char fiscal year/period
-now we are in period 02
-to get this year period i am using the variable,
"Cumulated to Last fiscal Year/Period" to restrict. so, this will give period 01 of this year.
- is there any standard variable to get last years period
- else, how to achieve this?
Thank you very much.
-Vam.Hi,
u can try with the Variable: Cumulated up to Current Fiscal Year Period 0FYTCFP.
i have not tried.its just an idea.
from sap help:This variable denotes an interval from period 1 of the current fiscal year to the current fiscal year period.
First the fiscal year variant, which serves as the input parameter for determining the current fiscal year, is defined.
http://help.sap.com/saphelp_nw04s/helpdata/en/99/ae22419e2ab167e10000000a155106/frameset.htm
or
Variable: Cumulated up to Last Fiscal Year Period
Technical name: 0FYTLFP
Use
This variable denotes an interval from period 1 of the current fiscal year to the period before the current fiscal year period.
First the fiscal year variant, which serves as the input parameter for determining the current fiscal year, is defined.
cretae 2 restricted keyfigures like this:
RKF1:
Quantity
0FISCPER restricted by 0FYTCFP / 0FYTLFP
RKF2:
Quantity
0FISCPER restricted by 0FYTCFP/0FYTLFP with offset '-1'.
and use respective text variables to view Fiscal year/period value accordingly in RKFs.
hope this helps.
regards
Message was edited by: c c
Message was edited by: c c
Maybe you are looking for
-
Which USB superdrive is compatible with Macbook Pro 2009?
Have an old 2009 Macbook Pro running Mavericks and it seems the Superdrive is slowly dying. I've tried cleaning it. If I were to buy an external USB superdrive, which model is compatible?
-
Hi Suppose i want 1:2 transformation. Both the destinations are of the same type. (say two database tables have to be updated int he receiver end, ) 1. I can create one business service with two receiver interfaces. And go for multimapping. or 2. I c
-
Notes syncing but not showing up in Outlook
I don't know if this is a topic somewhere, had a quick search couldnt find it. I have an old version of Outlook (2000), which technically doesn't sync with the iPod touch (according to the apple site, 2003/2007 is required). now Outlook really misbeh
-
Is there any t-code in which the List of Customers Display?
Hi SDN, Is there any t-code in which the List of Customers Display? Like the MKVZ, this is the t-code for List of Vendors Display. Thanks, Sumit.
-
JCO client creation without hardcoding user id /password
Hi All, II need to execute BAPI in java DC code,for that i need to create jco client.Is there any way so that i need not hardcode userid and password in the code. Any pointers? Regards Radhika