cancel
Showing results for 
Search instead for 
Did you mean: 

Changing system Forms

Former Member
0 Kudos

Hi all,

Is it possible to change the system Form Design and Functionality.For eg,Is it possible to add new fields to system form i.e. Like Vendor code not using UDF.

if yes how we can do it??

Thanks,

neetu

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Yes its possible, Check this sample..

C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\11.SystemFormManipulation

Vasu Natari.

Former Member
0 Kudos

can you please tell me to add single field on purchase order form,means code to add a field on purchase order form.

Thanks

Neetu

Former Member
0 Kudos

Here I'm adding a Combo box and a static text plz change it according to ur requirement.

Private Sub FormModifications(ByRef objForm As SAPbouiCOM.Form)
        Try
            objForm.Freeze(True)
            oItem = objForm.Items.Item("10000330")
            objItem = objForm.Items.Add("Combo01", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
            objItem.Left = (oItem.Left - (oItem.Width + 5))
            objItem.Width = oItem.Width
            objItem.Top = oItem.Top
            objItem.Height = 14
            objItem.FromPane = oItem.FromPane
            objItem.ToPane = oItem.ToPane
            objItem.DisplayDesc = True
            objItem.Visible = True
            objItem.LinkTo = "10000330"

            objItem = objForm.Items.Add("Static01", SAPbouiCOM.BoFormItemTypes.it_STATIC)
            objItem.Left = (oItem.Left - (oItem.Width + 5))
            objItem.Width = oItem.Width
            objItem.Top = oItem.Top - oItem.Height
            objItem.Height = oItem.Height
            objItem.FromPane = oItem.FromPane
            objItem.ToPane = oItem.ToPane
            objItem.Visible = True
            objItem.LinkTo = "10000330"
            objStatic = objItem.Specific
            objStatic.Caption = "Copy From"

            oItem = objForm.Items.Item("10000330")
            objItem = objForm.Items.Item("Combo01")
            objItem.Top = oItem.Top + 3
            objItem.Height = oItem.Height - 5

            objForm.Freeze(False)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        
    End Sub

And call this in the form load after action section

Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD
                    objForm = objSBOAPI.GetForm(FormUID)
                    FormModifications(objForm)

Vasu Natari.

Former Member
0 Kudos

i am doing like this

Private objForm As SAPbouiCOM.Form

Private objItem As SAPbouiCOM.Item

Private oItem As SAPbouiCOM.Item

Dim objStatic As SAPbouiCOM.Button

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

If ((pVal.FormType = 139 And pVal.EventType <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) And (pVal.Before_Action = True)) Then

oOrderForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)

If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD) And (pVal.Before_Action = True)) Then

Dim objForm As SAPbouiCOM.Form

objForm = objSBOAPI.GetForm(FormUID)

FormModifications(objForm)

End If

End If

End Sub

-


Private Sub FormModifications(ByRef objForm As SAPbouiCOM.Form)

Try

objForm.Freeze(True)

oItem = objForm.Items.Item("10000330")

objItem = objForm.Items.Add("Combo01", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)

objItem.Left = (oItem.Left - (oItem.Width + 5))

objItem.Width = oItem.Width

objItem.Top = oItem.Top

objItem.Height = 14

objItem.FromPane = oItem.FromPane

objItem.ToPane = oItem.ToPane

objItem.DisplayDesc = True

objItem.Visible = True

objItem.LinkTo = "10000330"

objItem = objForm.Items.Add("Static01", SAPbouiCOM.BoFormItemTypes.it_STATIC)

objItem.Left = (oItem.Left - (oItem.Width + 5))

objItem.Width = oItem.Width

objItem.Top = oItem.Top - oItem.Height

objItem.Height = oItem.Height

objItem.FromPane = oItem.FromPane

objItem.ToPane = oItem.ToPane

objItem.Visible = True

objItem.LinkTo = "10000330"

objStatic = objItem.Specific

objStatic.Caption = "Copy From"

oItem = objForm.Items.Item("10000330")

objItem = objForm.Items.Item("Combo01")

objItem.Top = oItem.Top + 3

objItem.Height = oItem.Height - 5

objForm.Freeze(False)

Catch ex As Exception

MsgBox(ex.Message)

End Try

End Sub

-


giving ERror: objSBOAPI not defined...

is i m soing right.please help me out.

Thanks,

Neetu

Former Member
0 Kudos

below is the complete code,but it is not working,can u tell me the exact code:

Public Class SystemForm

Private WithEvents SBO_Application As SAPbouiCOM.Application

Private objForm As SAPbouiCOM.Form

Private objItem As SAPbouiCOM.Item

Private oItem As SAPbouiCOM.Item

Dim objStatic As SAPbouiCOM.Button

Private Sub SetApplication()

Dim SboGuiApi As SAPbouiCOM.SboGuiApi

Dim sConnectionString As String

SboGuiApi = New SAPbouiCOM.SboGuiApi()

sConnectionString = Command()

SboGuiApi.Connect(sConnectionString)

SBO_Application = SboGuiApi.GetApplication()

End Sub

Public Sub New()

MyBase.New()

SetApplication()

End Sub

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

If ((pVal.FormType = 139 And pVal.EventType <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) And (pVal.Before_Action = True)) Then

If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD) And (pVal.Before_Action = True)) Then

Dim objForm As SAPbouiCOM.Form

objForm = objSBOAPI.GetForm(FormUID)

FormModifications(objForm)

End If

End If

End Sub

Private Sub SBO_Application_AppEvent(ByVal EventType As SAPbouiCOM.BoAppEventTypes)

Select Case EventType

Case SAPbouiCOM.BoAppEventTypes.aet_ShutDown

SBO_Application.MessageBox("A Shut Down Event has been caught" & _

vbNewLine & "Terminating 'Order Form Manipulation' Add On...")

End

End Select

End Sub

Private Sub FormModifications(ByRef objForm As SAPbouiCOM.Form)

Try

objForm.Freeze(True)

oItem = objForm.Items.Item("10000330")

objItem = objForm.Items.Add("Combo01", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)

objItem.Left = (oItem.Left - (oItem.Width + 5))

objItem.Width = oItem.Width

objItem.Top = oItem.Top

objItem.Height = 14

objItem.FromPane = oItem.FromPane

objItem.ToPane = oItem.ToPane

objItem.DisplayDesc = True

objItem.Visible = True

objItem.LinkTo = "10000330"

objItem = objForm.Items.Add("Static01", SAPbouiCOM.BoFormItemTypes.it_STATIC)

objItem.Left = (oItem.Left - (oItem.Width + 5))

objItem.Width = oItem.Width

objItem.Top = oItem.Top - oItem.Height

objItem.Height = oItem.Height

objItem.FromPane = oItem.FromPane

objItem.ToPane = oItem.ToPane

objItem.Visible = True

objItem.LinkTo = "10000330"

objStatic = objItem.Specific

objStatic.Caption = "Copy From"

oItem = objForm.Items.Item("10000330")

objItem = objForm.Items.Item("Combo01")

objItem.Top = oItem.Top + 3

objItem.Height = oItem.Height - 5

objForm.Freeze(False)

Catch ex As Exception

MsgBox(ex.Message)

End Try

End Sub

End Class

Former Member
0 Kudos

Plz change the SAP application object from OBJSBOAPI to the one the ur using in ur code.. which is SBO_Application

Vasu Natari.

Former Member
0 Kudos

can you send me the whole code to add the combo box.

I used Dim OBJSBOAPI As SAPbouiCOM.Application but then also no resuts.

Thanks

Neetu

Former Member
0 Kudos

Use this it will work.. SBO_Application.Forms.Item(FormUID)

Vasu Natari.

Former Member
0 Kudos

it woks but how i can bind combo box to the data base.

I created one field in OCRD table i.e. Transporter.

How i can bind combo box to the field Transporter in this form.

Thanks,

Neetu

Former Member
0 Kudos

What exactly do u want to use ?? Edit box or a combo box. If u wanna use a combo u need to add the valid values.

This is how u bind..

objCombo.DataBind.SetBound(True,"@EEE","U_TR")

Vasu Natari.

Former Member
0 Kudos

i created Transport field in Database and using code to bind combobox:

i.e.

objCombo.DataBind.SetBound(True, "OCRD", "Transport")

but it is not working

Former Member
0 Kudos

use the preffix U_ for UDFs..

Vasu Natari.

Former Member
0 Kudos

objCombo.DataBind.SetBound(True, "OCRD", "U_Transport")

then also not binding

Thanks

Neetu

Former Member
0 Kudos

whats the error ur getting and plz use try catch blocks at all times.

Vasu Natari.