Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member185199
Contributor

As you gettin started using the scripting engine PD provides ...

.. you have only a simple code window under the menu Tools>Execute Commands>Edit/Run Script

For myself, since ever  a MS-Access developer, i found it more comfortable to use the VBA Editor of Access 2007 (or any other version).

To do so, you need one important Step in Access, that is loading all the PD libaries, so you can use CODE-Completion !!!

Just open Extras/Libaries

and then select/import them all:

As you can find elsewhere in the PD-documentation, the code in VBA differs slightly from VBS, but thats worth the step :wink:

here are some starter functions you might always use:

Option Compare Database
Option Explicit
Dim pd_App As PdCommon.Application
Dim InputModel As PdEAM.Model  ' change here as needed to CDM or PDM !
Dim STList, PDMList

'
'  opens the Application PD and the Model YOURMODELNAME only if not loaded already!!!
'
Sub initEAModel(YOURMODELNAME)
    If pd_App Is Nothing Then
        Set pd_App = New PdCommon.Application
    End If
   
   
    If InputModel Is Nothing Then
        Set InputModel = pd_App.OpenModel(YOURMODELNAME)
    End If


End Sub

With VBA in Access ( also Excel or Word)  you have debugging and watch/inspect available, you can typequalify the variables (VBS supports only VARIANT) and so you have code completion.

Enjoy

DJ

PS: see http://scn.sap.com/docs/DOC-44233 for some more information on VBS vs. VBA (OLE Automation)

5 Comments
Labels in this area