tan.wang
21st November 2013, 04:50
hi,everyone:
when I use stpapi.get.mess.code in afs,there have a problem.anyone can help me?

code:
----------------------------------------------------------------------------
string error.msg(600)

stpapi.put.field("bptmm1120m000", "bptmm120.emno",i.emno)
stpapi.put.field("bptmm1120m000", "bptmm120.year",str$(yrno.tmp))
stpapi.put.field("bptmm1120m000", "bptmm120.peri",str$(peri.tmp))
stpapi.put.field("bptmm1120m000", "bptmm120.seqn",str$(serd.tmp))
ret = stpapi.find("bptmm1120m000",error.msg)
stpapi.form.command("bptmm1120m000", 5, "ibptmm1100.direct.process", error.msg)
if isspace(error.msg) then
error.code = stpapi.get.mess.code("bptmm1120m000", error.msg)
else
dal.set.error.message("@"&error.msg)
if appl.delete(trim$(lock.name)) <> 0 then
dal.set.error.message("tcfcz020302", trim$(lock.name))
return(DALHOOKERROR)
endif
return(DALHOOKERROR)
endif
----------------------------------------------------------------------------------
when I run this code,I got a message from afs.
like this:
error.msg = "品目 1 で製品バリアント構造を再生成できません。製品バリアント 2 を再"

But this message should be "品目 %1$s で製品バリアント構造を再生成できません。製品バリアント %2$d を再構成するには、一般品目 %3$s で標準品目を置き換えてください"
and lenth of error.message is string error.msg(600),the lenth is enough...

any one knows
how max lenth can save by stpapi.get.mess.code("bptmm1120m000", error.msg) ?

tan.wang
21st November 2013, 07:46
I found that was no problem if message is in english .
but in japanese or chinese, the message have been cutted....

how could be that....
I have no idea...

some one know what is the reason?

bhushanchanda
21st November 2013, 08:32
Hi,

Not sure if it will work, but can you try

ml_set_datalang ("your_language_code") before executing the statements?

Because, when a user is created, by default some language code is attached. May be that is causing a problem.

Please check.

tan.wang
4th December 2013, 08:04
Hi,

Not sure if it will work, but can you try

ml_set_datalang ("your_language_code") before executing the statements?

Because, when a user is created, by default some language code is attached. May be that is causing a problem.

Please check.
-------------------------------------------
thankyou,bhushanchanda~~~~:)