hmliang
30th June 2007, 17:53
Hi All,

i create to a unit template table,i hope insert tcmcs001 via API function "stpapi".

i use way:
stpapi.put.field("tcmcs0101m000","tcmcs001.cuni",tcmcs999.cuni)
but system show error message:

process 51 - Error in TSSmblen_n:Partial multibyte character at end of string (read.text.data() in object ottstpmsg)

TSS WARNING:(ISO-8859-1) *** Error in TssConvertTssToUtf16:Premature end of data:9B25D200 (TSS):0041C1D0

Thanks in Advance.

mark_h
1st July 2007, 03:48
You should post all of you code. To me it seems like there might be some special characters stuck in the tcmcs999 fields. Of course that is pure speculation - plus I do not know anything about Baan V.

hmliang
1st July 2007, 07:26
Hi All,

i create to a unit template table,i hope will template table data export to tcmcs001 via API function "stpapi".

code:

function read.main.table()
{
select tcunit999.*
from tcunit999
selectdo
stpapi.synchronize.dialog("tcmcs0101m000","add",error)
stpapi.put.field("tcmcs0101m000","tcmcs001.unit",tcunit999.unit)
stpapi.put.field("tcmcs0101m000","tcmcs001.dsca",tcunit999.dsca)
stpapi.put.field("tcmcs0101m000","tcmcs001.seqn",tcunit999.tccu)
stpapi.put.field("tcmcs0101m000","tcmcs001.crnd",str$(tcunit999.crnd))

ret=stpapi.insert("tcmcs0101m000",1,error)

if ret=0 then
message(error)
else
n=n+1
unit=tibom999.unit
endif

display("unit")
display("n")
endselect

}

but session run show error.

Thanks in Advance.

mark_h
1st July 2007, 22:16
Moved and merged your threads.

Are the unit and seqn table fields numeric fields? If so then use str$() to send them in string format. You can only send strings to called sessions. I also think since you are dealing with only one session you do not need the stpapi.sync.dialog statement.

_Ralph_
2nd July 2007, 19:39
I also think since you are dealing with only one session you do not need the stpapi.sync.dialog statement.

I do not know in BaanV but in LN some sessions are displayed on overview mode and when a record is added the same session appears in a synchronized dialog. In this cases this kind of logic is used. :)