cancel
Showing results for 
Search instead for 
Did you mean: 

Checking the Financial Period

Former Member
0 Kudos

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 Racz

Accepted Solutions (1)

Accepted Solutions (1)

rasmuswulff_jensen
Active Contributor
0 Kudos

Could the given period be inactive or frozen?

or

Is the series chosen valid for the period?

***

Have you tried to simulate the operation using the client... If you can't do it there either I't might give some better error-message/clear up the problem

Message was edited by: Rasmus Jensen

Former Member
0 Kudos

Hi Rasmus,

The Period is active and the series is valid

All im doing is creating new entries based on existing ones and all the changes im causing is in the account/shortname and thats it... im not making up this details... thats why i dont see the problem

I can do it through the client

rasmuswulff_jensen
Active Contributor
0 Kudos

Try pasting the code...

Former Member
0 Kudos

Hi 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

AdKerremans
Active Contributor
0 Kudos

Hi Ronen,

If the computer date (server) is in 2006, you cannot add journal entries in 2004 through the DI. Though the client it is possible however.

Regards

Ad

Former Member
0 Kudos

Hi Ad,

Are you sure?

It means that i just wasted 2 weeks of work for nothing...

Are you a sap partner or something?

How do you know all this?

Ronen

AdKerremans
Active Contributor
0 Kudos

Hi Ronen,

Yes, we are a certified SAP partner. I am already working with SBO for 3 years now.

It is only possible to add journal entries in the current financial period. In the client you can change the current financial period for the time the client is running. Using the DI you can't change the current period.

But why do you want to add journal entries in the year 2004?

Regards

Ad

Former Member
0 Kudos

Too bad if you should have wasted 2 weeks of work for nothing...

Why not try this approach:?

Before executing your code, read in the system date, and store the year. Then try to programmatically change the system year on your computer before executing your code. And then set the year back to what it should be when you are finished. If someone should be using the client while the addon is running, the worst thing that should happen is that they get an error because the are not in the correct period, right? Try to google on how to programmatically set the system time if you think it's a good idea.

Answers (3)

Answers (3)

Former Member
0 Kudos

I too am very interested in posting into prior periods. Jacco, can you shed any more light on your suggestion ? Can you post any examples ?

Runar's was the only approach I could make work. My application is some in-house code to automatically create history for demonstration purposes so I don't need to be as careful as if it were customer-facing code.

I found I can easily use :

VisualBasic.DateAndTime.Today = System.DateTime.Parse("1/1/6")

call connect_to_DI_API

call post_an_invoice()

This posted to the correct period, however, you need to connect and disconnect to the API before each change of period.

jaccomoolenaar
Participant
0 Kudos

But did you get it to work?

Jacco

jaccomoolenaar
Participant
0 Kudos

Hi Ronen,

As far as I know it should be possible to do this (sorry Ad...). What is important however is the Value date from and to in your period as well as the Tax date from and to. The current date should be in those intervals to be able to book in the selected period.

Hope it works!

Jacco.

Former Member
0 Kudos

Hi People,

Thanks for your help.

Talk to you next time.

Ronen Racz