Skip to Content
0
Former Member
Jun 21, 2016 at 02:47 PM

How to display Query result into CFL ?

362 Views

Hi,

Can anybody help on how to get Query result to be displayed in CFL ?

I have tried by doing below code in CFL before event

SAPbouiCOM.Conditions oBatchCons = default(SAPbouiCOM.Conditions);

SAPbouiCOM.Condition oBatchCon = default(SAPbouiCOM.Condition);

oBatchCons = CFLBatch.GetConditions();

string BatchQuery = "exec [dbo].[U_Sp_BatchData] ";

oRecordSet.DoQuery(BatchQuery);

for (int i = 1; i <= oRecordSet.RecordCount; i++)

{

if (i > 1)

oBatchCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR;

oBatchCon = oBatchCons.Add();

oBatchCon.Alias = "DistNumber";

oBatchCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;

oBatchCon.CondVal = oRecordSet.Fields.Item("Distnumber").Value.ToString();

oRecordSet.MoveNext();

}

CFLBatch.SetConditions(oBatchCons);

Above code is bringing result with filter of Batch which are in SP only but columns are from Batch Master only

Gives SP result with below list of Column:

Itemcode,

Distnumber,

availbleqty,

producedqty,

But we need result in CFL of above mention column.

So please suggest on how we can do this.

Thanks,

Harshal