Click here to Skip to main content
15,886,584 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
//------------------------------------------------------------------------------
// <autogenerated>
//     This code was generated by a SAP. NET Connector Proxy Generator Version 2.0
//     Created at 3/8/2009
//     Created from Windows
//
//     Changes to this file may cause incorrect behavior and will be lost if 
//     the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------
using System;
using System.Text;
using System.Collections;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Xml.Serialization;
using System.Xml.Schema;
using System.Web.Services;
using System.Web.Services.Description;
using System.Web.Services.Protocols;
using SAP.Connector;

namespace SAP_RFC_Listener
{

  /// <summary>
  /// RFC Server class
  /// </summary>
  public abstract class SAPProxy1 : SAPServer
  {
    // Constructors
    public SAPProxy1(){}
    public SAPProxy1(string ConnectionString) :base(ConnectionString){}
    public SAPProxy1(string connectionString, SAPServerHost host) : base(connectionString, host) {}
    public SAPProxy1(string[] args) : base(args) {}
    public SAPProxy1(string[] args, SAPServerHost host) : base(args, host) {}
    public SAPProxy1(string programId, string gwhost, string sapgwxx, string codepage) 
             : base(programId, gwhost, sapgwxx, codepage) {}
    public SAPProxy1(string programId, string gwhost, string sapgwxx, string codepage, SAPServerHost host)
             : base(programId, gwhost, sapgwxx, codepage, host) {}

    
    /// <summary>
    /// Remote Function Module YSEND_MAIL.  
    /// Send Mail
    /// </summary>
    /// <param name="EX_RESULT"></param>
    /// <param name="IM_BCC"></param>
    /// <param name="IM_CC"></param>
    /// <param name="IM_SUBJECT"></param>
    /// <param name="IM_TO"></param>
    /// <param name="T_BODY"></param>
    [RfcMethod(AbapName = "YSEND_MAIL")]
    protected abstract void YSEND_MAIL (

     [RfcParameter(AbapName = "IM_BCC",RfcType=RFCTYPE.RFCTYPE_STRING, Optional = false, Direction = RFCINOUT.IN)]
     [XmlElement("IM_BCC", IsNullable=false, Form=XmlSchemaForm.Unqualified)]
     string IM_BCC,
     [RfcParameter(AbapName = "IM_CC",RfcType=RFCTYPE.RFCTYPE_STRING, Optional = false, Direction = RFCINOUT.IN)]
     [XmlElement("IM_CC", IsNullable=false, Form=XmlSchemaForm.Unqualified)]
     string IM_CC,
     [RfcParameter(AbapName = "IM_SUBJECT",RfcType=RFCTYPE.RFCTYPE_STRING, Optional = false, Direction = RFCINOUT.IN)]
     [XmlElement("IM_SUBJECT", IsNullable=false, Form=XmlSchemaForm.Unqualified)]
     string IM_SUBJECT,
     [RfcParameter(AbapName = "IM_TO",RfcType=RFCTYPE.RFCTYPE_STRING, Optional = false, Direction = RFCINOUT.IN)]
     [XmlElement("IM_TO", IsNullable=false, Form=XmlSchemaForm.Unqualified)]
     string IM_TO,
     [RfcParameter(AbapName = "EX_RESULT",RfcType=RFCTYPE.RFCTYPE_CHAR, Optional = true, Direction = RFCINOUT.OUT, Length = 255, Length2 = 510)]
     [XmlElement("EX_RESULT", IsNullable=false, Form=XmlSchemaForm.Unqualified)]
     out string EX_RESULT,
     [RfcParameter(AbapName = "T_BODY",RfcType=RFCTYPE.RFCTYPE_ITAB, Optional = false, Direction = RFCINOUT.INOUT)]
     [XmlArray("T_BODY", IsNullable=false, Form=XmlSchemaForm.Unqualified)]
     [XmlArrayItem("item", IsNullable=false, Form=XmlSchemaForm.Unqualified)]
     ref ZMAIL_BODYTable T_BODY);

  } 

}

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