Skip to Content
0
Former Member
Jul 29, 2008 at 12:05 AM

Query Print Layout failing when executed using UI-API

46 Views

We have a UI add-on which does the following:

1. Opens the query print layout form

2. Finds a specific query print layout by name

3. Triggers the application print button click

4. Populates the 2 parameter fields which are ObjType and DocNum

5. Presses the OK button to execute and print the query print layout

This was working fine in 2005A.

Running in 2007A PL38 we have found that the query is failing when programmatically executed and the following system message is generated:

29/07/2008 11:38:55: Query sentence was not completed (QE -3006) [Message 300-7]

If we run the query print layout manually using the same parameters the query works.

This is also true if we disable the code that presses the OK button on the form. In this case the parameter fields are populated as we expect and if we manually click the OK button the query executes and prints fine.

Code being called is:

// get the query parameter form

SAPbouiCOM.Form form = _SboApplication.Forms.GetForm(formType, formTypeCount);

// Set the object type and document number parameters

SAPbouiCOM.EditText etObjNum = (SAPbouiCOM.EditText)form.Items.Item("1000003").Specific;

etObjNum.Value = this._PrintDocType;

SAPbouiCOM.EditText etDeliveryNum = (SAPbouiCOM.EditText)form.Items.Item("1000007").Specific;

etDeliveryNum.Value = this._PrintDocNum;

// click the Ok button on the query parameters form

form.Items.Item("1").Click(BoCellClickType.ct_Regular);

Any help appreciated