Description
Loads into the valid values a list of the IDs of the series attached to a specific UDO.
The UDO must have been created with the Manage Series service, and one or more series must be connected to the UDO. To check the series connected to a UDO, go to Administration --> System Initialization --> Document Numbering. An entry exists for each UDO with Manage Series.
Syntax
Parameters
Remarks
Example
| Letting user select series for UDO (Visual Basic) | Copy Code |
|---|
Dim f As SAPbouiCOM.Form
Dim oItem As SAPbouiCOM.Item
Dim oCB As SAPbouiCOM.ComboBox
Dim oEdit As SAPbouiCOM.EditText
Dim cp As SAPbouiCOM.FormCreationParams
cp = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
cp.FormType = "myForm"
cp.ObjectType = "TestUDO"
cp.UniqueID = "myFormID"
Try
f = SBO_Application.Forms.AddEx(cp)
Catch ex As Exception
f = SBO_Application.Forms.GetForm("FrmMeal", 1)
f.Visible = True
End Try
f.ClientWidth = 370
f.ClientHeight = 300
oItem = f.Items.Add("txtDocNum", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oItem.Left = 200
oItem.Top = 10
oItem.AffectsFormMode = True
oEdit = oItem.Specific
oEdit.DataBind.SetBound(True, "@Test", "DocNum")
oItem = f.Items.Add("cmbMyField", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
oItem.Left = 60
oItem.Top = 50
oItem.AffectsFormMode = True
oCB = oItem.Specific
oCB.DataBind.SetBound(True, "@Test", "Series")
oCB.ValidValues.LoadSeries("TestUDO", SAPbouiCOM.BoSeriesMode.sf_Add)
oItem = f.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
oItem.Left = 10
oItem.Top = 270
oItem = f.Items.Add("2", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
oItem.Left = 90
oItem.Top = 270
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
If ((FormUID = "TestUDOID") And (pVal.ItemUID = "cmbMyField") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) And (pVal.Before_Action = False)) Then
Dim lNum As Long
Dim series As String
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.Item(FormUID)
Dim cmbo As SAPbouiCOM.ComboBox
cmbo = oForm.Items.Item("cmbMyField").Specific
series = cmbo.Selected.Value
lNum = oForm.BusinessObject.GetNextSerialNumber(series)
Dim oEditText As SAPbouiCOM.EditText
oEditText = oForm.Items.Item("txtDocNum").Specific()
oEditText.Value = lNum
End If
End Sub
|
|
See Also