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

Udf in existing form

Hi all,

This is krishna, I created a Udf-----Balnce in "Title" in sale order. But i want to display is in the form only....How can i write the code for that....Its already link up to the data base.....

Regards,

krishna.v

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 31, 2008 at 11:48 AM

    Hai Krishna,

    Using code u have to create static and edit box. Here is the sample code for u....

    Create One Class

    Code:

    Dim FormID As String

    Sub CreateForm(ByVal FormUID As String)

    Try

    Dim oItem As SAPbouiCOM.Item

    Dim oLbl As SAPbouiCOM.StaticText

    Dim oCmb As SAPbouiCOM.ComboBox

    Dim oTxt As SAPbouiCOM.EditText

    Dim oTab As SAPbouiCOM.Folder

    Dim oMat As SAPbouiCOM.Matrix

    Dim oCols As SAPbouiCOM.Columns

    Dim oCol As SAPbouiCOM.Column

    Dim lb As SAPbouiCOM.LinkedButton

    PO_Frm = app.Forms.Item(FormUID)

    PO_Frm.Freeze(True)

    Dim Top, Left As Integer

    Top = PO_Frm.Items.Item("112").Top

    Left = PO_Frm.Items.Item("9").Left

    PO_Frm.Items.Item("4").Top = PO_Frm.Items.Item("81").Top

    PO_Frm.Items.Item("67").Top = PO_Frm.Items.Item("81").Top

    PO_Frm.Items.Item("51").Top = PO_Frm.Items.Item("81").Top

    PO_Frm.Items.Item("5").Top = PO_Frm.Items.Item("81").Top

    PO_Frm.Items.Item("54").Top = PO_Frm.Items.Item("10").Top

    PO_Frm.Items.Item("55").Top = PO_Frm.Items.Item("10").Top

    PO_Frm.Items.Item("85").Top = PO_Frm.Items.Item("12").Top

    PO_Frm.Items.Item("80").Top = PO_Frm.Items.Item("12").Top

    PO_Frm.Items.Item("83").Top = PO_Frm.Items.Item("12").Top

    PO_Frm.Items.Item("14").Top = PO_Frm.Items.Item("46").Top + 1

    PO_Frm.Items.Item("15").Top = PO_Frm.Items.Item("46").Top

    PO_Frm.Items.Item("70").Top = PO_Frm.Items.Item("46").Top + PO_Frm.Items.Item("46").Height

    PO_Frm.Items.Item("63").Top = PO_Frm.Items.Item("46").Top + PO_Frm.Items.Item("46").Height

    'PO Category

    oItem = PO_Frm.Items.Add("pocat", SAPbouiCOM.BoFormItemTypes.it_STATIC)

    oItem.Left = PO_Frm.Items.Item("15").Left

    oItem.Width = PO_Frm.Items.Item("15").Width - 60

    oItem.Height = PO_Frm.Items.Item("15").Height

    oItem.Top = PO_Frm.Items.Item("63").Top + PO_Frm.Items.Item("15").Height + 2 '103

    oLbl = oItem.Specific

    oLbl.Caption = "PO Category"

    'PO_Frm.DataSources.UserDataSources.Add("pocat", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)

    oItem = PO_Frm.Items.Add("c_pocat", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)

    oItem.Left = PO_Frm.Items.Item("14").Left - 50

    oItem.Width = PO_Frm.Items.Item("14").Width - 70

    oItem.Height = PO_Frm.Items.Item("14").Height

    oItem.Top = PO_Frm.Items.Item("63").Top + PO_Frm.Items.Item("14").Height + 2 '103

    oItem.DisplayDesc = True

    oCmb = oItem.Specific

    oCmb.TabOrder = PO_Frm.Items.Item("70").Specific.TabOrder + 1 '434

    oCmb.DataBind.SetBound(True, "OPOR", "U_pocat")

    PO_Frm.Items.Item("pocat").LinkTo = "c_pocat"

    PO_Frm.Freeze(False)

    Catch ex As Exception

    PO_Frm.Freeze(False)

    app.MessageBox(ex.Message)

    End Try

    End Sub

    Here instead of PO Category u mention Balance.

    Call this function in form Laod Event...

    If it helps give reward points,

    Regards,

    Anitha

    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.