gget79
11th September 2008, 15:56
Hi BaanExperts,

I am using Infor SSA LN

I am making a session that by means API can use the logic the approvals purchase orders (tdpur4210m100), but I always get the same error "No process data found.", but with the same information by the functional session I don't get the error message and all the process have been completed with success.

I am using the following code


function extern domain tcbool tccpedll.aporc.aprobar.ordenes.compras(
|Rango de selección
domain tcorno p.orno.f, | De - Orden de compra
domain tcorno p.orno.t, | A - Orden de compra
domain tccom.bpid p.otbp.f, | De - Partner proveedor
domain tccom.bpid p.otbp.t, | A - Partner proveedor
domain tccwoc p.cofc.f, | De - Departamento de compras
domain tccwoc p.cofc.t, | A - Departamento de compras
domain tcemno p.ccon.f, | De - Comprador
domain tcemno p.ccon.t, | A - Comprador
domain tcemno p.plnr.f, | De - Planificador
domain tcemno p.plnr.t, | A - Planificador
domain tcdate p.ref.date.f, | De - fecha de referencia
domain tcdate p.ref.date.t, | A - fecha de referencia
|Criterio de aprobación
domain tcyesno p.appr.rules, | ¿Aplicar reglas de aprobación?
domain tcamnt p.amnt.upto, | Importe maximo
domain tcccur p.ccur, | Divisa
|Opciones
domain tcyesno p.log.success, | ¿Listar órdenes aprobadas?
domain tcyesno p.log.report, | ¿Listar errores?
ref String p.mensaje.error | Devuelve mensajes de error
)
{

|Rango de selección
stpapi.put.field("tdpur4210m100","orno.f",str$(p.orno.f)) | De - Orden de compra
stpapi.put.field("tdpur4210m100","orno.t",str$(p.orno.t)) | A - Orden de compra
stpapi.put.field("tdpur4210m100","otbp.f",str$(p.otbp.f)) | De - Partner proveedor
stpapi.put.field("tdpur4210m100","otbp.t",str$(p.otbp.t)) | A - Partner proveedor
stpapi.put.field("tdpur4210m100","cofc.f",str$(p.cofc.f)) | De - Departamento de compras
stpapi.put.field("tdpur4210m100","cofc.t",str$(p.cofc.t)) | A - Departamento de compras
stpapi.put.field("tdpur4210m100","ccon.f",str$(p.ccon.f)) | De - Comprador
stpapi.put.field("tdpur4210m100","ccon.t",str$(p.ccon.t)) | A - Comprador
stpapi.put.field("tdpur4210m100","plnr.f",str$(p.plnr.f)) | De - Planificador
stpapi.put.field("tdpur4210m100","plnr.t",str$(p.plnr.t)) | A - Planificador
stpapi.put.field("tdpur4210m100","ref.date.f",str$(p.ref.date.f)) | De - fecha de referencia
stpapi.put.field("tdpur4210m100","ref.date.t",str$(p.ref.date.t)) | A - fecha de referencia


|Criterio de aprobación


stpapi.put.field("tdpur4210m100","appr.rules",str$(etol(p.appr.rules))) | ¿Aplicar reglas de aprobación?

if p.appr.rules = tcyesno.no then | Si aplica reglas de aprobación
stpapi.put.field("tdpur4210m100","amnt.upto",str$(p.amnt.upto)) | Importe maximo
stpapi.put.field("tdpur4210m100","ccur",str$(p.ccur)) | Divisa
endif


|Opciones
stpapi.put.field("tdpur4210m100","log.success",str$(etol(p.log.success))) | ¿Listar órdenes aprobadas?
stpapi.put.field("tdpur4210m100","log.report",str$(etol(p.log.report))) | ¿Listar errores?

| obtener reportes
stpapi.set.report("tdpur4210m100", "rtdpur421010001", "NULO", g.err.rpt)
stpapi.set.report("tdpur4210m100", "rtdpur421010002", "NULO", g.err.rpt)
| ejecutar boton aprobar
stpapi.form.command("tdpur4210m100", 5, "exec.cont.process",g.err.aprobar)
| obtener errores
g.err.code = stpapi.get.mess.code("tdpur4210m100",g.err.text)

if g.err.text="Proceso completado." then | si g.err.text= "Proceso completado."
g.err.text="" | excluir como error
endif
| cerrar la sesion tdpur4210m100
stpapi.end.session("tdpur4210m100", g.err.end)

| Verifico que no existan errores
p.mensaje.error = trim$(g.err.aprobar & " " & g.err.text & " " & g.err.end)

return( isspace( p.mensaje.error ) )
}


Anybody can help me?

Thak you very much

mark_h
13th September 2008, 19:03
I do not know about LN, but on 4C4 I have had several that worked that did generate return(or error) messages like "no data". In those cases I just ignored the error or programmed around it.