ipineda
2nd October 2008, 22:56
Hi friends:

I need help. I've been trying to do an AFS to Bank Transactions Session(tfcmg2100s000). At first sight it seems to be easy but i got an error that i don't know hw to figure out. The problem is in the following line:
g.ret1.insert = stpapi.insert("tfcmg2100s000", true, g.err1.ins)
the error i got appears in the BW Messages window and it is:

Fatal Error: Error 205(Out of Range) on tfgld018121 in select
Fatal Error: Can not continue in tfcmg2100s000 (make.transactions)[sql.exec]

When I see in debugger the values I inserted are not in the session.

The code put the file with the code.

I hope you could help, thanks.

madan.meegada
3rd October 2008, 11:54
It looks like system is not updating the Documents table (tfgld018) properly. 205 error indicates that some mandatory field is not filled in table tfgld018. You can check the error log (ttstperrlog) to know which mandatory field is not filled in tfgld018.

mark_h
3rd October 2008, 14:14
Well - I can not speak for LN or Baan 5, but typically I do not do execute something like the add set. I simply put the fields and do an insert(Or update or save). Of course depending on the session I might check to see if there is a set, but I never do an add set like this.

mark_h
3rd October 2008, 14:22
See this post here (http://www.baanboard.com/baanboard/showthread.php?t=36248&highlight=tfcmg2100s000). I was thinking more along the lines of how the first post shows the code. Just remember I am not familiar with Baan 5 or LN.

ipineda
3rd October 2008, 15:54
Hi,

I tried without the add.set and the result is the same. Also I compared my script with the script you recommended me and I don't find any differences.
And I have serched in log files but I don't find something usefull ¿do i need to look for something special? ¿in which log do i have to search?
There is something strange: if i send wrong invoice values i get the error message of the ssession alerting this but if I send the right one I get the error in BW Messages. And something else: if i save the values with stpapi.save the new document is saved but all the other data is lost and i have debugged the session and i noticed the session's fields don't have the values I send.
I hope this information could help you...
If you have any idea I will thank you.

mark_h
3rd October 2008, 19:44
With the session (tfcmg2100s000) in debug see what happens when you do the put field commands.See if anything gets execute where you can check the value just sent. Not always, but sometimes other events might get executed. You might want to add a before.display event - I can not remember what events do get executed. You have to first get it to accept your values first. If your put fields are not making it to the session then that is the first problem to solve.

Does this session come up in insert mode? Something else I have had to do before - do a save, continue or update before doing your put fields. In one sub-session I run the first thing I do to get it out of insert mode is a continue. Then I can start putting my fields and doing the insert. If I do not do this I also got errors - I do not recall what they were.

It is always possible thay you might need an update from infor on the session. Can't really say for sure. I am just winging this based off my 4c4 experience.

vinceco252
3rd October 2008, 20:23
Also, the log.bshell log file should give you more information on the 205 error.

Vince

ipineda
3rd October 2008, 23:44
Hi I'm still here.
I've tried many things. I tried with a save, continue and a update before put statements and the error is still there. I don't know how to see if the sessions is in insert mode.
Now with the use of debugger I'm sure the values arrive to the session, but I also discovered that in the function "make.transactions" there is a select and this is the line in which the error occurs. I have done the process using the session and the values I got in the two ways are the same but with my afs i got the error 205.

I have also seen the log.bshell and it confirms that the select is where the error occurs.

I put the screens with the two cases the values used with the index are the same.

mark_h
4th October 2008, 02:49
Okay so when you run it thru the AFS code all of the variables are set for that select? So in debug mode when you click on tfcmg204.comp it is set to the correct company? Is it the same company that you are running the afs code in? And the tfcmg204.ninv and tfcmg204.tinv are set to what you did in the put.fields? Just want to make sure that all three are correct. Is the table tfacr200 declared in the session? For grins and giggles could you try it with out the where clause (tfacr200._compnr= :tfcmg204.comp). So far this does not make sense - unless the 205 error is something different. This is a simple select statement and does not have any update involved. What are the exact errors you get.

Another thing to try for grins and giggles is to comment out the complete select and hard code in the arr.in and inv.orders - for your example. See what happens.

I have had to go thru this before and it is not always an easy answer. Sometimes you just have to keep plucking away to see what the error really is. Also are you on the latest stpapi version and the latest version of this session?Sometimes that does make a difference. Sorry I am not much help.