project QadFinancials > class BSharedSetMerge > method MergeValidateLoadProfDataCreditor


Parameters


iiMasterSharedSetIdinputinteger
iiRedundantSharedSetIdinputinteger
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BSharedSetMerge.MergeValidateLoadProfData


program code (program6/bsharedsetmerge.p)

/* =================================================================================================== */
/* Method      : MergeValidateLoadProfDataCreditor                                                     */
/* Desc        : This method reads referenced profile data from all elements of creditor shared sets.  */
/* --------------------------------------------------------------------------------------------------- */
/* Params:  (I)  MasterSharedSetId    Id of the master shared set                                      */
/*          (I)  RedundantSharedSetId If of the redundant shared set                                   */
/* =================================================================================================== */

assign oiReturnStatus = -98.

/* ================================================================================== */
/* Creditor Profile                                                                   */
/* ================================================================================== */
 <Q-12 run CreditorForSSMProf (all) (Read) (NoCache)
    (input ?, (CompanyId)
     input iiMasterSharedSetId, (MasterSharedSetId)
     input iiRedundantSharedSetId, (RedundantSharedSetId)
     output dataset tqCreditorForSSMProf) in BCreditor >

for each tqCreditorForSSMProf:
    create tProfileSharedSetData.
    assign tProfileSharedSetData.tcKeyValue            = tqCreditorForSSMProf.tcRedundantCreditorCode
           tProfileSharedSetData.tcFieldName           = "Profile.ProfileCode":U
           tProfileSharedSetData.tcProfileCode         = tqCreditorForSSMProf.tcProfileCode
           tProfileSharedSetData.tcMasterFieldValue    = tqCreditorForSSMProf.tcMasterCreditorCode
           tProfileSharedSetData.tcRedundantFieldValue = tqCreditorForSSMProf.tcRedundantCreditorCode.
end.

/* ================================================================================== */
/* Creditor - CnControlGLProfile                                                      */
/* ================================================================================== */
assign vcProfileFieldName = 'CnControlGLProfile_ID'.
 
<Q-1 run CreditorForSSMProfCnControlGL (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input iiMasterSharedSetId, (SharedSetId)
    output dataset tqCreditorForSSMProfCnControlGL) in BCreditor >

for each tqCreditorForSSMProfCnControlGL:
    create tMasterProfileSharedSetData.
    assign tMasterProfileSharedSetData.tcFieldName                = vcProfileFieldName
           tMasterProfileSharedSetData.tcKeyValue                 = tqCreditorForSSMProfCnControlGL.tcCreditorCode
           tMasterProfileSharedSetData.tcProfileCode              = tqCreditorForSSMProfCnControlGL.tcProfileCode   
           tMasterProfileSharedSetData.tcProfileTargetKeyValue    = tqCreditorForSSMProfCnControlGL.tcGLCode
           tMasterProfileSharedSetData.tiProfileTargetSharedSetId = tqCreditorForSSMProfCnControlGL.tiGLSharedSet_ID.
end.

<Q-2 run CreditorForSSMProfCnControlGL (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input iiRedundantSharedSetId, (SharedSetId)
    output dataset tqCreditorForSSMProfCnControlGL) in BCreditor >

for each tqCreditorForSSMProfCnControlGL:
    create tRedundantProfileSharedSetData.
    assign tRedundantProfileSharedSetData.tcFieldName                = vcProfileFieldName
           tRedundantProfileSharedSetData.tcKeyValue                 = tqCreditorForSSMProfCnControlGL.tcCreditorCode
           tRedundantProfileSharedSetData.tcProfileCode              = tqCreditorForSSMProfCnControlGL.tcProfileCode   
           tRedundantProfileSharedSetData.tcProfileTargetKeyValue    = tqCreditorForSSMProfCnControlGL.tcGLCode
           tRedundantProfileSharedSetData.tiProfileTargetSharedSetId = tqCreditorForSSMProfCnControlGL.tiGLSharedSet_ID.
end.


/* ================================================================================== */
/* Creditor - DivisionProfile                                                         */
/* ================================================================================== */
assign vcProfileFieldName = 'DivisionProfile_ID'.
 
<Q-3 run CreditorForSSMProfDivision (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input iiMasterSharedSetId, (SharedSetId)
    output dataset tqCreditorForSSMProfDivision) in BCreditor >

for each tqCreditorForSSMProfDivision:
    create tMasterProfileSharedSetData.
    assign tMasterProfileSharedSetData.tcFieldName                = vcProfileFieldName
           tMasterProfileSharedSetData.tcKeyValue                 = tqCreditorForSSMProfDivision.tcCreditorCode
           tMasterProfileSharedSetData.tcProfileCode              = tqCreditorForSSMProfDivision.tcProfileCode   
           tMasterProfileSharedSetData.tcProfileTargetKeyValue    = tqCreditorForSSMProfDivision.tcDivisionCode
           tMasterProfileSharedSetData.tiProfileTargetSharedSetId = tqCreditorForSSMProfDivision.tiDivisionSharedSet_ID.
end.

<Q-4 run CreditorForSSMProfDivision (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input iiRedundantSharedSetId, (SharedSetId)
    output dataset tqCreditorForSSMProfDivision) in BCreditor >

for each tqCreditorForSSMProfDivision:
    create tRedundantProfileSharedSetData.
    assign tRedundantProfileSharedSetData.tcFieldName                = vcProfileFieldName
           tRedundantProfileSharedSetData.tcKeyValue                 = tqCreditorForSSMProfDivision.tcCreditorCode
           tRedundantProfileSharedSetData.tcProfileCode              = tqCreditorForSSMProfDivision.tcProfileCode   
           tRedundantProfileSharedSetData.tcProfileTargetKeyValue    = tqCreditorForSSMProfDivision.tcDivisionCode
           tRedundantProfileSharedSetData.tiProfileTargetSharedSetId = tqCreditorForSSMProfDivision.tiDivisionSharedSet_ID.
end.

/* ================================================================================== */
/* Creditor - InvControlGLProfile                                                     */
/* ================================================================================== */
assign vcProfileFieldName = 'InvControlGLProfile_ID'.
 
<Q-5 run CreditorForSSMProfInvControlGL (all) (Read) (NoCache)
    (input ?, (CompanyId)
     input iiMasterSharedSetId, (SharedSetId)
     output dataset tqCreditorForSSMProfInvControlGL) in BCreditor >

for each tqCreditorForSSMProfInvControlGL:
    create tMasterProfileSharedSetData.
    assign tMasterProfileSharedSetData.tcFieldName                = vcProfileFieldName
           tMasterProfileSharedSetData.tcKeyValue                 = tqCreditorForSSMProfInvControlGL.tcCreditorCode
           tMasterProfileSharedSetData.tcProfileCode              = tqCreditorForSSMProfInvControlGL.tcProfileCode   
           tMasterProfileSharedSetData.tcProfileTargetKeyValue    = tqCreditorForSSMProfInvControlGL.tcGLCode
           tMasterProfileSharedSetData.tiProfileTargetSharedSetId = tqCreditorForSSMProfInvControlGL.tiGLSharedSet_ID.
end.

<Q-6 run CreditorForSSMProfInvControlGL (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input iiRedundantSharedSetId, (SharedSetId)
    output dataset tqCreditorForSSMProfInvControlGL) in BCreditor >

for each tqCreditorForSSMProfInvControlGL:
    create tRedundantProfileSharedSetData.
    assign tRedundantProfileSharedSetData.tcFieldName                = vcProfileFieldName
           tRedundantProfileSharedSetData.tcKeyValue                 = tqCreditorForSSMProfInvControlGL.tcCreditorCode
           tRedundantProfileSharedSetData.tcProfileCode              = tqCreditorForSSMProfInvControlGL.tcProfileCode   
           tRedundantProfileSharedSetData.tcProfileTargetKeyValue    = tqCreditorForSSMProfInvControlGL.tcGLCode
           tRedundantProfileSharedSetData.tiProfileTargetSharedSetId = tqCreditorForSSMProfInvControlGL.tiGLSharedSet_ID.
end.

/* ================================================================================== */
/* Creditor - PrePayControlGLProfile                                                  */
/* ================================================================================== */
assign vcProfileFieldName = 'PrePayControlGLProfile_ID'.
 
<Q-7 run CreditorForSSMProfPrePayGL (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input iiMasterSharedSetId, (SharedSetId)
    output dataset tqCreditorForSSMProfPrePayGL) in BCreditor >

for each tqCreditorForSSMProfPrePayGL:
    create tMasterProfileSharedSetData.
    assign tMasterProfileSharedSetData.tcFieldName                = vcProfileFieldName
           tMasterProfileSharedSetData.tcKeyValue                 = tqCreditorForSSMProfPrePayGL.tcCreditorCode
           tMasterProfileSharedSetData.tcProfileCode              = tqCreditorForSSMProfPrePayGL.tcProfileCode   
           tMasterProfileSharedSetData.tcProfileTargetKeyValue    = tqCreditorForSSMProfPrePayGL.tcGLCode
           tMasterProfileSharedSetData.tiProfileTargetSharedSetId = tqCreditorForSSMProfPrePayGL.tiGLSharedSet_ID.
end.

<Q-8 run CreditorForSSMProfPrePayGL (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input iiRedundantSharedSetId, (SharedSetId)
    output dataset tqCreditorForSSMProfPrePayGL) in BCreditor >

for each tqCreditorForSSMProfPrePayGL:
    create tRedundantProfileSharedSetData.
    assign tRedundantProfileSharedSetData.tcFieldName                = vcProfileFieldName
           tRedundantProfileSharedSetData.tcKeyValue                 = tqCreditorForSSMProfPrePayGL.tcCreditorCode
           tRedundantProfileSharedSetData.tcProfileCode              = tqCreditorForSSMProfPrePayGL.tcProfileCode   
           tRedundantProfileSharedSetData.tcProfileTargetKeyValue    = tqCreditorForSSMProfPrePayGL.tcGLCode
           tRedundantProfileSharedSetData.tiProfileTargetSharedSetId = tqCreditorForSSMProfPrePayGL.tiGLSharedSet_ID.
end.

/* ================================================================================== */
/* Creditor - PurchaseGLProfile                                                       */
/* ================================================================================== */
assign vcProfileFieldName = 'PurchaseGLProfile_ID'.
 
<Q-9 run CreditorForSSMProfPurchaseGL (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input iiMasterSharedSetId, (SharedSetId)
    output dataset tqCreditorForSSMProfPurchaseGL) in BCreditor >

for each tqCreditorForSSMProfPurchaseGL:
    create tMasterProfileSharedSetData.
    assign tMasterProfileSharedSetData.tcFieldName                = vcProfileFieldName
           tMasterProfileSharedSetData.tcKeyValue                 = tqCreditorForSSMProfPurchaseGL.tcCreditorCode
           tMasterProfileSharedSetData.tcProfileCode              = tqCreditorForSSMProfPurchaseGL.tcProfileCode   
           tMasterProfileSharedSetData.tcProfileTargetKeyValue    = tqCreditorForSSMProfPurchaseGL.tcGLCode
           tMasterProfileSharedSetData.tiProfileTargetSharedSetId = tqCreditorForSSMProfPurchaseGL.tiGLSharedSet_ID.
end.

<Q-10 run CreditorForSSMProfPurchaseGL (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input iiRedundantSharedSetId, (SharedSetId)
    output dataset tqCreditorForSSMProfPurchaseGL) in BCreditor >

for each tqCreditorForSSMProfPurchaseGL:
    create tRedundantProfileSharedSetData.
    assign tRedundantProfileSharedSetData.tcFieldName                = vcProfileFieldName
           tRedundantProfileSharedSetData.tcKeyValue                 = tqCreditorForSSMProfPurchaseGL.tcCreditorCode
           tRedundantProfileSharedSetData.tcProfileCode              = tqCreditorForSSMProfPurchaseGL.tcProfileCode   
           tRedundantProfileSharedSetData.tcProfileTargetKeyValue    = tqCreditorForSSMProfPurchaseGL.tcGLCode
           tRedundantProfileSharedSetData.tiProfileTargetSharedSetId = tqCreditorForSSMProfPurchaseGL.tiGLSharedSet_ID.
end.

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