Skip to main content

Python Scripting Questions

Description

Area to discuss python scripting questions.

Python: Import TXT File

Hello, I would like to import a SAP table (txt file) into IDEA using Python.

When running the code I get the following error message:
IDEA.ImportDelimFile(importPath, dbName, False," ", rdfPath, True)
File "<COMObject Idea.IdeaClient>", line 3, in ImportDelimFile
pywintypes.com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', (0, 'Idea.IdeaClient.1', 'Invalid record definition file', None, 0, -2147467259), None)
 
Can anyone help me?

Copying Files

Hello,
 
I wasn't really sure where to post this.
 
Currently, I have a macro that performs some analysis and exports out a couple excel files. I am looking to copy Excel files from my Exports.ILB folder to a folder on a Network drive.  The folder will vary in name depending on the project that I am in, but I would like to have it create a folder within that folder called "Exports" and then copy the files to the "Exports" folder.  For example, I would like the files to be copied to
 
U:\Mike W\ProjectName\Exports

Using Python to Launch and Use IDEA

Hi, is it possible to use IDEA from Python without first opening IDEA? Is there some code I can add to be able to do this? 
 
The code below works if I open IDEA before running the code. This is the error I get when running the below code: "Invalid database or the database hasn't been specified yet."
Thank you.
 

ADD NewField Error: TableDef Object has no atribute "NewField"

Hi,
i try to add a new field in IDEA 10.3 via Python:
 
import win32com.client as win32comclient
import os
import sys
idea = win32comclient.Dispatch(dispatch="Idea.IdeaClient")
db = idea.OpenDatabase("File.IMD")
task = db.TableManagement()
field = db.TableDef.NewField()