on 08-22-2011 2:16 AM
Hi,
I have problem after setting default values to margeting document lines in B1 8.81 PL05
My addon sets the default values to udfs after user enters tab key from Itemcode on sales order form.
Addon sets default values to udfs then cursor moves to next column of itemcode in B12007.
ex) oMatrix.Columns.Item(ColName).Cells.Item(RowNumber).Specific.String = "TEST"
But addon sets default values to udfs then cursor stays still in the last UDF column in B1 8.81 PL05.
So user has to move the cursor to next column of itemcode manually.
How to handle this situation?
Curosr must move to next column of itemcode.
Joanne
Hi,
Yes, it could be the solution,
Set cursor to "itemCode" after I set all the default values. Then send a tab key to next logical column with if condition.
Problem is this upgraded addon is very big and I use this technique on many places.
I'd like to know whether this is a B18.81 SDK changes or bug.
Joanne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joanne,
It is unfortunately not a bug but a design decision by SAP for 8.81 (and 8.8 after a certain patch). I asked SAP support and they confirmed that it is intentional behaviour.
Personally I think it's a really weird thing to change and it has caused me a lot of work fixing existing addons, particularly where I was working with system forms. I would have thought that it would have been better to add a parameter to the method so the programmer could choose whether to set focus to the newly updated field or not. I'm hoping they'll change this 'feature' back.
Here's how I got around it:
try
{
// Freeze the form to avoid flickering
form.Freeze(true);
SAPbouiCOM.Matrix matrix = (SAPbouiCOM.Matrix)form.Items.Item("38").Specific;
// Retrieve the column I want to update and set a value
SAPbouiCOM.EditText edit = (SAPbouiCOM.EditText)matrix.GetCellSpecific("U_XXXX", 1);
edit.Value = "MYVALUE";
// Retrieve the column that the user was on previously - in this case the Item Code field
edit = (SAPbouiCOM.EditText)matrix.GetCellSpecific("1", 1);
// Use the active property to set focus and then move focus to next available field
edit.Active = true;
edit.Active = false;
}
finally
{
form.Freeze(false);
}
Kind Regards,
Owen
Thanks so much Owen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shafi,
Thanks for your help.
I problem is how to set the cursor to next column of itemcode if I don't know the column id of next itemcode column.
For example,
User A : itemCode, Qty, Unit price columns order form
User B : Itemcode, Unit Price, Qty columns order form
Addon needs to know which column iid of next itemcode.
IN B12007
1. Enter itemcode
2, Enter Tab key
3. set the "XXXX" value to "U_XXX"
4. Cursor is in the column of next itemcode
IN B1.8.81
1. Enter itemcode
2, Enter Tab key
3. set the "XXXX" value to "U_XXX"
4. Cursor is in "U_XXX"
sdk sets the value to "U_UDF1"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joanne,
Try This.......
'To move the cursor from itemcode column to U_poqty column when TAB is pressed
If pVal.ItemUID = "38" And pVal.ColUID = "1" And pVal.FormType = "142" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_KEY_DOWN And pVal.CharPressed = "9" And pVal.BeforeAction = False Then
oform = sbo_application.Forms.GetFormByTypeAndCount("142", 1)
Dim oMatrix As SAPbouiCOM.Matrix = oform.Items.Item("38").Specific
oMatrix.Columns.Item("U_poqty").Cells.Item(1).Click(SAPbouiCOM.BoCellClickType.ct_Regular)
End If
Thanks
Shafi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pari,
Thanks for your reply.
oMtx.Columns.Item(ItemCode_ColumnId).Cells.Item(pVal.Row).Click(SAPbouiCOM.BoCellClickType.ct_Regular, 0)
oMtx.SetCellFocus(pVal.Row, Qty_ColumnId)
I've tried the source code as above.
I have 2 issues.
1. I can't hardcode for next column id of ItemCode because user can have different columns setting form.
2. oMtx.SetCellFocus(pVal.Row, Qty_ColumnId) : Cursor does not set to Qty_ColumnId
Joanne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can try the following
oMtx.Columns.Item("ItemCode").Cells.Item(pVal.Row).Click(SAPbouiCOM.BoCellClickType.ct_Regular, 0);
oMtx.SetCellFocus()
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.