project QadFinancials > class BPosting > method DataLoadMirrorPosting
Description
This method is used to read counter part of mirroring posting for all postings, which are already read in the insance of the component.
Parameters
| oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program6/bposting.p)
/* ================================================================================================= */
/* Go through all already loaded postings and read counter part of the posting when Mirroring */
/* postings is activated */
/* ================================================================================================= */
assign vcFreeForm = ?.
for each tPosting where
tPosting.PostingMirrorRef <> ? and
tPosting.PostingMirrorRef <> "":U and
tPosting.tc_Status <> "D":U:
/* first check, if the counter-part is already loaded in instance */
if can-find(first bMirrorPosting where
bMirrorPosting.Company_ID = tPosting.Company_ID and
bMirrorPosting.PostingOriginReference = tPosting.PostingMirrorRef and
bMirrorPosting.tc_Rowid <> tPosting.tc_Rowid)
then next.
/* if counter-part is not loaded yet, construct query to read it */
assign vcCond = if vcFreeForm = ?
then "for each Posting where (Posting.Company_ID = &2 and Posting.PostingOriginReference = '&3' and Posting.Posting_ID <> &4)":U
else "&1 or (Posting.Company_ID = &2 and Posting.PostingOriginReference = '&3' and Posting.Posting_ID <> &4)":U
vcFreeForm = substitute(vcCond, vcFreeForm, tPosting.Company_ID, tPosting.PostingMirrorRef, tPosting.Posting_ID).
/* read mirroroing postings */
if length(vcFreeForm, "CHARACTER") > 30000
then do:
<M-31 run DataLoad
(input '':U (icRowids),
input '':U (icPkeys),
input '':U (icObjectIds),
input vcFreeForm (icFreeform),
input true (ilKeepPrevious),
output viFcReturnSuper (oiReturnStatus)) in BPosting>
if viFcReturnSuper < 0 and viFcReturnSuper <> -4 or viFcReturnSuper > 0 and oiReturnStatus = 0 then assign oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0 and viFcReturnSuper <> -4 then return.
assign vcFreeForm = ?.
end. /* if (last(tPosting) and vcFreeForm = ?) or */
end. /* for each tPosting where */
if vcFreeForm <> ?
then do:
<M-37 run DataLoad
(input '':U (icRowids),
input '':U (icPkeys),
input '':U (icObjectIds),
input vcFreeForm (icFreeform),
input true (ilKeepPrevious),
output viFcReturnSuper (oiReturnStatus)) in BPosting>
if viFcReturnSuper < 0 and viFcReturnSuper <> -4 or viFcReturnSuper > 0 and oiReturnStatus = 0 then assign oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0 and viFcReturnSuper <> -4 then return.
end. /* if (last(tPosting) and vcFreeForm = ?) or */