esanmar
4th March 2008, 12:23
Hi,
I try to change the status of several items using AFS:

stpapi.put.field("tdinv1101m000", "tdinv100.item", "FA10.0MC 2C 0.0")
stpapi.put.field("tdinv1101m000", "tdinv100.cwar", "106")
stpapi.put.field("tdinv1101m000", "tdinv100.idat", "24072002")
stpapi.put.field("tdinv1101m000", "tdinv100.sern", "1")

ret = stpapi.find("tdinv1101m000", error.msg)

The ret value is 2, but executing this sql statement in oracle:

select baandb.ttdinv100333.*
from baandb.ttdinv100333
where baandb.ttdinv100333.T$item = 'FA10.0MC 2C 0.0 ' and baandb.ttdinv100333.T$cwar = '106'
and baandb.ttdinv100333.T$idat = 24072002 and and baandb.ttdinv100333.T$sern = 1

Only returns 1 row. What's wrong?

Thanks in advance

mark_h
4th March 2008, 14:25
Not familiar with the session, but you need to get that idat field into the correct format. When putting date fields you use str$ functionality. So if you wanted todays date then it would be str$(date.num()). So change that first. When reading in string dates I usually do something like this:

num.day = val(read.date(4;2))
num.month = val(read.date(1;2)
num.year = val(read.date(7;4))
tdudi020.date = date.to.num(num.year, num.month, num.day)

Then I could use str$(tdudi020.date).