cancel
Showing results for 
Search instead for 
Did you mean: 

Batch Issue window Automation Fails

Former Member
0 Kudos

Hello All:

Not sure if anyone has handle something similar.

I am trying to do an all UI interface to allow user to scan batch for release. (form 42)

Scenario is that I first read the scan input in a User form. and sent it to the SBO form.. I first tried to use


   Global.oedit = (SAPbouiCOM.EditText)(Global.oForm2.Items.Item("14").Specific);
   Global.oedit.Value = scands.ToString() + '\t';

The value gets inputted in batch find. but no line are selected in matrix

And I tried to find the line in matrix (4) and use below code to put the qty in. And system threw me a "server threw exception"


Global.omatrix = (SAPbouiCOM.Matrix)(Global.oForm2.Items.Item("4").Specific);
Global.oedit1 = (SAPbouiCOM.EditText)(Global.omatrix.Columns.Item("4").Cells.Item(i).Specific);
Global.oedit1.Value = Global.scanqty.ToString();

Finally. I tried to manual manipulate the key stroke and do something like


Global.omatrix.Columns.Item("4").Cells.Item(i).Click(SAPbouiCOM.BoCellClickType.ct_Regular, 0);
System.Windows.Forms.SendKeys.Send(Global.scanqty.ToString());

First of all. first line the click give me a error message. But line is highlighted, qty field, however, is not exposed for my sendkeys.

I am running out of ideas. Can someone please help... It is killing me.

Sincerely Yours

Bo Peng

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

did you tried instead of setting Global.oedit1.Value emulate click on that edittext and with sendkeys method send the proper value?

Former Member
0 Kudos

Yes I tried that as described above on my thrid attempts. But the problem is the field doesn't open right after the click. I think it is doing the whole validation...etc But I can't use the sendkey right after I click the cell.

.. I finally did something I really didn't want to do to resolve this. I use that cells.click method and catch the itempress event. While in the itempress event, I found you can't use the sendkeys because SBO doesn't handle window message loops(kind of surprised me, but I believe I have done it before, just didn't spent time on this) But after catching, I can use the oedit statement and set oedit.value = Global.scanqty.tostring().

I would rather like to stream the entire process within the function. this way if user chooses not to use the addon. They don't have to turn it off. they can just click in and change value and go right ahead. But now the addon is force onto them They have to do it in this way.

Edited by: Bo Peng on Dec 11, 2008 3:04 PM

Edited by: Bo Peng on Dec 11, 2008 3:05 PM

Edited by: Rui Pereira on Dec 23, 2008 4:46 PM

Answers (0)