cancel
Showing results for 
Search instead for 
Did you mean: 

Finding table by Object ID LDM/PDM

12-16-2020 6:24 AM
velurani Explorer
1044 views 2 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi team ,

I was using the below functions to find a logical /physical Entity /Table from a PDM model using VB script

If mdl.ClassName <> "Physical Data Model" Then

Set tabObj = mdl.FindChildByName(argTname, PdLDM.cls_Entity, "", Nothing, False, False)

Else

Set tabObj = mdl.FindChildByCode(argTname, PdPDM.cls_Table, "", Nothing, False, False)

End if

Now Instead of the table names, I wanted to use Object id of the table to find that object so that I can manipulate the object better . Object ID uniquely identify one object in the model. for example one table has the below object id

?tabObj.ObjectID is {85119B14-8C77-4793-B3B5-2623C64AB532}

when I use the Object id for searching the table using the above functions not working

mdl.FindChildByCode("{85119B14-8C77-4793-B3B5-2623C64AB532}",PdPDM.cls_Table, "", Nothing, False, False)

I am I missing any thing?. Is there is any other function I need to use to fulfill the requirements

Can anybody help

Ani

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

Ondrej_Divis
Contributor

Hi,

to search by ObjectID you need to use function, which is meant to search throught ObjectIDs. See my example below.

Set tab = mdl.RetrieveObjectByID("{4BF5DDBB-79A7-4BB4-98E7-E04E97DAB9EB}")

You are not mentioning your PD version. I don`t know, when the support of RetrieveObjectByID was added. So in case the code mentioned above is not working for you (because of older PD version), you will have to browse all tables (or entities) using good old For..Next cycle.

For each tab in Activemodel.Tables
  If tab.ObjectID = "{4BF5DDBB-79A7-4BB4-98E7-E04E97DAB9EB}" then
    ' do your stuff here
  End if
Next

HTH,

Ondrej

velurani
Explorer
0 Likes

Hi Ondrej

It worked . Thanks a lot !!

Ani

Answers (0)