jaycee99
14th April 2008, 10:18
Error: Unresolved reference to function 'stpapi.put.field'. Any idea on how to solve this?

dharam.dv
14th April 2008, 12:27
Hello,

Please write one line at the declaration section of your programming script i.e. #pragma ottstapapihand

then you can clear this error.

i hope this will work.

Regards
Dharam

NPRao
14th April 2008, 18:09
Please write one line at the declaration section of your programming script i.e. #pragma ottstapapihand

Correct declaration:

#pragma used dll ottstpapihand

jaycee99
15th April 2008, 05:20
Hi Dharam, have to use declaration as NPRao posted. But anyway thanks a lot for the suggestion.

After the compilation, i got this error again.

Compilation Failed

whinh82880:
std_gen6.2 -z -m -s pwhinh82880 -qe "d:/erpln/tmp/tmp089051333"
bic6.2 -T 1240 -Pvariant=0 pwhinh8288g -z -u -d ottstpstandard -o owhinh8288 -f "d:/erpln/tmp/tmp089051332" -pacc b61auf -qe "d:/erpln/tmp/tmp089051334"
pwhinh82880( 31): Warning: Return value of function 'f2120m000.get.pono' ignored.
pwhinh82880( 42): Error: Function 'f2120m000.get.pono' returns illegal type.
pwhinh82880( 42): Error: Illegal type combination: 'string should be: long'
pwhinh82880( 48): Error: Argument 3 for function 'stpapi.put.field' has illegal type.
pwhinh82880( 48): Error: Illegal type combination: 'long should be: string'

1 warning reported.
4 ERRORS REPORTED.


--------------------------------------------------------------------
The coding that i write is as follow:

declaration:

#pragma used dll ottstpapihand

table twhinh888 | Internal Sales Order
table twhinh220

group.1:
init.group:
get.screen.defaults()

before.program:
f2120m000.get.pono()

functions:
function extern domain tcpono f2120m000.get.pono()
{
string value(3)
stpapi.get.field("whinh2120m000","whinh220.pono", value)
return(value)
}


function extern void f2120m000.put.pono(const domain tcpono value)
{
stpapi.put.field("whinh8288x201", "whinh888.pono", value)
}


Any idea on how to solve this?

dharam.dv
15th April 2008, 08:38
Hello,

Thanks N P Rao for making me corect. Thanks again

In the fuctions you should use Data types rather Domains.

Regards
Dharam

jaycee99
15th April 2008, 08:49
Hi Dharam,

How to use data types rather than domain? Not understand? Any example?

dharam.dv
15th April 2008, 08:59
Hello,

You should write code like this: -

function extern long/string func_name(Argu)

{

Return(Value)
}

Regards
Dharam

pegu42
15th April 2008, 15:44
Hi Dharam, have to use declaration as NPRao posted. But anyway thanks a lot for the suggestion.

After the compilation, i got this error again.

function extern domain tcpono f2120m000.get.pono()
{
string value(3)
stpapi.get.field("whinh2120m000","whinh220.pono", value)
return(value)
}


function extern void f2120m000.put.pono(const domain tcpono value)
{
stpapi.put.field("whinh8288x201", "whinh888.pono", value)
}


Any idea on how to solve this?

Hello,

the third argument of function stpapi.put.field is of type string, but the domain tcpono is of type long.

You should write your code like this:


function extern domain tcpono f2120m000.get.pono()
{
string value(3)
stpapi.get.field("whinh2120m000","whinh220.pono", value)
return(lval(value))
}


function extern void f2120m000.put.pono(const domain tcpono value)
{
stpapi.put.field("whinh8288x201", "whinh888.pono", str$(value))
}


Peter

jaycee99
18th May 2008, 09:59
Warning: Return value of function "f2120m000.get.pono" ignored.

I got this warning. Is it cos of this the MMT session that created (customize) not being updated?

:mad: Stll cannot updated.