Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Choose from list and a user defined table

Hi

I want to call a choose from list display which will be linked to a user defined table. I then want the result to go into a user defined field

I will add a button onto the purchase order screen and want to call it from there.

Can anyone tell me if this is possible and possibly give me a few pointers please ?

Many thanks

Regards Andy

Former Member
Former Member replied

        If (pVal.FormUID = "TaxI_ST") Then
            If ((pVal.ItemUID = "FIND") And _
                (pVal.EventType =           SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) And _
                (pVal.Before_Action = False)) Then

                Try
                    ' 94.09.13 TEST
                    SALESTRACK_FIND()
                Catch

                End Try

            End If

        End If

    Private Sub SALESTRACK_FIND()

        Dim i As Integer
        Dim oEditText As SAPbouiCOM.EditText
        Dim oComboBox As SAPbouiCOM.ComboBox
        Dim VSTR As String

        '// Flush user input into datasources
        oMatrix.FlushToDataSource()

        '// Get the DBdatasource we base the matrix on
        oDBDataSource = oForm.DataSources.DBDataSources.Item("@CADMEN_SALESTRACK")

        VSTR = ""

        '// Iterate all the records and add a prefix to the phone
        For i = 0 To oDBDataSource.Size - 1

            If oMatrix.IsRowSelected(i + 1) Then

                If Trim(oDBDataSource.GetValue("U_BSRN3", i)) = "________" Then
                    VSTR = Trim(oDBDataSource.GetValue("U_BSRN1", i))
                End If

                If Trim(oDBDataSource.GetValue("U_BSRN3", i)) <> "________" Then

                    If CInt(Trim(oDBDataSource.GetValue("U_BSRN3", i))) < CInt(Trim(oDBDataSource.GetValue("U_BSRN2", i))) Then
                        VSTR = Format(CInt(Trim(oDBDataSource.GetValue("U_BSRN3", i))) + 1, "00000000")
                    End If

                End If

                If VSTR <> "" Then
                    Try
                        oItem = oInvoiceForm.Items.Item("text1")
                        oEditText = oItem.Specific
                        oEditText.Value = Trim(oDBDataSource.GetValue("U_BSTRK", i)) & VSTR

                        oItem = oInvoiceForm.Items.Item("Combo1")
                        oComboBox = oItem.Specific
                        oComboBox.Select(Trim(oDBDataSource.GetValue("U_BSTYP", i)))

                        VCODE = Trim(oDBDataSource.GetValue("CODE", i))
                        VLASTNO = VSTR
                    Catch
                    End Try

                    Try
                        oItem = oInvoiceForm_PRE.Items.Item("text1")
                        oEditText = oItem.Specific
                        oEditText.Value = Trim(oDBDataSource.GetValue("U_BSTRK", i)) & VSTR

                        oItem = oInvoiceForm_PRE.Items.Item("Combo1")
                        oComboBox = oItem.Specific
                        oComboBox.Select(Trim(oDBDataSource.GetValue("U_BSTYP", i)))

                        VCODE = Trim(oDBDataSource.GetValue("CODE", i))
                        VLASTNO = VSTR
                    Catch
                    End Try

                End If

            End If

        Next

        oItem = oForm.Items.Item("2")
        oItem.Click()

    End Sub

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question