Skip to Content

Call By Reference Problem in SAP .NET Connector 1.2.2

Dear All,

I have got a function in SAP R/3 4.6, which has got one Table as parameter. I use the following code to call this function via .NET connector. everything goes fine except that the passing parameter is considered as call by value instead of reference.

private void InitializeComponent()

{

this.zemP_ADSTable1 = new SAPRFC.ZEMP_ADSTable();

((System.ComponentModel.ISupportInitialize)(this.zemP_ADSTable1)).BeginInit();

this.DataGrid1.SelectedIndexChanged += new System.EventHandler(this.DataGrid1_SelectedIndexChanged);

this.Button1.Click += new System.EventHandler(this.Button1_Click);

//

// zemP_ADSTable1

//

this.zemP_ADSTable1.AllowEdit = true;

this.zemP_ADSTable1.AllowNew = true;

this.zemP_ADSTable1.AllowRemove = true;

this.zemP_ADSTable1.SupportsChangeNotification = true;

this.Load += new System.EventHandler(this.Page_Load);

((System.ComponentModel.ISupportInitialize)(this.zemP_ADSTable1)).EndInit();

}

#endregion

// this method prepare the ADSTable based on ADS structure.

private void prepareADSTable()

{

zemP_ADSTable1 = new ZEMP_ADSTable ();

zemP_ADS = new ZEMP_ADS ();

zemP_ADS.Name="Amirali";

zemP_ADS.Lastname="pourteymour";

// employee.Email="amirali.pourteymour@cablesurf.de";

// employee.Tel="01636558732";

zemP_ADSTable1.

zemP_ADSTable1.Add (zemP_ADS);

//return employees;

}

private void Button1_Click(object sender, System.EventArgs e)

{

SAPHR proxy = new SAPHR();

try

{

proxy.Connection = SAP.Connector.SAPLoginProvider.GetSAPConnection(this);

prepareADSTable();

proxy.Zemp_Ads_Update(ref zemP_ADSTable1);

// Call methods here

// Now update Data Bindings. On WinForms this will be automatic, on WebForms call the following line

this.DataBind();

}

catch(Exception ex)

{

TextBox1.Text = ex.ToString();

// If SAPLoginProvider.GetSAPConnection(this) cannot get a connection, we might get an error. // Normally this can be ignored as it will automatically will force a relogon.

}

}

but the table parameter is not considered as call by reference. am I doing something wrong.

Regards,

Amirali

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2004 at 12:56 PM

    Hi,

    Did you get any error at compilation time or at runtime? If yes, what is the original error message ?

    By the way, I saw the following code:

    private void prepareADSTable()

    {

    zemP_ADSTable1 = new ZEMP_ADSTable ();

    . . .

    }

    Please reconsider this line. It is at least unnecessary if it is not harmful.

    Regards,

    Guangwei

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2005 at 01:17 PM

    Hello

    I want the runtime installation of .net connector ver 1.2.2 . Where will get the same? on service.sap.com/connector it is not shown.

    Thanks

    Sandeep

    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.