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

PROBLEM OF MATRIX (DATABINDING) reply its Urgent

Dear SAP Guru's,

I found a problem that i have create a ".srf "form through "screen painter" and did the datadinding through ".srf "... So how could i load data from database to Matrix...??????????

(I HAVE SEND U A SAMPLE)

public void loadDel()

{

Rs = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);

if (combo == "All")

{

strSql = "Select a.DocNum, a.DocDueDate, a.CardCode, a.CardName, b.City, b.Country, b.ZipCode, a.U_UNE_CCD from ODLN a , CRD1 b where (a.DocDueDate BETWEEN '" + hfdate + " ' AND ' " + htdate + " ')and a.CardCode=b.CardCode ";

}

if (combo == "Un-allocated")

{

strSql = "Select a.DocNum, a.DocDueDate, a.CardCode, a.CardName, b.City, b.Country, b.ZipCode, c.Name, a.U_UNE_CCD from ODLN a , CRD1 b, [@UNE_OSHV] c where (a.DocDueDate BETWEEN '" + hfdate + " ' AND ' " + htdate + " ') and a.CardCode=b.CardCode AND a.ShipToCode=b.Address AND b.AdresType='s' and a.trnspcode = c.code and a.U_CCODE ='D000' order by ZipCode";

}

Rs.DoQuery(strSql);

if (Rs.RecordCount > 0)

{

for (int i = 0; i < Rs.RecordCount; i++)

{

oMatrix.AddRow(1, i + 1);

//**********************************************************

//Fetching the values from the record set and store them

//in the local variables

//**********************************************************

string doc = Rs.Fields.Item(0).Value.ToString();

string deldate = Rs.Fields.Item(1).Value.ToString();

string bpc = Rs.Fields.Item(2).Value.ToString();

string name = Rs.Fields.Item(3).Value.ToString();

string city = Rs.Fields.Item(4).Value.ToString();

string country = Rs.Fields.Item(5).Value.ToString();

string zip = Rs.Fields.Item(6).Value.ToString();

string ship = Rs.Fields.Item(7).Value.ToString();

//string driver = Rs.Fields.Item(8).Value.ToString();

//**********************************************************

//Removing white spaces and manipulating date values

//**********************************************************

doc = doc.Trim();

deldate = deldate.Remove(9, 12);

bpc = bpc.Trim();

name = name.Trim();

city = city.Trim();

country = country.Trim();

zip = zip.Trim();

ship = ship.Trim();

//driver = driver.Trim();

try

{

//**********************************************************

//Setting the values in the fields of matrix

//**********************************************************

?????????????/

here i don't understand where i have save this values that they come in Matrix

i have tried this

oForm.DataSources.UserDataSources.Item("").Value = doc;

what value should i pass.........so that value come in matrixx

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 05:28 AM

    In your way is it as

    edit = oMatrix.Columns.Item("colCislo").Cells.Item(pVal.Row).Specific

    edit.string = "your value"

    edit is edittext.

    But, your way isnt good. Way you dont use binding cells to datasource or datatble? If you have own query, use datatable as

    odbtable = oForm.DataSources.DataTables.Add("x")

    strSql = "Select a.DocNum, a.DocDueDate, a.CardCode, a.CardName, b.City, b.Country, b.ZipCode, a.U_UNE_CCD from ODLN a , CRD1 b where (a.DocDueDate BETWEEN '" + hfdate + " ' AND ' " + htdate + " ')and a.CardCode=b.CardCode ";

    odbtable.ExecuteQuery(sql)

    Dim cols As SAPbouiCOM.Columns

    Dim column As SAPbouiCOM.Column

    cols = oMatrix.Columns

    column = cols.Item("item")

    column.DataBind.Bind("x", "DocNum")

    and so on. Its much more quicker that filling matrix cell by cell. The example is in VB, I hope that translating to C# will be not difficult, otherwise Im sure that David will send you code in C# (if he is ready after yesterdays match 😉 )

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 06:00 AM

    Thank You Sir...

    i'll try this Code

    Thanks alot

    Add a comment
    10|10000 characters needed characters exceeded

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.