darkbook4008
28th November 2011, 16:58
Hello, I'm using BaaN V.

I'm trying to do AFS to session ttiex1280m000 to export dumps, but I have problems with this.

This is the source of my dll

extern domain tcmcs.st90m g.cod_error1
extern domain tcmcs.st90m g.cod_error2
extern domain tcmcs.st90m g.cod_error3
extern domain tcmcs.str10 g.path

#pragma used dll ottstpapihand
function extern domain tcbool tccpedll.documentacion(domain tcmcs.str7 p.cpac,
domain tcmcs.str7 p.vers.f,
domain tcmcs.str7 p.rele.f,
domain tcmcs.str7 p.cust.f,
domain tcmcs.str7 p.vers.t,
domain tcmcs.str7 p.rele.t,
domain tcmcs.str7 p.cust.t,
domain tcmcs.str7 p.clan,
domain tcmcs.str7 p.cprj,
ref string p.error)

{
long l.ret

g.path = "P_"&toupper$(trim$(p.cprj))

stpapi.put.field("ttiex1280m000" , "cpac" ,trim$(str$(p.cpac))) |Package
stpapi.put.field("ttiex1280m000" , "vers" ,trim$(str$(p.vers.f))) |VRC
stpapi.put.field("ttiex1280m000" , "rele" ,trim$(str$(p.rele.f)))
stpapi.put.field("ttiex1280m000" , "cust" ,trim$(str$(p.cust.f)))
stpapi.put.field("ttiex1280m000" , "c.update" ,str$(etol(tcyesno.yes))) |
stpapi.put.field("ttiex1280m000" , "vers.f" ,trim$(str$(p.vers.t)))
stpapi.put.field("ttiex1280m000" , "rele.f" ,trim$(str$(p.rele.t)))
stpapi.put.field("ttiex1280m000" , "cust.f" ,trim$(str$(p.cust.t)))
stpapi.put.field("ttiex1280m000" , "clan" ,str$(p.clan)) | Language

stpapi.put.field("ttiex1280m000" , "based.sessions" ,str$(etol(tcyesno.no)))
| stpapi.put.field("ttiex1280m000" , "sess.from.file" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "dump.comp" ,str$(etol(tcyesno.yes)))
| stpapi.put.field("ttiex1280m000" , "only.pack.yn" ,str$(etol(tcyesno.yes)))
stpapi.put.field("ttiex1280m000" , "error.report" ,str$(etol(tcyesno.yes)))

stpapi.put.field("ttiex1280m000" , "path" ,str$(g.path))
| l.ret=stpapi.enum.answer("ttiex1280m000","ttadvq1151",tcyesno.yes) |ruta
stpapi.enum.answer("ttiex1280m000","ttadvq1151",tcyesno.yes) |ruta
stpapi.handle.subproc("ttiex1280m000", "ttadv11152", "kill")

| |componente 1
stpapi.put.field("ttiex1280m000" , "sessions" ,str$(etol(tcyesno.no))) |Sesiones
stpapi.put.field("ttiex1280m000" , "reports" ,str$(etol(tcyesno.no))) |
| stpapi.put.field("ttiex1280m000" , "report.sources" ,str$(etol(tcyesno.no))) |
stpapi.put.field("ttiex1280m000" , "forms" ,str$(etol(tcyesno.no))) |
| stpapi.put.field("ttiex1280m000" , "form.sources" ,str$(etol(tcyesno.no))) |
stpapi.put.field("ttiex1280m000" , "menus" ,str$(etol(tcyesno.no))) |
stpapi.put.field("ttiex1280m000" , "scripts" ,str$(etol(tcyesno.no))) |
| stpapi.put.field("ttiex1280m000" , "script.sources" ,str$(etol(tcyesno.no))) |
stpapi.put.field("ttiex1280m000" , "libraries" ,str$(etol(tcyesno.no)))
| stpapi.put.field("ttiex1280m000" , "library.sources" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "functions" ,str$(etol(tcyesno.no)))
| stpapi.put.field("ttiex1280m000" , "func.sources" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "table.def" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "domains" ,str$(etol(tcyesno.no)))

|componente 2
stpapi.put.field("ttiex1280m000" , "messages" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "questions" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "impl" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "labels" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "charts" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "help" ,str$(etol(tcyesno.no)))

| |componente 3
stpapi.put.field("ttiex1280m000" , "sql.queries" ,str$(etol(tcyesno.no))) | SQL Queries
stpapi.put.field("ttiex1280m000" , "projects" ,str$(etol(tcyesno.yes))) | Project
stpapi.put.field("ttiex1280m000" , "cprj.f" , p.cprj)
stpapi.put.field("ttiex1280m000" , "cprj.t" , p.cprj)

stpapi.put.field("ttiex1280m000" , "cupt.f" ," ") |From customization part
stpapi.put.field("ttiex1280m000" , "cupt.t" ,"zzz") |To customization part
stpapi.put.field("ttiex1280m000" , "cppt.f" ," ") |From project part
stpapi.put.field("ttiex1280m000" , "cppt.t" ,"zzz") |To project part

stpapi.put.field("ttiex1280m000" , "docu" ,str$(etol(tcyesno.yes))) | docuementation
stpapi.put.field("ttiex1280m000" , "reln" ,str$(etol(tcyesno.yes))) | release notes


stpapi.set.report("ttiex1280m000", "ttiex12800100", "D",g.cod_error1)
stpapi.form.command("ttiex1280m000",5,"exec.cont.process",g.cod_error2)

| if not isspace(g.cod_error2) then
| stpapi.handle.subproc("ttiex1280m000", "ttadv11152", "kill")
| stpapi.continue.process("ttiex1280m000", g.cod_error2)
| stpapi.form.command("ttiex1280m000",5,"exec.cont.process",g.cod_error1)
| g.cod_error1 = stpapi.get.mess.code("ttiex1280m000", g.cod_error2)
| else
| g.cod_error1 = stpapi.get.mess.code("ttiex1280m000", g.cod_error2)
| endif
stpapi.end.session("ttiex1280m000", g.cod_error3)
p.error = trim$( g.cod_error1& " "
& g.cod_error2 & " "
& g.cod_error3
)
return(isspace(p.error))
}

In the command button
stpapi.form.command("ttiex1280m000",5,"exec.cont.process",g.cod_error2)
I had this result in the return message
g.cod_error2 = Directory created

In the command button
stpapi.continue.process("ttiex1280m000", g.cod_error2)
I had this result in the return message
g.cod_error2 = Command disable

And in stpapi.get.mess.code
g.cod_error1 = stpapi.get.mess.code("ttiex1280m000", g.cod_error2)
I had this result in the return message
g.cod_error2 = Command cancelled

These messages are returned in different tests, but in any test the dumps aren't created, only in test number one, the directory is created, but nothing more


Please help me with this

mark_h
29th November 2011, 15:54
Only baan iv uses stpapi.continue, baanerp uses stpapi.form.command. Make sure questions are answered before they are asked. And warning messages can be ignored. So you do not need to kill those. Are those the setting you use when you run it manually?

darkbook4008
29th November 2011, 16:39
Here is my code

extern domain tcmcs.st90m g.cod_error1, g.cod_error2, g.cod_error3, g.cod_error4, g.cod_error5
extern domain tcmcs.str10 g.path

#pragma used dll ottstpapihand
#pragma used session ttiex1280m000

function extern domain tcbool tccpedll.documentacion(domain tcmcs.str7 p.cpac,
domain tcmcs.str7 p.vers.f,
domain tcmcs.str7 p.rele.f,
domain tcmcs.str7 p.cust.f,
domain tcmcs.str7 p.vers.t,
domain tcmcs.str7 p.rele.t,
domain tcmcs.str7 p.cust.t,
domain tcmcs.str7 p.clan,
domain tcmcs.str7 p.cprj,
ref string p.error)
{
long l.ret

g.path = "P_"&toupper$(trim$(p.cprj))
stpapi.put.field("ttiex1280m000" , "cpac" ,str$(p.cpac)) |Package
stpapi.put.field("ttiex1280m000" , "vers" ,str$(p.vers.f)) |V
stpapi.put.field("ttiex1280m000" , "rele" ,str$(p.rele.f)) |R
stpapi.put.field("ttiex1280m000" , "cust" ,str$(p.cust.f)) |C
stpapi.put.field("ttiex1280m000" , "c.update" ,str$( etol( tcyesno.yes))) |VRC Compare
stpapi.put.field("ttiex1280m000" , "vers.f" ,str$(p.vers.t)) |V
stpapi.put.field("ttiex1280m000" , "rele.f" ,str$(p.rele.t)) |R
stpapi.put.field("ttiex1280m000" , "cust.f" ,str$(p.cust.t)) |C
stpapi.put.field( "ttiex1280m000", "clan" ,"2", 1 ) |Language English
stpapi.put.field( "ttiex1280m000", "clan" ,"5", 2 ) |To Spanish

stpapi.put.field("ttiex1280m000" , "based.sessions" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "sess.from.file" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "dump.comp" ,str$( etol( tcyesno.yes)))
stpapi.put.field("ttiex1280m000" , "only.pack.yn" ,str$( etol( tcyesno.yes)))
stpapi.put.field("ttiex1280m000" , "error.report" ,str$( etol( tcyesno.yes)))

l.ret=stpapi.enum.answer("ttiex1280m000", "ttadvq1151", tcyesno.yes) |Response message to create directory
stpapi.handle.subproc("ttiex1280m000", "ttadv11152", "kill") |Kill message directory created
stpapi.put.field("ttiex1280m000" , "path" ,str$(g.path)) |Path

|Component 1
stpapi.put.field("ttiex1280m000" , "sessions" ,str$( etol( tcyesno.no ))) |Sessions
stpapi.put.field("ttiex1280m000" , "reports" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "report.sources" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "forms" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "form.sources" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "menus" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "scripts" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "script.sources" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "library.sources" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "libraries" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "functions" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "func.sources" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "table.def" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "domains" ,str$( etol( tcyesno.no )))

|Component 2
stpapi.put.field("ttiex1280m000" , "messages" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "questions" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "impl" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "labels" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "charts" ,str$( etol( tcyesno.no )))
stpapi.put.field("ttiex1280m000" , "help" ,str$( etol( tcyesno.no )))

|Component 3
stpapi.put.field("ttiex1280m000" , "sql.queries" ,str$( etol( tcyesno.no ))) |SQL Queries
stpapi.put.field("ttiex1280m000" , "projects" ,str$( etol( tcyesno.yes ))) |Project
stpapi.put.field("ttiex1280m000" , "cprj.f" ,str$(p.cprj))
stpapi.put.field("ttiex1280m000" , "cprj.t" ,str$(p.cprj))
stpapi.put.field("ttiex1280m000" , "cupt.f" ," ") |From customization part
stpapi.put.field("ttiex1280m000" , "cupt.t" ,"zzz") |To customization part
stpapi.put.field("ttiex1280m000" , "cppt.f" ," ") |From project part
stpapi.put.field("ttiex1280m000" , "cppt.t" ,"zzz") |To project part
stpapi.put.field("ttiex1280m000" , "docu" ,str$( etol( tcyesno.no ))) |Docuementation
stpapi.put.field("ttiex1280m000" , "reln" ,str$( etol( tcyesno.no ))) |Release notes

stpapi.set.report("ttiex1280m000", "ttiex12800100", "D",g.cod_error1)
stpapi.form.command("ttiex1280m000",5,"exec.cont.process",g.cod_error2)
g.cod_error4 = stpapi.get.mess.code("ttiex1280m000", g.cod_error5)
stpapi.end.session("ttiex1280m000", g.cod_error3)

p.error = trim$( g.cod_error1& " "
& g.cod_error2 & " "
& g.cod_error3 & " "
& g.cod_error4
)
return(isspace(p.error))
}


lret = 1
g.cod_error1 = ""
g.cod_error2 = "Directory path created"
g.cod_error3 = ""
g.cod_error4 = "ttadv11152"
g.cod_error5 = "Directory path created"


And after do in debugger "g 92" and continue step by step.

lret = 1
g.cod_error1 = ""
g.cod_error2 = ""
g.cod_error3 = ""
g.cod_error4 = ""
g.cod_error5 = "Command Cancelled"



I'm thinking that the problem is the session "ttiex1280m000" I think that this session have "API.MODE"

Do you know any standar solucion to this?

mark_h
29th November 2011, 16:54
This worked in 4c4. Of course I can not speak to what was exported, but it worked. It created the directory and put in all the dump files. I had to make the path longer to get it to go where I wanted. In theory you should be able to replace the continue with the form command.


function testexp()
{
domain tcmcs.str7 p.cpac
domain tcmcs.str7 p.vers.f
domain tcmcs.str7 p.rele.f
domain tcmcs.str7 p.cust.f
domain tcmcs.str7 p.vers.t
domain tcmcs.str7 p.rele.t
domain tcmcs.str7 p.cust.t
domain tcmcs.str7 p.clan
domain tcmcs.str7 p.cprj
long l.ret
domain tcmcs.st90m g.cod_error1
domain tcmcs.st90m g.cod_error2
domain tcmcs.st90m g.cod_error3
domain tcmcs.str100 g.path

p.cprj = "BOM9490"
p.cpac ="ti"
p.vers.f ="B40T"
p.rele.f ="c4"
p.cust.f ="dev"
p.vers.t ="B40T"
p.rele.t ="c4"
p.cust.t ="dev"

g.path = "./dump/"&toupper$(trim$(p.cprj))

stpapi.put.field("ttiex1280m000" , "cpac" ,trim$(str$(p.cpac))) |Package
stpapi.put.field("ttiex1280m000" , "vers" ,trim$(str$(p.vers.f))) |VRC
stpapi.put.field("ttiex1280m000" , "rele" ,trim$(str$(p.rele.f)))
stpapi.put.field("ttiex1280m000" , "cust" ,trim$(str$(p.cust.f)))
stpapi.put.field("ttiex1280m000" , "c.update" ,str$(etol(tcyesno.no))) |

stpapi.put.field("ttiex1280m000" , "based.sessions" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "dump.comp" ,str$(etol(tcyesno.yes)))
stpapi.put.field("ttiex1280m000" , "error.report" ,str$(etol(tcyesno.yes)))

stpapi.put.field("ttiex1280m000" , "path" ,str$(g.path))
stpapi.enum.answer("ttiex1280m000","ttadvq1151",tcyesno.yes) |ruta

| |componente 1
stpapi.put.field("ttiex1280m000" , "sessions" ,str$(etol(tcyesno.no))) |Sesiones
stpapi.put.field("ttiex1280m000" , "reports" ,str$(etol(tcyesno.no))) |
stpapi.put.field("ttiex1280m000" , "report.sources" ,str$(etol(tcyesno.no))) |
stpapi.put.field("ttiex1280m000" , "forms" ,str$(etol(tcyesno.no))) |
stpapi.put.field("ttiex1280m000" , "form.sources" ,str$(etol(tcyesno.no))) |
stpapi.put.field("ttiex1280m000" , "menus" ,str$(etol(tcyesno.no))) |
stpapi.put.field("ttiex1280m000" , "scripts" ,str$(etol(tcyesno.no))) |
stpapi.put.field("ttiex1280m000" , "script.sources" ,str$(etol(tcyesno.no))) |
stpapi.put.field("ttiex1280m000" , "libraries" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "library.sources" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "functions" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "func.sources" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "table.def" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "domains" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "docu" ,str$(etol(tcyesno.yes))) | docuementation
stpapi.put.field("ttiex1280m000" , "reln" ,str$(etol(tcyesno.yes))) | release notes
stpapi.put.field("ttiex1280m000" , "messages" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "questions" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "impl" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "labels" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "charts" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "help" ,str$(etol(tcyesno.no)))
stpapi.put.field("ttiex1280m000" , "sql.queries" ,str$(etol(tcyesno.no))) | SQL Queries
stpapi.put.field("ttiex1280m000" , "projects" ,str$(etol(tcyesno.yes))) | Project

| Form 3
stpapi.put.field("ttiex1280m000" , "cprj.f" , p.cprj)
stpapi.put.field("ttiex1280m000" , "cprj.t" , p.cprj)
stpapi.put.field("ttiex1280m000" , "cupt.f" ," ") |From customization part
stpapi.put.field("ttiex1280m000" , "cupt.t" ,"zzz") |To customization part
stpapi.put.field("ttiex1280m000" , "cppt.f" ," ") |From project part
stpapi.put.field("ttiex1280m000" , "cppt.t" ,"zzz") |To project part
stpapi.enum.answer("ttiex1280m000", "ttiex12801",tcyesno.yes)

stpapi.set.report("ttiex1280m000", "ttiex12800100", "D",g.cod_error1)
stpapi.continue.process("ttiex1280m000", g.cod_error2)
stpapi.end.session("ttiex1280m000", g.cod_error3)
}

darkbook4008
29th November 2011, 17:40
Mark. I was tested your code replacing continue with the form command and don't work in my environment.

I don't know why. But I can't execute any form command.

If you has any suggestion, tell me.

I will continue investigating about this problem.

Thanks for your time

mark_h
30th November 2011, 15:56
But it looks like it is trying to work - the stpapi.form.command is creating the directory. Which is the first thing it does when I hit continue(or in your case the stpapi.form.command("ttiex1280m000",5,"exec.cont.process",g.cod_error2)). See the screen shot for the message I get. In my case the ./dump directory already exists. I also do not recommend using anything with spaces in it for the path name or project name. When you run the session manually do you get the same type message as me?

I keep coming back to the data maybe stopping the session from generating the dump files. It could be the system itself.