cancel
Showing results for 
Search instead for 
Did you mean: 

oConditions Query

Former Member
0 Kudos

Is there a way to make query for multiple tables in oCOndition?

For example

SELECT T1.ItemCode FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.DocNum = '100'

From the Sdk help, it only shows query from 1 table. So can anyone gimme some example for the above query and make it into oCondition format?

Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Melvin,

Not sure about if it is possible (I think it is not), but you could fix it creating a view with this select, and then query the view with the condition you need.

Hope helps,

Ibai Peñ

Former Member
0 Kudos

Thanks Ibai for the fast response...

Could you give me some example on how to create view using B1 SDK?

The reason i want to do this is to make conditions for the navigation button in the menuevent. So if there is any other better suggestions, please let me know.

Former Member
0 Kudos

Hi Melvin,

It is <i>not</i> possible with the oConditions object.

As Ibai stated, you could use a view, if you want to use the dbdatasource. Use this if you use the 2004 SDK.

Another option, if you use the 2005 SDK, use the Grid object. It's blazing fast, and you can directly put a SQL query in it!

<b>Code C#</b>

/* Add Grid and Datatable to the form */
Grid myGrid = (Grid)SAPForm.Items.Add("myGrid").Specific;
DataTable myDT = (DataTable)SAPForm.DataSources.DataTables.Add("gridDT");

/* Perform the query */
myDT.ExecuteQuery("SELECT T1.ItemCode FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.DocNum = '100'
");
myGrid.DataTable = myDT;

As you can see, very little code needed, and blazing fast!

Grouping by your itemcode? (So you'll get those nice collapsable SAP grids?)

Grid.CollapseLevel = 1;

Hope it helps,

Rowdy

Former Member
0 Kudos

Hi,

does this work on navigating the form?

For example, i have docnum 1, 2, 3

But i want to make a query just to skip docnum 2, so when a user click on next button he/she will jump from docnum 1 to 3.

In the ocondition, this is possible to make condition on the navigation button, but my other problem is that i need to join to another table to get the conditions and ocondition does not support this.

So any suggestions?