Skip to Content
author's profile photo Former Member
Former Member

Batch Issue window Automation Fails

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 11, 2008 at 09:19 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.