f.martel
20th June 2011, 12:37
Ia orana !

I want to close some project (tipcs020) with AFS function's.
I'm on B4C3

In the process of closing (tipcs2250m000) there are to actions:

Cost calculation (sub session tipcs3250s000 by zoom)
Project closing


I create (ttstpcreatdll) a dll tipcsdll2250ro based on session tipcs2250m000.
I added 2 functions:


function extern void dll2250ro.report( string device, ref string error)
{
stpapi.set.report("tipcs2250m000","rtipcs225001000",device,error)
}

and

function extern void dll2250ro.zoom( const string zoom.prog, long form, ref string err.msg )
{
stpapi.zoom.OPTION( "tipcs2250m000" , form , zoom.prog , err.msg )
}


My code :


dll2250ro.put.Project_from(lrpcs400.cprj)
dll2250ro.put.Project_to(lrpcs400.cprj)
dll2250ro.put.Delete_Project_Inventory_up_to_Value(999999.00)
dll2250ro.put.Overwrite_Booking_Date_Cost_Turnover_Sales(tcyesno.no)
dll2250ro.put.Booking_Date_Cost_Turnover_Sales(date.num())

dll2250ro.zoom("tipcs3250s000",1,mess.er)
| dll2250ro.handle.sub.process("tipcs3250s000","add")

mess.er = ""

if strip$(mess.er) <> "" then
mess.er2 = dll2250ro.get.last.message.code()
message("Erreur : %s",strip$(mess.er2))
else

dll2250ro.report("ASCIF",mess.er)

if strip$(mess.er) <> "" then
mess.er2 = dll2250ro.get.last.message.code()
message("Erreur : %s",strip$(mess.er2))
else
dll2250ro.continue(mess.er)

if strip$(mess.er) <> "" then
mess.er = dll2250ro.get.last.message.code()
message("Erreur : %s",strip$(mess.er))
endif

endif

endif

dll2250ro.end()


It doesn't work
I try 2 solution:

1st
I used the dll2250ro.handle.sub.process (auto create)

2nd
1 used the dll2250ro.zoom (manual create)

The two solution's doesn't work

Questions ?

Which is managed the sub session , AFS by the dll or my main program ?

Thank's

François

PS: Sorry for my english :D

mark_h
20th June 2011, 21:22
Here is a sample I did from another session:

function test_pdm()
{
long ret, count
stpapi.put.field("tppdm6100m000","tppdm600.cprj", "1CBEW6")
ret = stpapi.find("tppdm6100m000")
if(ret <> 1) then
message("err")
endif
stpapi.handle.subproc("tppdm6100m000","tppdm6101s000", "add")
stpapi.zoom.option("tppdm6100m000",1,"tppdm6101s000",err)
stpapi.put.field("tppdm6101s000", "tppdm740.cuno", " 00500")
stpapi.insert("tppdm6101s000",1,err)
stpapi.end.session("tppdm6101s000")
stpapi.end.session("tppdm6100m000")

}

Note in the main session I find the record first, then zoom to the subsession. Also note that the subproce comes before the zoom. This allows your stpapi program to send additional calls to the subsession. We do not use tipcs2250m000 and even looking at the program there is nothing off the special command on the menu. When doing the code it should emulate the manual steps.

tnzabo
10th July 2013, 19:51
f.martel - have you gotten the close projects to work with AFS?

f.martel
11th July 2013, 08:32
Hi tnzabo,

No, it doesn't work's .

But I should work on during August