1 Reply Latest reply on Apr 11, 2013 9:34 AM by Francisco Amores

    Issue in FDM Import script for ading multiple amount columns.

    904367
      Hi,

      I am trying to import the Multiple amount columns to be addedd and imported as one amount column.Below is the script I am using for the same,script is getting verified in Script editor but When I am trying to Load the File I am gettig an error as below.

      ERROR
      Code............................................. 9
      Description...................................... Subscript out of range
      Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
      Component........................................ upsWObjectsDM
      Version.......................................... 1112
      Thread........................................... 8380

      Scirpt


      Function Import_YTD(strField, strRecord)
      'Set variables
      dim strCurmnth1
      dim strCurmnth2
      dim strCurmnth3
      dim strCurmnth4
      dim strCurmnth5
      dim strCurmnth6
      dim strCurmnth7
      dim strCurmnth8
      dim strCurmnth9
      dim strCurmnth10
      dim strCurmnth11
      dim strCurmnth12
      dim strCurAmount

      strCurmnth1 = Trim(DW.Utilities.fParseString(strRecord, 20, 9, ","))
      strCurmnth2 = Trim(DW.Utilities.fParseString(strRecord, 20, 10, ","))
      strCurmnth3 = Trim(DW.Utilities.fParseString(strRecord, 20, 11, ","))
      strCurmnth4 = Trim(DW.Utilities.fParseString(strRecord, 20, 12, ","))
      strCurmnth5 = Trim(DW.Utilities.fParseString(strRecord, 20, 13, ","))
      strCurmnth6 = Trim(DW.Utilities.fParseString(strRecord, 20, 14, ","))
      strCurmnth7 = Trim(DW.Utilities.fParseString(strRecord, 20, 15, ","))
      strCurmnth8 = Trim(DW.Utilities.fParseString(strRecord, 20, 16, ","))
      strCurmnth9 = Trim(DW.Utilities.fParseString(strRecord, 20, 17, ","))
      strCurmnth10 = Trim(DW.Utilities.fParseString(strRecord, 20, 18, ","))
      strCurmnth11 = Trim(DW.Utilities.fParseString(strRecord, 20, 19, ","))
      strCurmnth12 = Trim(DW.Utilities.fParseString(strRecord, 20, 20, ","))

      If strCurmnth1="" Then strCurmnth1="0" End If
      If strCurmnth2="" Then strCurmnth2="0" End If
      If strCurmnth3="" Then strCurmnth3="0" End If
      If strCurmnth4="" Then strCurmnth4="0" End If
      If strCurmnth5="" Then strCurmnth5="0" End If
      If strCurmnth6="" Then strCurmnth6="0" End If
      If strCurmnth7="" Then strCurmnth7="0" End If
      If strCurmnth8="" Then strCurmnth8="0" End If
      If strCurmnth9="" Then strCurmnth9="0" End If
      If strCurmnth10="" Then strCurmnth10="0" End If
      If strCurmnth11="" Then strCurmnth11="0" End If
      If strCurmnth12="" Then strCurmnth12="0" End If


      'Calculate the YTD Amount
      strCurAmount = CDbl(strCurmnth1) + CDbl(strCurmnth2) + CDbl(strCurmnth3) + CDbl(strCurmnth4) + CDbl(strCurmnth5) + CDbl(strCurmnth6) + CDbl(strCurmnth7) + CDbl(strCurmnth8) + CDbl(strCurmnth9) + CDbl(strCurmnth10) + CDbl(strCurmnth11) + CDbl(strCurmnth12)

      Import_YTD =strCurAmount


      End Function