Click here to Skip to main content
15,885,366 members
Articles / Productivity Apps and Services / SAP

SAP .NET RFC Server with SAP.NET Connector 2.0

Rate me:
Please Sign up or sign in to vote.
4.70/5 (10 votes)
26 Apr 2009CPOL5 min read 101.7K   2.5K   40  
This article explains how to connect from SAP to .NET application
/*
 * ****************************** 
 * Author : Huseyin Akturk      *
 * http://www.huseyinakturk.net *
 * admin@huseyinakturk.net      *
 ********************************
 */

using System;
using System.Diagnostics;
using System.Threading;
using SAP.Connector;

namespace SAP_RFC_Listener
{
  [Serializable]
  public class SAPProxy1Impl : SAPProxy1
  {
    public SAPProxy1Impl() : base() {}
    
    public SAPProxy1Impl(string[] args, SAPServerHost host) : base(args, host) {}

    public SAPProxy1Impl(string programId, string gwhost, string sapgwxx, string codepage, SAPServerHost host) : base(programId, gwhost, sapgwxx, codepage, host) {}
    
    // Implementation of remote function module YSEND_MAIL
    protected override void YSEND_MAIL(string IM_BCC, string IM_CC, string IM_SUBJECT, string IM_TO, out string EX_RESULT, ref ZMAIL_BODYTable T_BODY)
    {
		string body = "";
		System.Data.DataTable dt = T_BODY.ToADODataTable();
		for (int i = 0; i < dt.Rows.Count; i++ )
		{
			body += dt.Rows[i][0].ToString();
		}
		ISMTP gMail = new GMailSMTP();
		gMail.send(IM_TO, IM_CC, IM_BCC, "","", IM_SUBJECT, body, out EX_RESULT); // give gmail username such as xyz@gmail.com and password !!!
    }
  } 
} 

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Turkey Turkey
Huseyin Akturk was born in Ankara, Turkey. He holds BSc degree from Dokuz Eylul University, Izmir, Turkey Computer Engineering department since July 2005. He also holds MSc degree from Ege University, Izmir, Turkey Computer Engineering department since March 2008.

He has applied data mining technology and statistical operations on stock exchanges during BSc and MSc theses. The purpose of these theses is looking for similarity between stock exchanges and he has got successful results in these theses respect to the purpose and published essays.

He has worked with a responsibility of being computer engineer during professional and academic experience. He has assimilated the idea of being keen on newness in technology. He has been working as Senior SAP Business Intelligence Consultant, Senior SAP Technical Consultant and Senior Software Engineer for several firms since October 2005.

Comments and Discussions