1 Reply Latest reply on Dec 16, 2015 5:04 PM by SH_INT

    How to write below script in fdmee

    Satheesh Selvam

      Dear all,

       

      I am new to FDMEE Jython script.

      i want to convert below VB script to Jython script.Please help me on this issue.

       

      Function FDMLOAD2(strLoc, lngCatKey, dblPerKey, strWorkTableName)

       

       

      Dim rsAppend

      Dim PerStr

      Dim strSQL

       

       

      Set cnSS = CreateObject("ADODB.Connection")

      Set rs = CreateObject("ADODB.Recordset")

      Set rsAppend = DW.DataAccess.farsTableAppend(strWorkTableName)

       

       

      PerStr =  UCase(Left(RES.PstrPer,3)+ "-"+ Right(RES.PstrPer,2))

      YearStr = Right(RES.PstrPer,4)

       

       

      cnSS.open = "Provider=OraOLEDB.Oracle;Data Source=HYPUAT;User Id=essfdm;Password=welcome1"

      strSQL = "select ACCOUNT,ENTITY,PRODUCT,ORGANIZATION,FUTURE1,FUTURE2,FEB from fdmess2"

      rs.Open strSQL, cnSS

       

       

       

       

      If rs.bof And rs.eof Then

        RES.PlngActionType = 6

        RES.PstrActionValue = "No Budget data is available for this month. Check in Hyperion Planning for the availability of data."

        PLBUD_SQL_LOAD = False

        Exit Function

      Else

        Do While Not rs.eof

        rsAppend.AddNew

        rsAppend.Fields("PartitionKey") = RES.PlngLocKey

        rsAppend.Fields("CatKey") = lngCatKey

        rsAppend.Fields("PeriodKey") = dblPerKey

        rsAppend.Fields("DataView") = "YTD"

        rsAppend.Fields("Amount") = rs.Fields("JAN").value

        rsAppend.Fields("Account") = rs.Fields("ACCOUNT").value

        rsAppend.Fields("Entity") = rs.Fields("ORGANIZATION").value

        rsAppend.Fields("ICP") = "[ICP None]"

        rsAppend.Fields("UD1") = rs.Fields("Entity").value

        rsAppend.Fields("UD2") = rs.Fields("PRODUCT").value

        rsAppend.Fields("UD3") = rs.Fields("FUTURE1").value

        rsAppend.Fields("UD4") = rs.Fields("FUTURE2").value

        rsAppend.Update

        rs.MoveNext

        Loop

        RES.PlngActionType = 6

        RES.PstrActionValue = "Budget data for all companies have been imported successfully...! :-)"

       

       

      End If

      PLBUD_SQL_LOAD = True

      rs.close

      End Function

       

      Thanks in advance

      Regards

      Satheesh.S