Initialize

Specifies the scenario, year, and period of the transactions that the HsvICTransactionsData instance will contain. You must call Initialize before calling the HsvICM methods GetICTransactions and ProcessAllICTrans and before using the other HsvICTransactionsData methods.

Syntax

<HsvICTransactionsData>.Initialize lScenario, lYear, lPeriod

Argument

Description

lScenario

Long (ByVal). The member ID of the transactions’ Scenario dimension member.

lYear

Long (ByVal). The member ID of the transactions’ Year dimension member.

lPeriod

Long (ByVal). The member ID of the transactions’ Period dimension member.

Example

The following subroutine shows how to loop through intercompany transactions. HsvICM.GetICTransactions populates the object with the transactions for the specified scenario, year, and period. BeginDataEnum gets the number of transactions, and GetICTransactionData is called for each transaction, with the Transaction ID and Sub ID printed to Visual Basic’s Immediate window.

Sub printTransactionIds(lScen As Long, lYear As Long, lPer As Long)
Dim cIcTransData As HsvICTransactionsData, cIcm As HsvICM, lItems As Long
Dim lSeqId As Long, lEnt As Long, lIcp As Long, lAcct As Long
Dim lCust1 As Long, lCust2 As Long, lCust3 As Long, lCust4 As Long
Dim lCurr As Long, lPostStat As Long, lMatchStat As Long, lRCode As Long
Dim lType As Long, dModDate As Double, dTrDate As Double, dAmt As Double
Dim dLocAmt As Double, dRate As Double, sUser As String
Dim sTranId As String, sSubId As String, sRefId As String
Dim sMatchCode As String, sComm1 As String, sComm2 As String
Set cIcTransData = New HsvICTransactionsData
'g_cSession is an HsvSession object reference
Set cIcm = g_cSession.ICM
cIcTransData.Initialize lScen, lYear, lPer
cIcm.GetICTransactions cIcTransData, True
cIcTransData.BeginDataEnum lItems
For i = 0 To lItems - 1
  cIcTransData.GetICTransactionData i, lSeqId, lEnt, lIcp, lAcct, _
    lCust1, lCust2, lCust3, lCust4, lCurr, lPostStat, lMatchStat, _
    lRCode, lType, dModDate, dTrDate, dAmt, dLocAmt, dRate, sUser, _
    sTranId, sSubId, sRefId, sMatchCode, sComm1, sComm2
  Debug.Print sTranId & " - " & sSubId
Next i
cIcTransData.EndDataEnum
End Sub