saumya
11th April 2008, 13:27
Hi,
I m calling maintain outbound session for service order through AFS. I m putting each n every value correct. But still getting error "Order No not allowed". But that order i maintain through session. I tried my best but unable to solve it. Plz help me
mark_h
11th April 2008, 23:55
First search for the session number in this forum - I think I already posted code on this, if not it will have to wait until Monday. Second post your code for maintain outbound and maybe we will see the problem.
saumya
16th April 2008, 06:39
function generate.outbond() |through AFS
| {
| stpapi.put.field( "tssma3142m000", "tssma301.orno",str$(tdjub036.orno))
| ret = stpapi.find("tssma3142m000")
| if ret <> 1 then
| stpapi.end.session("tssma3142m000", errmsg)
| errmsg = "Service order not found"
| rprt_send()
| errmsg = ""
| else
| stpapi.handle.subproc("tssma3142m000", "tssma3110s000", "add")
| stpapi.continue.process("tssma3142m000", errmsg )
| if not(isspace(errmsg)) then
| message("Error in Maintain actual service order cost and revenues, Order: %d, Error: %s",tdjub036.orno, errmsg)
| stpapi.end.session( "tssma3142m000")
| maintain.outbound.h.complete = false
| maintain.outbound.l.complete = false
| v.flag = 1
| |for report
| if errmsg <> "" then
| rprt_send()
| errmsg = ""
| endif
| else
| maintain.outbound.h.complete = true
| generate.outbond.line()
| stpapi.end.session("tssma3142m000", errmsg)
| endif
| endif
| }
| function generate.outbond.line()
| {
| serb = 0
| prv.pono = 0
| select tdjub036.*
| from tdjub036
| where tdjub036._index1 = {:tdjub036.orno}
| and tdjub036.iqty > 0
| order by tdjub036._index1
| selectdo
| if prv.pono <> tdjub036.pono then
| prv.pono = tdjub036.pono
| serb = 0
| endif
| qtmt = tdjub036.iqty
| generate.afs.line()
| endselect
| |stpapi.end.session( "tdilc4102s000")
| stpapi.end.session( "tssma3110s000")
| }
| function generate.afs.line()
| {
| stpapi.put.field( "tssma3110s000", "tssma310.orno",str$(tdjub036.orno))
| ret = stpapi.change.view("tssma3110s000")
| stpapi.put.field( "tssma3110s000", "tssma310.seqn",str$(tdjub036.pono))
| ret = stpapi.find("tssma3110s000")
| ret = stpapi.mark("tssma3110s000")
| string temp(14)
| temp = ""
| if ret <> 1 then
| message("Sequence no %d for order %d is not found", tdjub036.orno,tdjub036.pono)
| errmsg = "Sequence no not found"
| |stpapi.end.session( "tssma3110s000")
| rprt_send()
| errmsg = ""
| else
| stpapi.handle.subproc("tssma3110s000","tdilc4102s000","add")
| stpapi.continue.process("tssma3110s000", errmsg )
| if not(isspace(errmsg)) then
| message("Error in Maintain outbound data, Order: %d, Error: %s",tdjub036.orno, errmsg)
| v.flag = 1
| if errmsg <> "" then
| rprt_send()
| errmsg = ""
| endif
| else
| serb = serb + 1
| stpapi.put.field( "tdilc4102s000", "tdilc401.koor", "4")
| stpapi.put.field( "tdilc4102s000", "tdilc401.orno", str$(tdjub036.orno))
| stpapi.put.field( "tdilc4102s000", "tdilc401.pono", str$(tdjub036.pono))
|
| stpapi.put.field( "tdilc4102s000", "tdilc401.sera", "0")
|
| ret = stpapi.change.view("tdilc4102s000")
| stpapi.put.field( "tdilc4102s000", "tdilc401.serb", str$(serb))
| stpapi.put.field( "tdilc4102s000", "tdilc401.item", tdjub036.item)
| stpapi.put.field( "tdilc4102s000", "tdilc401.loca", tdjub036.loca)
| stpapi.put.field( "tdilc4102s000", "tdilc401.qstr", str$(qtmt))
| stpapi.put.field( "tdilc4102s000", "tdilc401.qsts", str$(qtmt))
| ret_val = stpapi.insert( "tdilc4102s000", 1, errmsg )
|
| stpapi.get.field( "tdilc4102s000", "tdilc401.koor",temp)
| stpapi.get.field( "tdilc4102s000", "tdilc401.orno",temp)
| stpapi.get.field( "tdilc4102s000", "tdilc401.pono",temp)
|
| if not(isspace(errmsg)) then
| message("Error in Maintain Outbound Data, Order: %d Pos.%d , Error: %s",tdjub036.orno,tdjub036.pono, errmsg)
| maintain.outbound.l.complete = false
| v.flag = 1
| if errmsg <> "" then
| rprt_send()
| errmsg = ""
| endif
| else
| maintain.outbound.l.complete = true
| endif
| endif
| endif
| stpapi.end.session( "tdilc4102s000")
| }
I m getting error order number not allowed. Even I putting each value correct
mark_h
16th April 2008, 14:59
I am not familiar with these sessions, butl I found this post (http://www.baanboard.com/baanboard/showthread.php?t=9785&highlight=tssma3110s000) which might help. Where exactly does it get the error? The post I linked to did not cover tdilc4102s000. Can you do it using tdilc4101m000 to do the outbound?
saumya
17th April 2008, 08:12
Thanks Mark,
I have used session tdilc4101m000 for RPL order and Finished good. Thats woking fine. but For sevice order i have to call only those session which i have written in code.
mark_h
17th April 2008, 16:35
So where exactly does the error occur?
saumya
21st April 2008, 09:14
I m getting error "Order no not allowed". But everything I m putting right. if i do this direct from session its giving no error. But through AFS its showing me error
mark_h
21st April 2008, 14:20
Which line in the code? I agree it looks like everything is correct. I wonder if you can skip this section of code
| serb = serb + 1
| stpapi.put.field( "tdilc4102s000", "tdilc401.koor", "4")
| stpapi.put.field( "tdilc4102s000", "tdilc401.orno", str$(tdjub036.orno))
| stpapi.put.field( "tdilc4102s000", "tdilc401.pono", str$(tdjub036.pono))
|
| stpapi.put.field( "tdilc4102s000", "tdilc401.sera", "0")
|
| ret = stpapi.change.view("tdilc4102s000")
| stpapi.put.field( "tdilc4102s000", "tdilc401.serb", str$(serb))
On my system I do not have to enter this information when 4102s000 is launched from 4101m000. I am wondering if you have to do this also?
fmorais
26th August 2008, 17:17
Hi.
I seem to be getting the same problem.
Some more data:
I'm using tssma3110m000 to put some data in.
Then, I'm trying to do the outbound:
----------------
stpapi.handle.subproc("tssma3110m000", "tdilc4102s000","add")
stpapi.handle.subproc("tdilc4102s000", "tdilc4513s000","add")
stpapi.zoom.option("tssma3110m000",1,"tdilc4102s000",error.msg)
stpapi.put.field("tdilc4102s000", "tdilc401.orno", str$(tsbdg310.orno))
stpapi.put.field("tdilc4102s000", "tdilc401.pono", str$(pos.aux))
stpapi.find("tdilc4102s000")
retval = stpapi.change.view("tdilc4102s000")
----------------------------
As soon as the first line is run...
stpapi.handle.subproc("tssma3110m000", "tdilc4102s000","add")
I'm getting the zero pointer errors in the BW message window:
process xxx: zero pointer: name '' in qss.search
process xxx: can not continue in tssma3101m000
...
And thus resulting in the "order not allowed" error when trying to insert the outbound record.
(It seems tssma3110m000 is not prepared to call tdilc4102s000).
Can anybody give me a hand?
Saumya, how did you solve the problem?
Thanks a million
Fred
fmorais
26th August 2008, 17:26
Hi again.
Just checked solution 148876 from sp19.
It seems to have something to do with the subject.
In here we're using sp14.
Does anyone have an input on this? Should i install it?
Thanks
Fred
fmorais
26th August 2008, 18:12
Hi again.
The Zero pointer error was just a bug on my program.
I was using "tssma3110m000" and should use "tssma3110s000".
Now I "just" have the problem of the "order no. not allowed".
Can anybody give a hand?
Thanks a lot
Fred
mark_h
26th August 2008, 18:57
Not familiar with the session, but I did notice the OP used stpapi.continue.process("tssma3110s000", errmsg ) and use have a stpapi.zoom. Not sure if that makes a difference or not.
fmorais
26th August 2008, 19:36
Hi mark.
Your suggestion did not help.
However, I noticed the following in the process tree:
Session "tdilc4102s000" is daughter of the session tssma3110s000 if you run the sessions normally (foreground). (which seems OK).
Session "tdilc4102s000" is daughter of the father of tssma3142m000, a session I developed. (which seems very strange).
It seems that session tdilc4102s000 is not handled well in background. I remember a few years ago, I had to install some patches in order to be able to run the outbound api. Perhaps the problem is the same. Will have to investigate further.
If anyone has further input, please fell free to post it.
Thanks
Fred
mark_h
26th August 2008, 20:54
Yes - that means the session tdilc4102 is not being controlled by tssma3110s000. Just make sure the stpapi.handle.subproc is before the activating the tdilc4102s000 session. It looks like it is, but ya never know. It could very well be a patch is required, but I am not sure which would that would be.
fmorais
28th August 2008, 14:58
Hi.
Still working on this problem.
It seems there are members that could put this to work.
Can someone that did it post a code sample and/or tell us which service pack is used on the site?
I'm trying to avoid having to debug/customize tdilc4102s000.
Thanks
Fred