project QadFinancials > class BConCheckProcessor > method ConCheckCreateBatchRequest

Description

This method is to create batch request for consistency check.


Parameters


iiConCheckIDinputinteger
icBatchCodeinputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BConCheck.ConCheckCreateBatch


program code (program7/bconcheckprocessor.p)

/* ================================================================================== */
/* This method is to create batch request for consistency check                       */
/* ================================================================================== */

assign oiReturnStatus = -98.

/* =================================================================================================== */
/* Validate parameters                                                                                 */
/* =================================================================================================== */
if iiConCheckID = 0 or
   iiConCheckID = ?
then do:
    assign vcMessage = #T-30'Internal error; unable to run the Consistency Check as the Identification was not specified.':255(378417515)T-30#.
    <M-94 run SetMessage
       (input  vcMessage (icMessage), 
        input  '':U (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  '':U (icRowid), 
        input  'qadfin-554861':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BConCheckProcessor>
    assign oiReturnStatus = -1.
    return.
end.

assign vcParams = string(iiConCheckID).
/* =================================================================================================== */
/* Create new batch processor request                                                                  */
/* =================================================================================================== */

/* Open instance of BMfgBatchControlDetail component */ 
BATCHDETAILBlock:
do:
    <I-69 {bFcStartAndOpenInstance
         &ADD-TO-TRANSACTION   = "false"
         &CLASS                = "BMfgBatchControlDetail"}>

    <M-84 run AddBatchControlDetail
       (input  icBatchCode (icBatchCode), 
        input  'urn:cbf:ConCheck':U (icExec), 
        input  ? (icDestination), 
        input  vcParams (icParams), 
        output viFcReturnSuper (oiReturnStatus)) in BMfgBatchControlDetail>
    if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus >= 0)
    then assign oiReturnStatus = viFcReturnSuper.
    if oiReturnStatus < 0 then leave BATCHDETAILBlock.

    <M-93 run ValidateBCAndAdditionalUpdates  (output viFcReturnSuper (oiReturnStatus)) in BMfgBatchControlDetail>
    if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus >= 0)
    then assign oiReturnStatus = viFcReturnSuper.
    if oiReturnStatus < 0 then leave BATCHDETAILBlock.

    <M-77 run DataSave  (output viFcReturnSuper (oiReturnStatus)) in BMfgBatchControlDetail>
    if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus >= 0)
    then assign oiReturnStatus = viFcReturnSuper.
    if oiReturnStatus < 0 then leave BATCHDETAILBlock.

end. /* of BATCHDETAILBlock */

/* =================================================================================================== */
/* Return                                                                                              */
/* =================================================================================================== */
if oiReturnStatus = -98 then assign oiReturnStatus = 0.