on 05-07-2006 9:35 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But did you get it to work?
Jacco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.