on 06-15-2011 12:54 PM
Hi Freinds,
I am trying to code certain validations required on Purchase order. I have my Supplier's code starting with State Code e.g DELV001, BLR001. Like wise i have my document series the same way BLR1, DEL1. I want to make sure if some one has selected a supplier for say DEL state and if the series if of different state it should not let the user add the po.
I tried coding it but it does not allow to add even if the combination is right. Here is my code.......
Public BPCode As SAPbouiCOM.EditText
Public Series As SAPbouiCOM.ComboBox
If pVal.ItemUID = "1" And pVal.BeforeAction = True And (oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Or oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE) Then ' Validation
BPCode = oForm.Items.Item("4").Specific
Series = oForm.Items.Item("88").Specific
If (BPCode.Value Like "DEL*" And Series.Value <> "DEL-11-12") Then
BubbleEvent = False
SBO_Application.SetStatusBarMessage("Check Series and Supplier", SAPbouiCOM.BoMessageTime.bmt_Short, True)
Exit Sub
End If
End If
Thank you
Just a quick word of caution about the basic logic you are employing: what happens when a supplier moves to a different state ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Siva,
Thanks for yor reply
Using "StartsWith" gives lost focus error.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this code.it will work.
Public BPCode As SAPbouiCOM.EditText
Public Series As SAPbouiCOM.ComboBox
If pVal.ItemUID = "1" And pVal.BeforeAction = True And (oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Or oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE) Then ' Validation
BPCode = oForm.Items.Item("4").Specific
Series = oForm.Items.Item("88").Specific
If not Series .StartsWith("DEL") Then
BubbleEvent = False
SBO_Application.SetStatusBarMessage("Check Series and Supplier", SAPbouiCOM.BoMessageTime.bmt_Short, True)
Exit Sub
End If
End If
Regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
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.