tbrault
6th March 2002, 15:55
Hi
Firstly : thanks mark for the last post, that's help me much. :D
I have another pb (that is probably the last (I hope))?
I want to run the session "tisfc0204m000" (Release Production Order). But, the program in vb that I've created don't walk. (the order stay with the statut : printed order)
Help please
It's my program :
""
Public Function Lancement_OF()
'--> Nouveau parametre, déclaration---------------------------------------
'----> Declaration Session
Dim SessionLancement As String
Dim RapportImpression As String
Dim ErrMessage1 As String
'---> Declaration Champs
Dim OfKey1 As String
Dim OfKey2 As String
Dim DateDebutKey As String
Dim DateFinKey As String
Dim CodeImprimante As String
'----> Declaration variable
Dim OfKeyValue1 As String
Dim OfKeyValue2 As String
Dim DateDebutKeyValue As String
Dim DateFinKeyValue As String
'-------------------------------------------------------------------------
'--> Definition parametre-------------------------------------------------
'----> Definition Session
SessionLancement = "tisfc0204m000"
RapportImpression = "rtisfc020401000"
ErrMessage1 = Space(30)
'----> Definition champs
OfKey1 = "pdno.f"
OfKey2 = "pdno.t"
DateDebutKey = "prdt.f"
DateFinKey = "prdt.t"
CodeImprimante = "CANON5000"
'----> Definition variable
OfKeyValue1 = "140399"
OfKeyValue2 = "140399"
DateDebutKeyValue = Format("26/03/01", "mmddyyyy")
DateFinKeyValue = Format("26/03/03", "mmddyyyy")
'--------------------------------------------------------------------------
Set BaanObj = CreateObject("Baan4.Application")

BaanObj.ParseExecFunction "ottstpapihand", "stpapi.put.field(" & Chr(34) & SessionLancement & Chr(34) & "," & Chr(34) & OfKey1 & Chr(34) & "," & Chr(34) & OfKeyValue1 & Chr(34) & ")"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.put.field(" & Chr(34) & SessionLancement & Chr(34) & "," & Chr(34) & OfKey2 & Chr(34) & "," & Chr(34) & OfKeyValue2 & Chr(34) & ")"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.put.field(" & Chr(34) & SessionLancement & Chr(34) & "," & Chr(34) & DateDebutKey & Chr(34) & "," & Chr(34) & DateDebutKeyValue & Chr(34) & ")"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.put.field(" & Chr(34) & SessionLancement & Chr(34) & "," & Chr(34) & DateFinKey & Chr(34) & "," & Chr(34) & DateFinKeyValue & Chr(34) & ")"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.set.report(" & Chr(34) & SessionLancement & Chr(34) & "," & Chr(34) & RapportImpression & Chr(34) & "," & Chr(34) & CodeImprimante & Chr(34) & "," & Chr(34) & ErrMessage1 & Chr(34) & ")"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.continue.process(" & Chr(34) & SessionLancement & Chr(34) & "," & Chr(34) & ErrMessage1 & Chr(34) & ")"
End Function

mark_h
6th March 2002, 16:52
The coding looks fine, so my first guess would be the dates. I have not really tried using date fields. I have not done this but you could try doing a get.field to see what the date looks like. The one time I used a date I did this to it:
date_t = Format(date_t, "yyyy,m,d")
date_f = Format(date_f, "yyyy,m,d")
Then I executed this (only part of the query)
Query = "select tisfc902.*, tisfc001.mitm" & _
" from tisfc902,tisfc001" & _
" where tisfc902.date inrange date.to.num(" & date_f & ") and" & _

So I just do not feel comfortable with you passing what are date variables as strings. BUT you could be right. Just a guess.

Mark

tbrault
6th March 2002, 17:24
OK, thanks. I modify my program by deleting the started date and the program run now.
For information, with stpapi, date format is mmddyyyy.
Thanks for all! :cool:

mark_h
6th March 2002, 20:24
Merged the threads wrong and could not get it fixed. Big Sigh...

Mark