f.martel
27th December 2011, 12:18
Ia Orana !

I need to changed the date of a opération like tisfc1101m000. I used AFS.

In this thread (http://www.baanboard.com/baanboard/showthread.php?t=61655) i explain my problem and the solution (Oups )

Now the new date it's OK.

I have a other problem. With this AFS, the time (tisfc010.rutm) was changed for 2 opération:

- The first => Time = 0
- The last => Time = 10.38

Have you ideas ?

The code :


sfcdll1101ro.put.Production_Order(i.pdno)
sfcdll1101ro.put.Operation(i.opno)

sfcdll1101ro.find()
pdno.trouv2 = sfcdll1101ro.get.Production_Order()
opno.trouv = sfcdll1101ro.get.Operation()

if pdno.trouv2 = i.pdno and opno.trouv = i.opno then

sfcdll1101ro.put.Start_Date_Remainder(i.rsdt)
sfcdll1101ro.put.Start_Day_Remainder(i.rsdp)
sfcdll1101ro.update(true,o.err)
sfcdll1101ro.end()

if strip$(mess.er) <> "" then
o.err = "?"
o.err = sfcdll1101ro.get.last.message.code()
sfcdll1101ro.end()
endif

endif

sfcdll1101ro.end()

Thanks

mark_h
27th December 2011, 18:43
I am not sure what ideas are you looking for? How to update the time to 10.38?

f.martel
28th December 2011, 08:49
Ia orana Mark_h,

No, i just want to change the date for tisfc010.rsdt. But with my code, i changed date and time (tisfc010.rutm) :eek: ......

mark_h
28th December 2011, 18:43
I wrote a quick little piece of code and nothing I could try would update the runtime number of hours. Maybe it is a difference in systems - I am not too up on parameters and how they might impact sessions like this. The one thought I had was to do the find, get the runtime, put the date fields, the old runtime and then do the update. My code is essentially the same as yours. The only difference is I check the return code(rc) to ensure the correct record is found and I put the str variables to the session. Also I would usually check the variable err for any update err message.


stpapi.put.field("tisfc1101m000","tisfc010.pdno",str$(940712))
stpapi.put.field("tisfc1101m000","tisfc0101.opno",str$(100))
rc = stpapi.find("tisfc1101m000", err )
if rc = 1 then
stpapi.put.field("tisfc1101m000","tisfc010.rsdt",str$(date.num()+1))
stpapi.put.field("tisfc1101m000","tisfc010.rsdp",str$(86))
rc = stpapi.update("tisfc1101m000", 1, err)
endif
stpapi.end.session("tisfc1101m000")


If you own source code for tisfc1101m000 you can put it in debug mode to see what it is doing to cause this issue.

f.martel
2nd February 2012, 15:46
Ia orana !

Mark, sorry for response time :o


After many test, the problem comes from the update in tisfc1101m000 as you said.

We don't have the source code, so i write a control / modification function waiting ti get the source code.

Thank's

François