project QadFinancials > class BSharedSetMerge > method MergeValidateLoadSharedSetData
Description
MergeValidate - step 2: This method retrieves content of the shares set.
Parameters
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
unused
program code (program6/bsharedsetmerge.p)
/* =================================================================================================== */
/* Method : MergeValidateLoadSharedSetData */
/* STEP 2 */
/* Desc : This method retrieves content of the shares set */
/* --------------------------------------------------------------------------------------------------- */
/* Params: (H) MergeValidateTable Temporary table with definition of tables needed to validate */
/* for shared set merge */
/* (H) MasterSharedSetData Array of handles to temporary table with content of master */
/* shared set */
/* (H) RedundantSharedSetData Array of handles to temporary table with content of redundant */
/* shared set */
/* =================================================================================================== */
assign oiReturnStatus = -98.
/* =================================================================================================== */
/* Default output values */
/* =================================================================================================== */
do viIndex = 1 to 5:
assign vhMasterSharedSetData[viIndex] = ?
vhRedundantSharedSetData[viIndex] = ?.
end.
/* =================================================================================================== */
/* Get data of all tables of master and redundant shared sets */
/* =================================================================================================== */
for each tMergeValidateTable:
assign vhMasterHandle = ?
vhRedundantHandle = ?.
case tMergeValidateTable.tcTableName:
when 'CostCentre':U
then do:
/* Get content of master shared set and store to temporary table */
<Q-1 run CostCentreForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viMasterSharedSetId, (SharedSetId)
output dataset tqCostCentreForSharedSetMergeVal) in BCostCentre >
assign vhResultTempTableHandle = temp-table tqCostCentreForSharedSetMergeVal:handle.
create temp-table vhMasterHandle in widget-pool "non-persistent".
vhMasterHandle:create-like(vhResultTempTableHandle).
vhMasterHandle:temp-table-prepare("CostCentre":U).
vhMasterHandle:copy-temp-table(vhResultTempTableHandle).
/* Get content of redundant shared set and store to temporary table */
<Q-2 run CostCentreForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viRedundantSharedSetId, (SharedSetId)
output dataset tqCostCentreForSharedSetMergeVal) in BCostCentre >
assign vhResultTempTableHandle = temp-table tqCostCentreForSharedSetMergeVal:handle.
create temp-table vhRedundantHandle in widget-pool "non-persistent".
vhRedundantHandle:create-like(vhResultTempTableHandle).
vhRedundantHandle:temp-table-prepare("CostCentre":U).
vhRedundantHandle:copy-temp-table(vhResultTempTableHandle).
end.
when 'Creditor':U
then do:
/* Get content of master shared set and store to temporary table */
<Q-5 run CreditorForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viMasterSharedSetId, (SharedSetId)
output dataset tqCreditorForSharedSetMergeVal) in BCreditor >
assign vhResultTempTableHandle = temp-table tqCreditorForSharedSetMergeVal:handle.
create temp-table vhMasterHandle in widget-pool "non-persistent".
vhMasterHandle:create-like(vhResultTempTableHandle).
vhMasterHandle:temp-table-prepare("Creditor":U).
vhMasterHandle:copy-temp-table(vhResultTempTableHandle).
/* Get content of redundant shared set and store to temporary table */
<Q-6 run CreditorForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viRedundantSharedSetId, (SharedSetId)
output dataset tqCreditorForSharedSetMergeVal) in BCreditor >
assign vhResultTempTableHandle = temp-table tqCreditorForSharedSetMergeVal:handle.
create temp-table vhRedundantHandle in widget-pool "non-persistent".
vhRedundantHandle:create-like(vhResultTempTableHandle).
vhRedundantHandle:temp-table-prepare("Creditor":U).
vhRedundantHandle:copy-temp-table(vhResultTempTableHandle).
end.
when 'Debtor':U
then do:
/* Get content of master shared set and store to temporary table */
<Q-9 run DebtorForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viMasterSharedSetId, (SharedSetId)
output dataset tqDebtorForSharedSetMergeVal) in BDebtor >
assign vhResultTempTableHandle = temp-table tqDebtorForSharedSetMergeVal:handle.
create temp-table vhMasterHandle in widget-pool "non-persistent".
vhMasterHandle:create-like(vhResultTempTableHandle).
vhMasterHandle:temp-table-prepare("Debtor":U).
vhMasterHandle:copy-temp-table(vhResultTempTableHandle).
/* Get content of redundant shared set and store to temporary table */
<Q-10 run DebtorForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viRedundantSharedSetId, (SharedSetId)
output dataset tqDebtorForSharedSetMergeVal) in BDebtor >
assign vhResultTempTableHandle = temp-table tqDebtorForSharedSetMergeVal:handle.
create temp-table vhRedundantHandle in widget-pool "non-persistent".
vhRedundantHandle:create-like(vhResultTempTableHandle).
vhRedundantHandle:temp-table-prepare("Debtor":U).
vhRedundantHandle:copy-temp-table(vhResultTempTableHandle).
end.
when 'Division':U
then do:
/* Get content of master shared set and store to temporary table */
<Q-13 run DivisionForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viMasterSharedSetId, (SharedSetId)
output dataset tqDivisionForSharedSetMergeVal) in BDivision >
assign vhResultTempTableHandle = temp-table tqDivisionForSharedSetMergeVal:handle.
create temp-table vhMasterHandle in widget-pool "non-persistent".
vhMasterHandle:create-like(vhResultTempTableHandle).
vhMasterHandle:temp-table-prepare("Division":U).
vhMasterHandle:copy-temp-table(vhResultTempTableHandle).
/* Get content of redundant shared set and store to temporary table */
<Q-14 run DivisionForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viRedundantSharedSetId, (SharedSetId)
output dataset tqDivisionForSharedSetMergeVal) in BDivision >
assign vhResultTempTableHandle = temp-table tqDivisionForSharedSetMergeVal:handle.
create temp-table vhRedundantHandle in widget-pool "non-persistent".
vhRedundantHandle:create-like(vhResultTempTableHandle).
vhRedundantHandle:temp-table-prepare("Division":U).
vhRedundantHandle:copy-temp-table(vhResultTempTableHandle).
end.
when 'ExchangeRate':U
then do:
/* Merging of shared set types of Exchange rate is specific in some cases */
/* It is not in fact merge, it is remove of redundant shared set only, */
/* There is not need for validation also */
/* Get content of redundant shared set and store to temporary table */
<Q-18 run ExchangeRateForSSMVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viRedundantSharedSetId, (SharedSetId)
output dataset tqExchangeRateForSSMVal) in BExchangeRate >
assign vhResultTempTableHandle = temp-table tqExchangeRateForSSMVal:handle.
create temp-table vhRedundantHandle in widget-pool "non-persistent".
vhRedundantHandle:create-like(vhResultTempTableHandle).
vhRedundantHandle:temp-table-prepare("ExchangeRate":U).
vhRedundantHandle:copy-temp-table(vhResultTempTableHandle).
/* There is only empty temporary table with master shared set */
create temp-table vhMasterHandle in widget-pool "non-persistent".
vhMasterHandle:create-like(vhResultTempTableHandle).
vhMasterHandle:temp-table-prepare("ExchangeRate":U).
end.
when 'GL':U
then do:
/* Get content of master shared set and store to temporary table */
<Q-21 run GLForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viMasterSharedSetId, (SharedSetMerge)
output dataset tqGLForSharedSetMergeVal) in BGL >
assign vhResultTempTableHandle = temp-table tqGLForSharedSetMergeVal:handle.
create temp-table vhMasterHandle in widget-pool "non-persistent".
vhMasterHandle:create-like(vhResultTempTableHandle).
vhMasterHandle:temp-table-prepare("GL":U).
vhMasterHandle:copy-temp-table(vhResultTempTableHandle).
/* Get content of redundant shared set and store to temporary table */
<Q-22 run GLForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viRedundantSharedSetId, (SharedSetMerge)
output dataset tqGLForSharedSetMergeVal) in BGL >
assign vhResultTempTableHandle = temp-table tqGLForSharedSetMergeVal:handle.
create temp-table vhRedundantHandle in widget-pool "non-persistent".
vhRedundantHandle:create-like(vhResultTempTableHandle).
vhRedundantHandle:temp-table-prepare("GL":U).
vhRedundantHandle:copy-temp-table(vhResultTempTableHandle).
end.
when 'GLBankNumber':U
then do:
/* Get content of master shared set and store to temporary table */
<Q-33 run GLForSharedSetMergeValBank (all) (Read) (NoCache)
(input ?, (CompanyId)
input viMasterSharedSetId, (SharedSetId)
output dataset tqGLForSharedSetMergeValBank) in BGL >
assign vhResultTempTableHandle = temp-table tqGLForSharedSetMergeValBank:handle.
create temp-table vhMasterHandle in widget-pool "non-persistent".
vhMasterHandle:create-like(vhResultTempTableHandle).
vhMasterHandle:temp-table-prepare("GLBankNumber":U).
vhMasterHandle:copy-temp-table(vhResultTempTableHandle).
/* Get content of redundant shared set and store to temporary table */
<Q-34 run GLForSharedSetMergeValBank (all) (Read) (NoCache)
(input ?, (CompanyId)
input viRedundantSharedSetId, (SharedSetId)
output dataset tqGLForSharedSetMergeValBank) in BGL >
assign vhResultTempTableHandle = temp-table tqGLForSharedSetMergeValBank:handle.
create temp-table vhRedundantHandle in widget-pool "non-persistent".
vhRedundantHandle:create-like(vhResultTempTableHandle).
vhRedundantHandle:temp-table-prepare("GLBankNumber":U).
vhRedundantHandle:copy-temp-table(vhResultTempTableHandle).
end.
when 'Journal':U
then do:
/* Get content of master shared set and store to temporary table */
<Q-25 run JournalForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viMasterSharedSetId, (SharedSetId)
output dataset tqJournalForSharedSetMergeVal) in BJournal >
assign vhResultTempTableHandle = temp-table tqJournalForSharedSetMergeVal:handle.
create temp-table vhMasterHandle in widget-pool "non-persistent".
vhMasterHandle:create-like(vhResultTempTableHandle).
vhMasterHandle:temp-table-prepare("Journal":U).
vhMasterHandle:copy-temp-table(vhResultTempTableHandle).
/* Get content of redundant shared set and store to temporary table */
<Q-26 run JournalForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viRedundantSharedSetId, (SharedSetId)
output dataset tqJournalForSharedSetMergeVal) in BJournal >
assign vhResultTempTableHandle = temp-table tqJournalForSharedSetMergeVal:handle.
create temp-table vhRedundantHandle in widget-pool "non-persistent".
vhRedundantHandle:create-like(vhResultTempTableHandle).
vhRedundantHandle:temp-table-prepare("Journal":U).
vhRedundantHandle:copy-temp-table(vhResultTempTableHandle).
end.
when 'Project':U
then do:
/* Get content of master shared set and store to temporary table */
<Q-29 run ProjectForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viMasterSharedSetId, (SharedSetId)
output dataset tqProjectForSharedSetMergeVal) in BProject >
assign vhResultTempTableHandle = temp-table tqProjectForSharedSetMergeVal:handle.
create temp-table vhMasterHandle in widget-pool "non-persistent".
vhMasterHandle:create-like(vhResultTempTableHandle).
vhMasterHandle:temp-table-prepare("Project":U).
vhMasterHandle:copy-temp-table(vhResultTempTableHandle).
/* Get content of redundant shared set and store to temporary table */
<Q-30 run ProjectForSharedSetMergeVal (all) (Read) (NoCache)
(input ?, (CompanyId)
input viRedundantSharedSetId, (SharedSetId)
output dataset tqProjectForSharedSetMergeVal) in BProject >
assign vhResultTempTableHandle = temp-table tqProjectForSharedSetMergeVal:handle.
create temp-table vhRedundantHandle in widget-pool "non-persistent".
vhRedundantHandle:create-like(vhResultTempTableHandle).
vhRedundantHandle:temp-table-prepare("Project":U).
vhRedundantHandle:copy-temp-table(vhResultTempTableHandle).
end.
end case. /* case tMergeValidateTable.tcTableName: */
/* store dynamicallly created temporary tables with shared set content to component variables */
assign viIndex = integer(tMergeValidateTable.tc_Rowid)
vhMasterSharedSetData[viIndex] = vhMasterHandle
vhRedundantSharedSetData[viIndex] = vhRedundantHandle.
end. /* for each tMergeValidateTable: */
/* =================================================================================================== */
/* Return */
/* =================================================================================================== */
if oiReturnStatus = -98 then assign oiReturnStatus = 0.