project QadFinancials > class BPosting > method ApiMassDeletePeriodicCostingPostingsTest

Description

Test-method that sinmply runs method ApiMassDeletePeriodicCostingPostings; this api-method is named like the called one (including the prefix Api although this is not a real api-method).
The method returns a temp-table holding the main info of the postings that are deleted.


Parameters


icCompanyCode1inputcharacterCompanyCode: Mandatory.
icCompanyCode2inputcharacterCompamny Code: Mandatory
icJournalCodeinputcharacterJornalCode: Mandatory.
The type of this journal should be Periodic-costing
iiPostingYearinputintegerPostingYear: Mandatory. accounting-year format 9999
iiPostingPeriodinputintegerPostingPeriod: Mandatory. accounting-period format 99
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program8/bposting.p)

/* =============================== */
/* Exception handling - main block */
/* Empty output table              */
/* =============================== */
assign oiReturnStatus      = -98
       viLocalReturnStatus = 0.

/* ======================================================================================================================== */
/* Call the api-method for the first company and then once more for the second company                                      */
/* Note this method does not return tApiPeriodicCostingPostings so we can forget about holding the content of the tem-table */ 
/* ======================================================================================================================== */
TESTBLOCK : DO : 
    
    if icCompanyCode1 <> "":U and 
       icCompanyCode1 <> ?
    then do :
        <M-13 run ApiMassDeletePeriodicCostingPostings
           (input  icCompanyCode1 (icCompanyCode), 
            input  icJournalCode (icJournalCode), 
            input  iiPostingYear (iiPostingYear), 
            input  iiPostingPeriod (iiPostingPeriod), 
            output tApiPeriodicCostingPostings (tApiPeriodicCostingPostings), 
            output viFcReturnSuper (oiReturnStatus)) in BPosting>
        if viFcReturnSuper <> 0 
        then assign viLocalReturnStatus = viFcReturnSuper.
        if viFcReturnSuper < 0
        then Leave TESTBLOCK.
    end. /* if icCompanyCode1 <> "":U and  */
    
    if icCompanyCode2 <> "":U and 
       icCompanyCode2 <> ?
    then do :
        <M-31 run ApiMassDeletePeriodicCostingPostings
           (input  icCompanyCode2 (icCompanyCode), 
            input  icJournalCode (icJournalCode), 
            input  iiPostingYear (iiPostingYear), 
            input  iiPostingPeriod (iiPostingPeriod), 
            output tApiPeriodicCostingPostings (tApiPeriodicCostingPostings), 
            output viFcReturnSuper (oiReturnStatus)) in BPosting>
        if viFcReturnSuper <> 0 
        then assign viLocalReturnStatus = viFcReturnSuper.
        if viFcReturnSuper < 0
        then Leave TESTBLOCK.
    end. /* if icCompanyCode2 <> "":U and  */
    
END. /* TESTBLOCK */

/* =============================== */
/* Exception handling - main block */
/* =============================== */
assign oiReturnStatus = viLocalReturnStatus.