chviaud
Active Member
For everybody looking for that (I was !), it will be possible for a batch to retrieve its own JobNumber without searching it hazardously in F986110...
Indeed, looking in F986110 doesn't work if the report was launched by another report (in the same process ID), because of "ReportInterConnect" insert the record just AFTER the second report is done...
However, the JobNumber exist in "lpBhvrCom" datastructure of Business Functions. It is hidden under the "lpReportSection" parameter.
"lpReportSection" seems to be an array of pointers, and the pointer #12 is a pointer to the "UBEVAR" structure used by "jdeLaunchUBEEx" to launch the batch.
At this point, I have to specify a very important information : I tested this on OneWorld Xe, SP21. It is working on our Server (AIX) and on Local (there is no JobNumber on Local, but there is a lot of other parameters in UBEVAR, such as LogFileName...)
It is possible that the structure of "lpReportSection" change between our E1 version and yours... You have to test it : if LogFileName is correctly retrieved, it's a win.
I would have preferred to find THE structure in standards .h E1 files, rather than to recreate it ("tagReportSection" in B5500201.h). But I didn't find it (if you find it : tell me please !)
I have implemented the possibility of activate the "cCreateCSV" flag by using the "2" value. Use it in "Initialize Report (future)" and the CSV file will be created. Useful to activate CSV by Processing Options for example...
You can only use this in "Report Level Event Rules" of your report. If you use it in another Event, report will crash (because - I suppose - it want to write to CSV file and this file is not open for output)
Thanks a lot for this forum !
Christophe
Special dedication to Google translate tool ;-). I hope everybody can understand my frenglish...
4 dec 2007 : added 2 missing DataStructures in the attached file.
17 may 2011 : added Unicode version of BSFN, added function "RetrieveUbeDataSelection" and UBE R55TEST1 for example of use
Indeed, looking in F986110 doesn't work if the report was launched by another report (in the same process ID), because of "ReportInterConnect" insert the record just AFTER the second report is done...
However, the JobNumber exist in "lpBhvrCom" datastructure of Business Functions. It is hidden under the "lpReportSection" parameter.
"lpReportSection" seems to be an array of pointers, and the pointer #12 is a pointer to the "UBEVAR" structure used by "jdeLaunchUBEEx" to launch the batch.
At this point, I have to specify a very important information : I tested this on OneWorld Xe, SP21. It is working on our Server (AIX) and on Local (there is no JobNumber on Local, but there is a lot of other parameters in UBEVAR, such as LogFileName...)
It is possible that the structure of "lpReportSection" change between our E1 version and yours... You have to test it : if LogFileName is correctly retrieved, it's a win.
I would have preferred to find THE structure in standards .h E1 files, rather than to recreate it ("tagReportSection" in B5500201.h). But I didn't find it (if you find it : tell me please !)
I have implemented the possibility of activate the "cCreateCSV" flag by using the "2" value. Use it in "Initialize Report (future)" and the CSV file will be created. Useful to activate CSV by Processing Options for example...
You can only use this in "Report Level Event Rules" of your report. If you use it in another Event, report will crash (because - I suppose - it want to write to CSV file and this file is not open for output)
Thanks a lot for this forum !
Christophe
Special dedication to Google translate tool ;-). I hope everybody can understand my frenglish...
4 dec 2007 : added 2 missing DataStructures in the attached file.
17 may 2011 : added Unicode version of BSFN, added function "RetrieveUbeDataSelection" and UBE R55TEST1 for example of use