FDM - Building Integration Import Scripts
Hi All,
I am trying to write an Integration Script to load SQL Server data into FDM 9.3.1. The script initialises a recordset object for the worktable that the source SQL Server data is loaded into.
The statement at which my script fails is:
Set rsAppend = DW.DataAccess.farsTable(strWorkTableName)*
I have followed the sample script documented in the FDM Admin Guide.
Does anyone have ideas as to why the script fails at this statement?
Thanks,
Hi everyone,
I was wondering if sending the sample code would help get a clearer picture....
Function CTIDB2Test(strLoc, lngCatKey, dblPerKey, strWorkTableName)
'Hyperion FDM Integration Import Script:
'Created By: admin
'Date Created: 2/19/2009 1:16:59 PM
'Purpose: This import integration script connects to the CentroODS database
' and imports Actuals data from the generalLedgerMasterFile and glMasterAccount table into FDM
Dim cnSS 'ADO Connection object
Dim strSQL ' SQL String
Dim rs ' Source System recordset
Dim rsAppend ' FDM recordset
Dim sPOVString
Dim sPOVPeriod
Dim sDataCol
' Initialise the ADO objects
Set cnSS = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.RecordSet")
Set rsAppend = DW.DataAccess.farsTableAppend(strWorkTableName)
The script fails at the statement:
Set rsAppend = DW.DataAccess.farsTableAppend(strWorkTableName)
Thanks
Similar Messages
-
Using FDM to load data from oracle table (Integration Import Script)
Hi,
I am using Integration Import Script to load data from oracle table to worktables in FDM.
i am getting following error while running the script.
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done
Attaching the full error report
ERROR:
Code............................................. -2147217887
Description...................................... Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
At line: 22
Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
Component........................................ upsWObjectsDM
Version.......................................... 1112
Thread........................................... 6260
IDENTIFICATION:
User............................................. ******
Computer Name.................................... *******
App Name......................................... FDMAPP
Client App....................................... WebClient
CONNECTION:
Provider......................................... ORAOLEDB.ORACLE
Data Server......................................
Database Name.................................... DBNAME
Trusted Connect.................................. False
Connect Status.. Connection Open
GLOBALS:
Location......................................... SCRTEST
Location ID...................................... 750
Location Seg..................................... 4
Category......................................... FDM ACTUAL
Category ID...................................... 13
Period........................................... Jun - 2011
Period ID........................................ 6/30/2011
POV Local........................................ True
Language......................................... 1033
User Level....................................... 1
All Partitions................................... True
Is Auditor....................................... False
I am using the following script
Function ImpScrTest(strLoc, lngCatKey, dblPerKey, strWorkTableName)
'Oracle Hyperion FDM Integration Import Script:
'Created By: Dhananjay
'Date Created: 1/17/2012 10:29:53 AM
'Purpose:A test script to import data from Oracle EBS tables
Dim cnSS 'ADODB.Connection
Dim strSQL 'SQL string
Dim rs 'Recordset
Dim rsAppend 'tTB table append rs object
'Initialize objects
Set cnSS = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
Set rsAppend = DW.DataAccess.farsTable(strWorkTableName)
'Connect to SQL Server database
cnss.open "Provider=OraOLEDB.Oracle.1;Data Source= +server+;Initial Catalog= +catalog+;User ID= +uid+;Password= +pass+"
'Create query string
strSQL = "Select AMOUNT,DESCRIPTION,ACCOUNT,ENTITY FROM +catalog+.TEST_TMP"
'Get data
rs.Open strSQL, cnSS
'Check for data
If rs.bof And rs.eof Then
RES.PlngActionType = 2
RES.PstrActionValue = "No Records to load!"
Exit Function
End If
'Loop through records and append to tTB table in location’s DB
If Not rs.bof And Not rs.eof Then
Do While Not rs.eof
rsAppend.AddNew
rsAppend.Fields("PartitionKey") = RES.PlngLocKey
rsAppend.Fields("CatKey") = RES.PlngCatKey
rsAppend.Fields("PeriodKey") = RES.PdtePerKey
rsAppend.Fields("DataView") = "YTD"
rsAppend.Fields("CalcAcctType") = 9
rsAppend.Fields("Amount") = rs.fields("Amount").Value
rsAppend.Fields("Desc1") = rs.fields("Description").Value
rsAppend.Fields("Account") = rs.fields("Account").Value
rsAppend.Fields("Entity") = rs.fields("Entity").Value
rsAppend.Update
rs.movenext
Loop
End If
'Records loaded
RES.PlngActionType = 6
RES.PstrActionValue = "Import successful!"
'Assign Return value
SQLIntegration = True
End Function
Please help me on this
Thanks,
Dhananjay
Edited by: DBS on Feb 9, 2012 10:21 PMHi,
I found the problem.It was because of the connection string.The format was different for oracle tables.
PFB the format
*cnss.open"Provider=OraOLEDB.Oracle.1;Data Source= servername:port/SID;Database= DB;User Id=aaaa;Password=aaaa;"*
And thanks *SH* for quick response.
So closing the thread......
Thanks,
Dhananjay -
Schedule a SQL Integration Import Script
Hey Everyone! I need some help from the FDM community.
I am currently using FDM 11.1.2.1 and using the Hyperion Essbase adapter to load data to a Planning/Essbase application. I have successfully created a SQL integration import script that connects directly to Oracle EBS, and have manually tested the process up-to-check of the workflow. However, I would like to schedule this process on a nightly basis. I am aware of the batch processing task scheduler and have used it previously, but I am obviously not dumping flat files into the OpenBatch directory nor am I using the Custom General script usually associated with Batch Processing. So, is there a Custom General script that I can use to call on the import integration script so I can schedule such a process?
Please let me know, and thank you for your time!
Sincerely,
CraigYou can do this with the batch. You just create a blank text file with the proper naming convention for the POV you are going to kick off the integration script for and place it in Open batch. The batch will then execute the integration script for the POV when executed.
-
FDM - Integration IMPORT script failed
Hi,
We are on 11.1.2.1.
I am trying to create a import integration script which i took from the FDM admin guide...and i am trying to pull data from Oracle table...
But i am getting error as "Data access error" and its in the below line when i try to execute the code form the workbench...but when i use the import button in the web its importing....*i beleive its somethign related to the STRWORKTABLENAME and somewhere i read that i need to declare the function FARSTABLE*...but i dont know how as i am pretty novice to that....can you please help me....
Set rsAppend = DW.DataAccess.farsTable(strWorkTableName)
also when i checked the error log i saw
*** Begin FDM Runtime Error Log Entry [2012-07-03 07:06:27] ***
ERROR:
Code............................................. -2147467259
Description...................................... ORA-00903: invalid table name
Procedure........................................ clsDataAccess.farsTableAppend
Component........................................ upsWDataWindowDM
Version.......................................... 1112
Thread........................................... 20228
Below is the complete code i am using
Function SI_ActualLoad(strLoc, lngCatKey, dblPerKey, strWorkTableNam)*
*+'------------------------------------------------------------------+*
+'Oracle Hyperion FDM IMPORT Integration Script:+
+'+
+'Created By: admin+
+'Date Created: 2012-06-01 01:19:02+
+'strWorkTableName+
+'Purpose:+
+'strWorkTableName+
*+'------------------------------------------------------------------+*
Dim cnSS 'ADO connection Object*
Dim strSQL 'SQL String*
Dim rs 'Source system recordset*
Dim rsAppend 'Hyperion FDM recordset*
Dim monthvar*
+'Initialize ADO objects+
Set cnSS = CreateObject("ADODB.Connection")*
Set rs = CreateObject("ADODB.Recordset")*
monthvar=Month(Date)*
+'Open Hyperion FDM work table recordset For appending+
+'Set rsappend = DW.DataAccess.farsTableAppend(strWorkTableName)+
+'Connect To Oracle database (our data source)+
Dim strConn*
strConn="Provider=ORAOLEDB.ORACLE.1;Data Source=EMDDS392:1521/DEVDBEMD;Database=DEVDBEMD;User id=xxxxxxx;Password=xxxxx"*
cnss.open strConn*
+'Create source query String+
strSQL = "Select * "*
+'strSQL = strSQL & "FROM STG_SAP_ACTUALS WHERE ACCOUNT NOT LIKE 'NA'"+
strSQL = strSQL & "from EGETLDB.STG_SAP_ACTUALS where period =SUBSTR(TO_CHAR(SYSDATE-90,'MONTH'),1,5)"*
+'Open source recordset+
rs.Open strSQL, cnSS*
+'Check For data In source system+
If rs.bof And rs.eof Then*
+'Give Error message+
RES.PlngActionType = 2*
RES.PstrActionValue = "No records To load!"*
+'Assign Return value of Function+
SI_ActualLoad = False ' Assign return value of function*
Exit Function*
End If*
+'Loop through source records In database And append To+
+'Hyperion FDM work table+
If Not rs.bof And Not rs.eof Then*
Do While Not rs.eof*
rsAppend.AddNew*
rsAppend.Fields("PartitionKey") = RES.PlngLocKey*
rsAppend.Fields("CatKey") = RES.lngCatKey*
rsAppend.Fields("PeriodKey") = RES.dblPerKey*
rsAppend.Fields("DataView") = "YTD"*
rsAppend.Fields("CalcAcctType") = 9*
rsAppend.Fields("Amount") = rs.fields("GROUPCURRENCY").Value*
rsAppend.Fields("Account") =UCase(rs.fields("ACCOUNT").Value)*
rsAppend.Fields("Entity") = UCase(rs.fields("ENTITY").Value)*
rsAppend.Fields("UD1") = UCase(rs.fields("SCENARIO").Value)*
rsAppend.Fields("UD2") = rs.fields("VERSION").Value*
rsAppend.Fields("UD3") = rs.fields("CURRENCY").Value*
rsAppend.Fields("UD4") = rs.fields("TRANS_CURRENCY").Value*
rsAppend.Fields("UD5") = rs.fields("ZONE").Value*
rsAppend.Fields("UD6") = rs.fields("CATEGORY").Value*
rsAppend.Fields("UD7") = rs.fields("SCHEDULE").Value*
rsAppend.Fields("UD8") =UCase(rs.fields("DEPT_PRJCTS").Value)*
rsAppend.Fields("UD9") =rs.fields("WBSELEMENT").Value*
rsAppend.Fields("UD10") = rs.fields("DOC_DETAIL").Value*
rsAppend.Fields("UD11") = rs.fields("BUSINESS_TRANSACTION").Value*
rsAppend.Fields("UD12") = rs.fields("VENDOR_NAME").Value*
rsAppend.Fields("UD13") =rs.fields("RECOVERYINDICATOR").Value*
rsAppend.Fields("UD14") = rs.fields("TRANSAMOUNT").Value*
rsAppend.Fields("UD15") = rs.fields("GROUPCURRENCY").Value*
rsAppend.Fields("UD16") = rs.fields("SEGMENTNO").Value*
rsAppend.Fields("UD17") = rs.fields("PARTNEROBJECT").Value*
rsAppend.Fields("UD18") =rs.fields("PO").Value*
rsAppend.Fields("UD19") = rs.fields("QUANTITY_UOM").Value*
rsAppend.Fields("UD20") = rs.fields("DESCRIPTION").Value*
rsAppend.Fields("DESC1") = rs.fields("ACCOUNT_DESCRIPTION").Value*
rsAppend.Update*
rs.movenext*
Loop*
End If*
+'Give success message+
RES.PlngActionType = 6*
RES.PstrActionValue = "SQL Import successful!"*
+'Assign Return value+
SI_ActualLoad = True*
End Function*Per my answer on Network 54 you cannot test the script interactively in FDQM workbench. You must execute the integration script as part of the normal data load process.
Per the FDM Admin guide: "Integration scripts can be run only by selecting Script from the File Type column of the Import Group grid (top grid) of the Import Formats screen".
As I mentioned in my Network 54 post you can test the pure vbscript portions (without the FDQM specifics) to confirm that is working properly then add it to the integration script which will only run as part of a normal file import process.
Regards,
John A. Booth
http://www.metavero.com -
FDM import script with selectable source file
Hi All,
I would like to build an import script attached to an import format that imports a text file with multiple value columns.
Source file:
Entity, Detail, Account 1, Account 2
E_abc, D_abc, 100, 200
In FDM this needs to be:
Entity, Detail, Account, Amount
E_abc, D_abc, Account 1, 100
E_abc, D_abc, Account 2, 200
So i need to loop through the file.
My biggest challenge is that when i attach a script to an import format in the import process i cannot select a file from inbox anymore, it has to be a pre-defined file.
Has someone an example or solution how to make a script-import format and enable the select file from inbox?
And if possible has someone an example script of the issue stated above?
Thanks in advance,
MarcHi Wayne..
Thanks for your reply (and sorry for the delay in mine).
Could you tell me what script to use to open the file in the befImport script, or how to rename the file in memory to a new one?
So i write a script that rewrites the file to a new file in the inbox but i need to tell FDM that it needs to process this new file.
Thanks,
Marc -
Subtracting Columns from Import File Using Import Script
The file I am importing to FDM contains two amount columns, 1 Debit, 1 Credit. I want to have the Amount field populate as the Debit minus Credits. I have attempted an import script that is giving me an error in the bolded line:
Function GBS_Amount(strField, strRecord)
'Oracle Hyperion FDM Integration Import Script:
'Created By:
'Date Created:
'Purpose:
'Set variables
dim strNatural
dim strCurmnthDR
dim strCurmnthCR
dim strCurAmount
'Store the Natural Account as Column 1 of 11 of a comma delimited file
strNatural = Trim(DW.Utilities.fParseString(strRecord, 11, 1, ","))
'Store the Current Month Debit Amount as Column 7 of 11 of a comma delimited file
strCurmnthDR = Trim(DW.Utilities.fParseString(strRecord, 11, 7, ","))
'Store the Current Month Credit Amount as Column 8 of 11 of a comma delimited file
strCurmnthCR = Trim(DW.Utilities.fParseString(strRecord, 11, 8, ","))
'Calculate the YTD Amount
strCurAmount = strCurmnthDR - strCurmnthCR
GBS_Amount = strCurAmount
End If
End Function
What syntax do I need to use to subtract two defined variables?Hi Experts,
I have a similar situation,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 in import, I am gettig an error as below.but if I try to import without using the script for the amount, inport is getting done.I have attached script to amount column only.
ERROR
Code............................................. 9
Description...................................... Subscript out of range
Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
Component........................................ upsWObjectsDM
Version.......................................... 1112
Thread........................................... 8380
Scirpt being used
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 -
How to use import script with FDM using adapter ERPI?
Hi,
I use FDM and ERPI 11.1.2 to load data from EBS R12 to Planning 11.1.2
Data loaded from eBS are YTD data.
I have seen that I could use an import script to calculate manually the amount with the periodic_net_cr and periodic_net_dr fields.
But how to use this import script? Because in my import format in FDM, I don't use a file but directly the adapter, so no "Expression" field.
Thanks in advance for your help
FannyHello Fanny,
No you will not need to put anything in the BatchAction. If you review the FDM API Documentation posted it will outline all the scripts that will execute for a particular event ... and the order in which they execute. The BatchAciton only affects the execution of the batch ... it does not control processing of data. Processing of data is controlled by many others.
There is a script that can be written and placed (as Tony mentioned) in the ImportAction that will be able to recaculate the values from ERPi to be YTD values. You can possibly open an SR and a support Engineer can help you .... or you can search the current KM base and use that information there from the v11.1.1.3.00 version to build your own for v11.1.2.x
Thank you, -
Hi,
i'm new making import scripts to FDM. I m making an integration script between SAP and FDM. I m getting information from via web FDM, the problem is when i a m trying to add this information to the workTable. The code is as follows:
for i = 0 to tData.Rowcount
Set rsAppend = DW.DataAccess.farsTable(strWorkTableName1)
rsAppend.AddNew
rsAppend.Fields("PartitionKey") = RES.PlngLocKey
rsAppend.Fields("CatKey") = RES.PlngCatKey
rsAppend.Fields("PeriodKey") = RES.PdtePerKey
rsAppend.Fields("DataView") = "YTD"
rsAppend.Fields("Entity") = arrayResult(19)
rsAppend.Fields("Account") = arrayResult(0)
rsAppend.Fields("Desc1") = arrayResult(0)
rsAppend.Fields("ICP") = "[None]"
rsAppend.Fields("Amount") = saldoTotal
rsAppend.Update
next
Whe i execute this script i just receive an error message saying: "Error: Import Failed", nothing appears in the Error log, neither in the work table.
Can anyone help me? Does anybody know what can i do to add these records in the work table?
Thanks in advance.
Regards.How are you getting the table name for variable strWorkTableName1?
I'd suggest taking another look at the admin guide. There is an example import integration script in that document. -
Import script (SQL to FDM) - ConnectionRead error
Hi,
I have written an import script in FDM to load data from a SQL view. This script works fine when loading approx 5,000 rows, however, fails when trying to load 20k+ rows
The error message I am receiving is:
Detail: [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (recv()).
At line: 72
Line 72 = rs.movenext 'moves to the next record in the SQL view.
I have tried ignoring a few columns in the import script (to reduce the data volume) - this works, however I need all columns.
Below is a copy of the script:
Function COG1_BrandPL(strLoc, lngCatKey, dblPerKey, strWorkTableName)
Dim cnSS 'ADO connection object
Dim strSQL 'SQL string
Dim rs 'Source (Cognos) recordset
Dim rsAppend 'FDM recordset
'Initialize ADO objects
Set cnSS = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
'Open FDM table recordset for appending
Set rsAppend = DW.DataAccess.farsTableAppend(strWorkTableName)
'Connect to SQL Server database
cnSS.open "Driver={SQL Server};Server=XXXXXXXXX;OLE DB Services =-2;Database=XXXXXX;Uid=USER;Pwd=PASSWORD;"
'Create SQL query string
strSQL = "Select * FROM Corporate_PLUOP_view"
'Open source recordset
rs.Open strSQL, cnSS
'Check for data in source system
If rs.bof AND rs.eof Then
RES.PlngActionType = 2
RES.PstrActionValue = "No records to load!"
COG1_BrandPL = False
Exit Function
End If
'Loop through source records and append to FDM table
If Not rs.bof And Not rs.eof Then
Do While Not rs.eof
rsAppend.AddNew
rsAppend.Fields("PartitionKey") = RES.PlngLocKey
rsAppend.Fields("CatKey") = lngCatKey
rsAppend.Fields("PeriodKey") = dblPerKey
rsAppend.Fields("DataView") = "YTD"
'From Cognos
rsAppend.Fields("UD3") = rs.fields("Cube").value
rsAppend.Fields("Entity") = rs.fields("Entity").value
rsAppend.Fields("UD1") = rs.fields("Custom1").value
rsAppend.Fields("Account") = rs.fields("Account").value
rsAppend.Fields("ICP") = rs.fields("ICP").value
rsAppend.Fields("UD2") = rs.fields("Custom2").value
rsAppend.Fields("Amount") = rs.fields("QPR_Value").value
rsAppend.Update
rs.movenext
Loop
End If
rs.close
cnSS.close
'Assign Return value
COG1_BrandPL = True
End Function
The only other thing I have tried is copying and pasting the script to Excel.... This works for ALL rows... so seems to be a communication issue between FDM and SQL?
Any ideas?Bit more info:
I am using FDM 9.3.1
SQL Server 2005 on Windows 2003 Enterprise x64
Here's a copy of the FDM error log:
** Begin FDM Runtime Error Log Entry [2010-01-13-12:14:55] **
ERROR:
Code......................................... -2147467259
Description.................................. [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (recv()).
At line: 75
Procedure.................................... clsImpProcessMgr.fLoadAndProcessFile
Component.................................... upsWObjectsDM
Version...................................... 931
Thread....................................... 12432
IDENTIFICATION:
User......................................... HFM-Cognos1
Computer Name................................ DEFMDHY9A01
App Name..................................... CognosTest
Client App................................... WebClient
CONNECTION:
Provider..................................... ORAOLEDB.ORACLE
Data Server..................................
Database Name................................ HFM9UAT
Trusted Connect.............................. False
Connect Status.. Connection Open
GLOBALS:
Location..................................... COGNOS1
Location ID.................................. 750
Location Seg................................. 3
Category..................................... ACTUAL
Category ID.................................. 13
Period....................................... Jun - 2009
Period ID.................................... 30/06/2009
POV Local.................................... False
Language..................................... 1033
User Level................................... 1
All Partitions............................... False
Is Auditor................................... False
Edited by: PaulScrivens on 13-Jan-2010 03:26 -
1014 - Expected 'End' Error in FDM Import Script
I've been successful in creating a script. I get the following error :
1014 - Expected 'End'
At Line: 43 *(bolded)*
Can someone please point me in the right direction.
Thanks
Function JDE_Entity(strField, strRecord)
'Oracle Hyperion FDM DataPump Import Script:
'Created By: jzm6518
'Date Created: 10/29/2012 11:42:36 AM
'Purpose: Concatenate Entity 00089 with Sub_Account for mapping purposes
'This is the section where variables are assigned
'strField represents the Original Entity
'strSubAcct represents the SubAccount field
'strSubAcct=DW.Utilities.fParseString(strRecord,6,5,vbTab)
strSubAcct=DW.Utilities.fParseString(strRecord,6,5,",")
'strLedger represents the Ledger Field
'strLedger=DW.Utilities.fParseString(strRecord,6,1,vbTab)
strLedger=DW.Utilities.fParseString(strRecord,6,1,",")
'strDept represents the dept Field
'strDept=DW.Utilities.fParseString(strRecord,6,3,vbTab)
strDept=DW.Utilities.fParseString(strRecord,6,3,",")
If strField = "00001" or StrField = "1" then
If strDept = "2" or strDept = "3" or strDept = "4" or strDept = "6" or strDept = "7" or strDept = "8" or strDept = "8" or strDept = "35" then
JDE_Entity = strField & "." & strDept
Else
End If
Else
If strField = "00050" or strField = "00055" or strField = "00070" or strField = "00075" then
If strLedger = "AA" or strLedger = "BA" then
JDE_Entity = strLedger & "." & strField
Else
End If
End If
Else
If strField = "00089" then
JDE_Entity = strField & "." & strSubAcct
Else
End If
**Else** JDE_Entity = strField
End IF
End FunctionThis code is really messy and not well structured, so it's no surprise you have an issue. Try the following:
1) Never have an Else clause in your If statements where you don't actually have an Else condition i.e. line 33, 40 etc
2) Use a Case statement to replace your outermost If. It will make your code easier to read and probably get rid of your error which will be caused by poorly sequenced/structured If statements. -
Dear All,
I am trying to write a script in account expression. This exp would pick account code which starts with digit "4", if yes then custom 1 dimension is [None].
Function AccImport(strField, strRecord)
if left(varvalue(13),1) ="4" Then
varvalue(20)=[None]
End If
End Function
This is the sample script i have written within data pump function
Can any body please help me in writting what should be the right script to this working.
PrinceIn your import format on the Custom1 dimension add an import script to the Expression column.
Your source record strRecord has the Account value in it you just need to parse it out using DW.Utilities.fParseString. Then check if it starts with a "4" and if so have the script return "None" or else return the value in strField i.e. your original Custom1 source value.
There are plenty of examples of these techniques in the FDM Admin guide in the scripting section. Have a go at writing it yourself it will be much more useful in the long run than me writing the script here. -
FDM Fixed-Width Import Format & Multiple Accounts/Periods Issue
Hi FDM experts,
I have an issue that I wanted to reach out to you on regarding fixed-width import formats and how to cater for my current scenario for export to Hyperion Planning.
I am working with a flat file (.txt) I need to import to FDM with the current format;
A
B
C
D
E
F
G
Z
Year
Channel
Product
Jan-MTD-Account 1
Jan-MTD-Account 2
Jan-YTD-Account1
Jan-YTD-Account2
Dec-YTD-Account2
2013
Channel_1
Product_1
1000
2000
1000
2000
10000
These are all fixed in width so the field lengths will need to be defined in the import format. The requirement for loading to the system is only a speciifc Month YTD value for both Account1 and Account 2.
If my chosen Month is 2013 Jan, I will only require columns F and G to be loaded. These are the issues I have identified;
Can a fixed width import format cater for loading to multiple accounts in the same file? Or would I need a separate import format per account?
Can a fixed width import format cater for loading to a variable Actual Month period? Or do I need 12 import formats/locations per month?
Your help is much appreciated!
Many thanks
AaronHi Aaron,
the solution you are looking for needs pivoting your source file.
Think that FDM, by default, only accepts files with one single column for amount. You have to pivot your file based on your logic and import the pivoted file.
For example:
Year Channel Product ... Jan-YTD-Acc1 Jan-YTD-Acc2 ...
2013 CH1 PR1 1000 2000
If your POV is Jan-2013, your data imported will look like:
Year Channel Produc Account Amount
2013 CH1 PR1 ACC1 1000
2013 CH1 PR1 ACC2 2000
All this process can be automated by playing with Import Scripts.
HTH -
FDMEE import script not working
Hi,
I had a simple import script in FDM Classic that was removing every lines of data from a source file for every amount lower than 0.50 and higher than-0.50. The FDM Classic import script was:
Function Remove_50(strField, strRecord)
'Purpose: To skip lines of data Between -0.50 AND
0.50
If IsNumeric(strField) Then
If Abs(strField) <= 0.50 Then
RES.PblnSkip = True
Else
'Keep line:
Remove_50 = strField
End If
End If
End Function
Now, I have to convert it to FDMEE Jython. Here is my first try:
def PSA_Remove_50 ( strField, strRecord ):
if abs(strField) <= 0.50:
return 0
else:
return strField
Very simple import script but it is giving me a headache :Oo
Thanks for your help!
DanI'd also say to stick with the BigDecimal data type unless you have a really good reason for using the float data type. If you start to multiply floats then you can end up with horrors like this if you're not careful where inaccuracies can start to creep in:
>>> f = float(1.1)
>>> f*1
1.1
>>> f*2
2.2
>>> f*3
3.3000000000000003
That's just something to be aware of if you decide to take the float route -
Problems with import script on Firefox 3.6.3
Hi all,
I have just started using Firefox after hearing so much good about it. Unfortunately, I am disappointed to find it just cannot import all of my cookies, bookmarks, etc. from IE 6.0.2900.5512. I am on Win XP SP3.
When I try and import into Firefox, it keeps telling me the import scripts foe each one are unresponsive. Are there any patches to get this to work?
== User Agent ==
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705)See http://kb.mozillazine.org/accessibility.tabfocus
Note: In OS X (as of 2005-01), if this preference is not explicitly set, the “Full Keyboard Access” setting in System Preferences will be honored. All builds before that date (e.g., Firefox 1.0.x) will ignore that setting. -
Import script to remove zeros in Account field
Dear FDM Experts,
The problem is our source system always extracts 10 characters but we use 7 characters in HFM.
Example, Account 0001201010 (10 characters) must be 1201010 (7 characters).
I want to write an Import Script to remove, if any, all zeros from the left side of the account value at the import stage. We have no Accounts beginning with 0.
Thanks in advance for your help,
CarstenThanks! But I got an error message:
** Begin FDM Runtime Error Log Entry [2012-04-17-13:24:10] **
ERROR:
Code............................................. 13
Description...................................... Type mismatch: 'FormatNumber'
At line: 14
Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
Component........................................ upsWObjectsDM
Version.......................................... 1111
Thread........................................... 2164
Could you provide me with the full script?
Maybe you are looking for
-
Keyboard & mouse doesn't work when restarting from battery dying.
When my battery dies, I go to put it back on the charger. Once it is done loading the main log on screen, neither the keyboard or mouse won't work for a good minute or so. Once the screen turns black, then comes back, it works. Any ideas? Thanks!
-
I made a test html page using the accordion spry widget. The first accordion is not placed in a table and the second one is. When viewed in IE the 2nd accordion (because its placed in a table) adds a little bit of white space between each panel so wh
-
I mistakenly deauthorize from my computer from my account, i want syn my libray to apply tv
Please guide me how to re authorize my computer in apple account
-
Invoice only affect payment budget without affecting commintment again
Hi gurus. I have to solve this problem: We post a PO in year 2009, affecting the commintment budget; then post the invoice in 2010. We need the Invoice ONLY affect the payment budget without consuming the commitment budget. How could I do that. Thank
-
Consuming a web service on 4.6C
Hi Folks! I'm pretty new to this subject. Is it possible to consume a web service in the Sap version 4.6C? If it is possible, can you give me a little example of how to do this? I have checked the weblog: /people/durairaj.athavanraja/blog/2004/09/20/