oslavko
28th February 2005, 14:36
Dear all,

since we have only an object of tdsls4404m000, Print invoice session, we had to create an api session to add some controls over script, that is runing below. Everything is running well, except report that we have choose is not the one that is printed. Each time just a report, that is listed as the first one in session tdsls4404m000 is printed.

Script to call session tdsls4404m000:

{
co=stpapi.change.view("tdsls4404m000")
co=stpapi.change.view("tdsls4404m000")
stpapi.put.field("tdsls4404m000", "uporabnik", "slavkood")
stpapi.put.field("tdsls4404m000", "printedf", str$(printed.api))
stpapi.put.field("tdsls4404m000", "inv.date", str$(inv.date.api))
stpapi.put.field("tdsls4404m000","orno.f", str$(orno.f.api))
stpapi.put.field("tdsls4404m000","orno.t", str$(orno.t.api))
stpapi.put.field("tdsls4404m000", "definite",str$(definite.api))
stpapi.set.report"tdsls4404m000","rtdsls44040101z","HP_RC_LS4",errstring)
| stapi.print.report("tdsls4404m000",errstring)
stpapi.continue.process("tdsls4404m000",errstring)
stpapi.end.session("tdsls4404m000")
}

Did somebody have a same problem?

Thanks,

Slavko

mark_h
28th February 2005, 20:34
I am not familiar with this session and only glanced at it. Are you sure you have the flags set correctly to get the report you mentioned? Is the report a customized report you all added or a standard report? Have you tried putting the report that you want first on the session - it seems to me this worked at one point for me.

Mark

lbencic
28th February 2005, 22:20
My suspicion, based on this discussion:

Previous Discussion Link (http://www.baanboard.com/baanboard/showthread.php?t=22763)

is that it likes the first report in a session only, can anyone verify that? I know it does not like multiple reports to be printed at all (so probably you should be sure the variant reports are set to no).

One thing to try - did you copy the session already then to attach your report? If not, you should, based on other information it does not like calling reports that are not directly attached to the session - though standard script handles that ok. If you copy the session, make your report first in line, even remove the standard one and the others, maybe even make yours the only one. You can copy this session under a new name, and direct your api's to that, so you do not affect the standard tdsls4404m000.

oslavko
1st March 2005, 07:23
but only in that case. Session tdsls4404m000 is included in steps for sales order. In case i would copy it to a new session, it won't run (even if you add session in tcmcs039). Problem is that tdsls4404 check and compare procedure steps in tcmcs039 (order steps) and tdsls045(deliveries). Of course, we could alter those two tables online, but since the amount of incoming sales order is high (through normal procedure and afs), it is a bit too time consumable and dangerous.

From before i know, that in script for this session is some kind of "report handling" (device, report number, language). It seems that this step somehow loose information about report from set.report.

We are using many reports, because of our portfolio of products is quite different-that is the reason, why we would like to choose report to print.

Some additional ideas?

SO

oslavko
1st March 2005, 09:20
Of course we will install solution 146489. Maybe this will help.

Slavko