cancel
Showing results for 
Search instead for 
Did you mean: 

how to block a business partner...in sales order????

Former Member
0 Kudos

Hi all,

While generating the sales order....In the customer tab i will select one business partner from CFL,after choosing i want one particular customer to be blocked....means it should unable to post the sales order.....i know that i should write my coding in the customer tab LOST FOCUS event......can anybody suggest me the coding for this problem....

regards,

shangai.

Accepted Solutions (1)

Accepted Solutions (1)

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Shangai,

How about blocking some partner from ChooseFromList of BP in Sales Order?

Meaning that blocked some bp with criteria in Choose From List. Sample code:

If pVal.FormType = 139 And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
            If pVal.ItemUID = "4" Then

                If pVal.InnerEvent And pVal.Before_Action Then
                    BubbleEvent = False
                    Dim oForm As SAPbouiCOM.Form

                    oForm = SBO_Application.Forms.Item(FormUID)

                    Dim oCons As SAPbouiCOM.Conditions                    
                    Dim oCFL As SAPbouiCOM.ChooseFromList

                    'oCFL = oCFLs.Add(oCFLCreationParams)
                    oCFL = oForm.ChooseFromLists.Item("2")

                    oCons = oCFL.GetConditions()
                    'Note: Add the condition only once. 
                    If 0 = oCons.Count Then
                        Dim oCon As SAPbouiCOM.Condition
                        oCon = oCons.Add()
                        oCon.Alias = "Cardcode"
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                        oCon.CondVal = "C0001"
                        'Set your own condition here instead of the system conditions
                        oCFL.SetConditions(oCons)
                    End If

                    BubbleEvent = True

                End If
            End If
        End If

Regards, Yatsea

Answers (0)