on 10-17-2008 7:54 AM
Hi all ,
we need a solution for the following problem
we had created a combox as in sap form for document numbering
that combo box contain ywo values as primary and manual
in sap form if we select primary it will be generating numbers automatically
and when we select manual it will allows us to enter manually
can any one tell me hoe to do the same thing for user defined fields
Hi ,
If u registered ur table in UDO means
Bind the combobox to the 'Series' field in the table.
oSeriesCombo = oForm.Items.Item("CmbSeries").Specific
oForm.Items.Item("CmbSeries").DisplayDesc = True
oSeriesCombo.DataBind.SetBound(True, "@PSSIT_CMSAMHDR", "Series")
StrSql = "select * from NNM1 where objectCode='PSSIT_CMSAM'"
oRs.DoQuery(StrSql)
If oRs.RecordCount > 0 Then
oRs.MoveFirst()
For IntICount = 0 To oRs.RecordCount - 1
oSeriesCombo.ValidValues.Add(oRs.Fields.Item("Series").Value, oRs.Fields.Item("SeriesName").Value)
oRs.MoveNext()
Next
End If
oSeriesCombo.ValidValues.Add("-1", "Manual")
oSeriesCombo.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
then for auto increment of document number u have to do as
oDocNumTxt = oForm.Items.Item("TxtDocNum").Specific
oForm.Items.Item("TxtDocNum").Enabled = False
oDocNumTxt.DataBind.SetBound(True, "@PSSIT_CMSAMHDR", "DocNum")
LoadDocNumber()
Private Sub LoadDocNumber()
Dim StrSql As String
Dim oRs As SAPbobsCOM.Recordset
Try
oRs = Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
StrSql = "Select ObjectCode,Series,SeriesName,InitialNum,NextNumber,LastNum From NNM1 " _
& "Where NNM1.ObjectCode='PSSIT_CMSAM'"
oRs.DoQuery(StrSql)
If oRs.RecordCount > 0 Then
oRs.MoveFirst()
oDocNumTxt.Value = oRs.Fields.Item("NextNumber").Value
End If
Catch ex As Exception
Throw ex
Finally
oRs = Nothing
GC.Collect()
End Try
End Sub
I hope this will help u...:-)
Regards
Mohana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.