Skip to Content
author's profile photo Former Member
Former Member

[Ask] User Defined Field

Guys, I have two questions here...Hope you guys can help me solving the problems...

1. How to make user defined field that link to user defined table?

2. Can I make Query with Inventory master data as a base?

Thx guys...

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 11:20 AM

    Hi,

    1) First you create User defined Tables and then you create User defined Field while creating the User fields mark Set linked Table and select the table which you want to link.

    2) Yes you can create Query also as per your requirement.

    Regards,

    C.Rajesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:48 PM

    Hi Dear,

    You can do this through SDK also as

    1) Create one UDT named OCT_ITEMSUBGRP1 as

    CreateTable("OCT_ITEMSUBGRP1", "Item SubGrroup1", 0)

    Create Table Procedure is

    Private Sub CreateTable(ByVal txttablename As String, ByVal txtTableDescription As String, ByVal txtTabletype As Integer)

    Dim iRet As Double

    Try

    OCT_tables = OCT_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)

    If OCT_tables.GetByKey(CStr(txttablename)) = False Then

    OCT_tables.TableName = txttablename

    OCT_tables.TableDescription = txtTableDescription

    OCT_tables.TableType = txtTabletype

    iRet = OCT_tables.Add()

    OCT_Application.SetStatusBarMessage("The Table " & txttablename & " is Added.", SAPbouiCOM.BoMessageTime.bmt_Short, False)

    System.Runtime.InteropServices.Marshal.ReleaseComObject(OCT_tables)

    Else

    OCT_tables = Nothing

    End If

    If iRet <> 0 Then

    OCT_Application.MessageBox(OCT_Company.GetLastErrorDescription)

    End If

    OCT_tables = Nothing

    GC.Collect()

    Catch ex As Exception

    OCT_Application.MessageBox(ex.Message)

    End Try

    End Sub

    Step 2) Creating the Linked Field

    Create_FieldLinked("OITM", "SubGrp1", "Company Classification", 0, 0, 8, "OCT_ITEMSUBGRP1", "")

    Create Linked Table Procedure is

    Private Sub Create_FieldLinked(ByVal txttablename As String, ByVal txtFieldname As String, ByVal txtFieldDescription As String, ByVal type As Integer, ByVal subtype As Integer, ByVal size As Integer, ByVal linktable As String, ByVal ValidField As String)

    'Create Instance of UserTablesMD object

    OCT_FieldL = OCT_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)

    Try

    OCT_FieldL.Name = txtFieldname

    OCT_FieldL.Type = type

    OCT_FieldL.Size = size

    OCT_FieldL.Description = txtFieldDescription

    OCT_FieldL.SubType = subtype

    OCT_FieldL.TableName = txttablename

    OCT_FieldL.EditSize = size

    If linktable <> "" Then

    OCT_FieldL.LinkedTable = linktable

    OCT_FieldL.Size = 8

    OCT_FieldL.EditSize = 8

    End If

    IretCode = OCT_FieldL.Add()

    OCT_Application.SetStatusBarMessage("The Field " & txtFieldname & " is Added.", SAPbouiCOM.BoMessageTime.bmt_Short, False)

    If IretCode <> 0 Then

    OCT_Application.MessageBox(OCT_Company.GetLastErrorDescription)

    End If

    Catch ex As Exception

    OCT_Application.MessageBox(ex.Message)

    System.Windows.Forms.Application.Exit()

    End Try

    OCT_FieldL = Nothing

    GC.Collect()

    End Sub

    Hope this will help you..

    Warm Regards,

    Mahendra

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.