cancel
Showing results for 
Search instead for 
Did you mean: 

DI UserTablesMD

Former Member
0 Kudos

I cannot create user defined table using UserTablesMD object. The error message is : "The table name should consist of 3 alphanumeric characters [OUTB]". I have tried to use various table names like "XYZ" , "XY" , "@XYZ" , "@XY" but I still get this message. Is it a bug or I don't know about something ?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I got the same message when I tried to use my prefix:

PRE_XYZ

I solved it removing the underscore:

PREXYZ

it looks to me it is a bug.

Former Member
0 Kudos

Are you using SDK 6.5 ? My problem refers to version 6.2.

Former Member
0 Kudos

Hi Collagues

I will refer in my answer to both available versions:

In version 6.2:

Table name is limited to 3 characters the following code should work for you:

    Dim RetVal As Long

    Dim ErrCode As Long

    Dim ErrMsg As String

    Dim UTMD As SAPbobsCOM.UserTablesMD

    Set UTMD = vCmp.GetBusinessObject(oUserTables)

    UTMD.TableName = "ABC"

    UTMD.TableDescription = "ABC Table"

    RetVal = UTMD.Add

    If RetVal <> 0 Then

        vCmp.GetLastError ErrCode, ErrMsg

        MsgBox "Failed to add UserTable " & ErrCode & " " & ErrMsg

    End If

In version 6.5:

We did have a bug that blocked adding table name with "_" (which made it impossible to use the prefix). This bug was fixed in patch 3. (You can take the uprader from the market place - any higher patch has the fix as well)

Best Regards

Miki

Former Member
0 Kudos

I've got it !!! (GetByKey method destroys UTMD.TableName)

Try this:

Dim RetVal As Long

    Dim ErrCode As Long

    Dim ErrMsg As String

    Dim UTMD As SAPbobsCOM.UserTablesMD

    Set UTMD = vCmp.GetBusinessObject(oUserTables)

    UTMD.TableName = "ABC"

    If UTMD.GetByKey(UTMD.TableName) = False Then

      UTMD.TableDescription = "ABC Table"

      RetVal = UTMD.Add

      If RetVal <> 0 Then

          vCmp.GetLastError ErrCode, ErrMsg

          MsgBox "Failed to add UserTable " & ErrCode & " " & ErrMsg

      End If

    Ebd If

Thanks, greetings from Poland,

Jarek

Former Member
0 Kudos

yes, 6.5 , with 6.2 did work fine, you must use XYZ.

Former Member
0 Kudos

hello Miki,

I am using 6.5 Path 4 (just downloaded from your site) and the underscore still can't be used ....

regards

Marcos

Former Member
0 Kudos

hello Miki,

I am using 6.5 Path 4 (just downloaded from your site) and the underscore still can't be used ....

regards

Marcos

Former Member
0 Kudos

If UTMD.GetByKey(UTMD.TableName) = False Then

why use equ false?

Former Member
0 Kudos

To see if the table exists. You don't want to create it if it already exists. GetByLey will return true if the table is found, false if it does not exist.