XE/ERP8 API jdelaunchUBEEx

API jdeLaunchUBEEx should be called whenever a UBE is to be launched from a C Business Function. Based on OCM setting, the API will Either launch the UBE Locally Or to the server.

ParameterDescriptionI/ORequired

HUSERPointer to HUSER structureIYes

PUBEVARData Structure containing information IYes

necessary to run the UBE

LPVOIDPointer to the Report Interconnect Data I/OYes

Structure (if applicable)

LPBHVRCOMPointer to Behavior Communication StructureIYes

Return ValueDescription

TRUEIf API successfully launches the UBE

FALSEIf API is unable to launch the UBE

Relevant fields of the PUBEVAR structure to populate/add before calling the API

szReport : name of the report

szVersion : name of the report version

bSynchFlag : TRUE if report is run synchronously, FALSE if report is run asynchronously

bPreview : TRUE if PDF output to display on screen, FALSE if PDF output sent to printer

bBatchFlag: TRUE to suppress display of Printer Selection at submission time

mnJobNum: server job number in F986110 associated with the report

zReportFlags |= eDRRPTPrintImmediate : if PrintImmediate is required

zReportFlags |= eDRRPTSaveOutput : if SaveOutput is required

szJobQueue: server job queue to run report, applies only for asynchronous report

NOTE:

(a) The Default Printer for the UBE Output is derived from the UBE Version specs if a printer is defined; otherwise it is derived from the Default Printer table (F986167).

(b) When a UBE is launched via API jdelaunchUBEEx with Printer Suppression and Print Immediate setting On from a business function running on the server, the batch engine does not read the Server JDE.INI setting for SaveOutput. Instead, the SaveOutput setting is read from the PUBEVAR parameter passed into the API in the business function. If the SaveOutput setting is not set in the PUBEVar structure, the default action is to delete the UBE output after printing. So, in order to have the UBE output saved after printing, set SaveOutput setting to TRUE in the PUBEVar structure.

Recommendation

Create a custom C business function to customize the use of the API.

Pre-Requisite Knowledge

C Business Function Programming

OneWorld Development Tools

Examples of existing C business functions using the API.

B4301660 LaunchPOPrintUBE

UBE does not have report interconnect data structure

Synch (Y), Preview(N), SuppressPrinterDialog (Y)

Launch PO Print UBE

"R0010P" -> szProgramId

"ZJDE0001" -> szVersion

UNDEFINED X cErrorCode

B91300C LaunchBatchApplication

UBE does not have report interconnect data structure

SuppressPrinterDialog (Y)

Launch Batch Application

"R0010P" -> szReport

"ZJDE0001" -> szVersionJDE

"1" -> cSynch

"<Zero>" -> cPrintPreview

UNDEFINED -> szDataSourceOverride

UNDEFINED <- mnServerJobNumber

UNDEFINED <- cReturn

"0" -> cJDELogging

"0" -> cTracing

"0" -> cUBELoggingLevel

"<Blank>" -> szJobQueue

The Job Number of the UBE is returned in mnServerJobNumber (DD Alias JOBNBR)

B4200310 Sales Order Entry Master Business Function: function I4200310_LaunchR42997

UBE has a report interconnect data structure

If the header file of the report interconnect DS does not already exist,

-generate it in ReportDesignAid|Report Properties|Advanced Tab

--check subsystem box, click on Generate, uncheck subsystem box

More Examples

-Search on folder b7\pathcode\source for "jdeLaunchUBEEx" in Containing Text

5/19/2019 Page 1 of 2