Skip to content

ERPConnect.Idocs.Idoc

Namespace: ERPConnect.Idocs
Assembly: ERPConnectStandard20.dll

Represents a single IDoc including its segments

public class Idoc

Inheritance

objectIdoc

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

Idoc()

Initializes an empty Idoc object

public Idoc()

Idoc(string, string)

initializes an empty Idoc object

public Idoc(string IdocType, string Extension)

Parameters

IdocType string

Name of the idoc type

Extension string

Name of the extension. If no extension is requiered, set to ""

Properties

ARCKEY

Key for external message archive

public string ARCKEY { get; set; }

Property Value

string

CIMTYP

Extension (defined by customer)

public string CIMTYP { get; set; }

Property Value

string

CREDAT

Created on

public string CREDAT { get; set; }

Property Value

string

CRETIM

Time Created

public string CRETIM { get; set; }

Property Value

string

Connection

R3Connection object to which the Idoc will be sent

public R3Connection Connection { get; set; }

Property Value

R3Connection

DIRECT

Direction

public string DIRECT { get; set; }

Property Value

string

DOCNUM

IDoc number

public string DOCNUM { get; set; }

Property Value

string

DOCREL

SAP Release for IDoc

public string DOCREL { get; set; }

Property Value

string

Description

Description

public string Description { get; set; }

Property Value

string

EXPRSS

Overriding in inbound processing

public string EXPRSS { get; set; }

Property Value

string

IDOCTYP

Name of basic type

public string IDOCTYP { get; set; }

Property Value

string

LastTID

Transaction ID of last outbound call

public string LastTID { get; }

Property Value

string

MANDT

Client

public string MANDT { get; set; }

Property Value

string

MESCOD

Message code

public string MESCOD { get; set; }

Property Value

string

MESFCT

Message function

public string MESFCT { get; set; }

Property Value

string

MESTYP

Message type

public string MESTYP { get; set; }

Property Value

string

OUTMOD

Output mode

public string OUTMOD { get; set; }

Property Value

string

RCVLAD

Logical address of recipient

public string RCVLAD { get; set; }

Property Value

string

RCVPFC

Partner function of recipient

public string RCVPFC { get; set; }

Property Value

string

RCVPOR

Receiver port

public string RCVPOR { get; set; }

Property Value

string

RCVPRN

Partner number of recipient

public string RCVPRN { get; set; }

Property Value

string

RCVPRT

Partner Type of receiver

public string RCVPRT { get; set; }

Property Value

string

RCVSAD

Recipient address (SADR)

public string RCVSAD { get; set; }

Property Value

string

REFGRP

Message group (EDI Message Group)

public string REFGRP { get; set; }

Property Value

string

REFINT

Transmission file (EDI Interchange)

public string REFINT { get; set; }

Property Value

string

REFMES

Message (EDI Message)

public string REFMES { get; set; }

Property Value

string

SERIAL

Serialization

public string SERIAL { get; set; }

Property Value

string

SNDLAD

Logical address of sender

public string SNDLAD { get; set; }

Property Value

string

SNDPFC

Partner Function of Sender

public string SNDPFC { get; set; }

Property Value

string

SNDPOR

Sender port (SAP System, external subsystem)

public string SNDPOR { get; set; }

Property Value

string

SNDPRN

Partner Number of Sender

public string SNDPRN { get; set; }

Property Value

string

SNDPRT

Partner type of sender

public string SNDPRT { get; set; }

Property Value

string

SNDSAD

Sender address (SADR)

public string SNDSAD { get; set; }

Property Value

string

STATUS

Status of IDoc

public string STATUS { get; set; }

Property Value

string

STD

EDI standard, flag

public string STD { get; set; }

Property Value

string

STDMES

EDI message type

public string STDMES { get; set; }

Property Value

string

STDVRS

EDI standard, version and release

public string STDVRS { get; set; }

Property Value

string

Segments

Collection of all segment that are child relation to the current segment

public IdocSegmentCollection Segments { get; set; }

Property Value

IdocSegmentCollection

SkipHLevel

DO NOT USE!!!! FOR INTERNAL USE ONLY!!!

public bool SkipHLevel { get; set; }

Property Value

bool

TABNAM

Name of table structure

public string TABNAM { get; set; }

Property Value

string

TEST

Test flag

public string TEST { get; set; }

Property Value

string

TemplateSegments

Gets a collection of available template segments retrieved or loaded from a schema by calling ERPConnect.R3Connection.CreateEmptyIdoc(System.String%2cSystem.String) or ERPConnect.Idocs.Idoc.LoadIdocSchema(System.String).

public Dictionary<string, IdocSegment> TemplateSegments { get; }

Property Value

Dictionary<string, IdocSegment>

Methods

CreateSegment(string)

Creates a new segment with fields to be filled with data.

public IdocSegment CreateSegment(string SegmentName)

Parameters

SegmentName string

Name of the segment. Please refer to transaction WE60 to find out which segments can be used for the idoc type.

Returns

IdocSegment

A newly created IdocSegment object

GetCurrentStatus()

Returns an IdocStatus object which represents the current status of the IDoc

public IdocStatus GetCurrentStatus()

Returns

IdocStatus

IdocStatus object

GetIdocSchemaString()

Gets the IDoc schema as string

public string GetIdocSchemaString()

Returns

string

String with IDoc schema data

LoadIdocSchema(string)

Loads a schema file and stores the segments internally for further use (e.g. for the CreateSegment method)

public void LoadIdocSchema(string SchemaFileName)

Parameters

SchemaFileName string

Filename

Remarks

Please use the IDocSchemaGenerator tool that is included in the ERPConnect installation package

LoadIdocSchema(StreamReader)

Loads a schema file and stores the segments internally for further use (e.g. for the CreateSegment method)

public void LoadIdocSchema(StreamReader IdocSchemaStreamReader)

Parameters

IdocSchemaStreamReader StreamReader

StreamReader object that points to an resource file

Remarks

Please use the IDocSchemaGenerator tool that is included in the ERPConnect installation package

LoadIdocSchema(TextReader)

Loads a schema and stores the segments internally for further use (e.g. for the CreateSegment method)

public void LoadIdocSchema(TextReader TextReader)

Parameters

TextReader TextReader

TextReader

Remarks

Please use the IDocSchemaGenerator tool that is included in the ERPConnect installation package

LoadPlainData(StreamReader)

Loads IDoc from a single plain file. You must make sure to have a shema loaded before calling this function

public virtual void LoadPlainData(StreamReader strm)

Parameters

strm StreamReader

A StreamReader object

LoadPlainData(string)

Loads IDoc from a single plain file. You must make sure to have a shema loaded before calling this function

public virtual void LoadPlainData(string FileName)

Parameters

FileName string

Filename

LoadPlainDataString(string)

public virtual void LoadPlainDataString(string Content)

Parameters

Content string

LoadXMLData(string)

Loads a XML IDoc data file.

public virtual void LoadXMLData(string IdocFile)

Parameters

IdocFile string

Filename

Remarks

Please make sure to use LoadIdocSchema or RFCConnection.CreateEmptyIdoc before loading the IDoc data. It is not possible to load data without having defined the segments:

R3Connection con = new R3Connection("hamlet",90,"RFCTestUser","pass01","DE","800");
con.Open(false);

Idoc i = new Idoc();
i.Connection = con;

i.LoadIdocSchema(@"c:\ORDERS01.xsd");
i.LoadData(@"c:\Order.xml");

i.Send();

con.Close();

LoadXMLData(TextReader)

Loads a XML IDoc data file.

public virtual void LoadXMLData(TextReader IdocFileTextReader)

Parameters

IdocFileTextReader TextReader

XML TextReader

SaveIdocSchema(string)

Saves the schema file of this IDoc type and enhancement to a file

public void SaveIdocSchema(string SchemaFileName)

Parameters

SchemaFileName string

SaveIdocSchema(XmlWriter)

Saves the schema file of this IDoc type and enhancement to a XmlWriter object

public void SaveIdocSchema(XmlWriter XmlWriter)

Parameters

XmlWriter XmlWriter

SavePlainData(StreamWriter)

Writes the whole IDoc to a single file

public virtual void SavePlainData(StreamWriter writer)

Parameters

writer StreamWriter

A StreamWriter object

SavePlainData()

Writes the whole IDoc to a single file

public virtual string SavePlainData()

Returns

string

SavePlainData(string)

Writes the whole IDoc to a single file

public virtual void SavePlainData(string FileName)

Parameters

FileName string

Filename

SavePlainData(string, Encoding)

Writes the whole IDoc to a single file

public void SavePlainData(string FileName, Encoding Encoding)

Parameters

FileName string

Filename

Encoding Encoding

Encoding

SaveXMLData(TextWriter)

Saves the IDoc to an XML file (including all segments)

public virtual void SaveXMLData(TextWriter IdocFileTextWriter)

Parameters

IdocFileTextWriter TextWriter

TextWriter

SaveXMLData(string)

Saves the IDoc to an XML file (including all segments)

public virtual void SaveXMLData(string IdocFileName)

Parameters

IdocFileName string

Filename and path

SaveXMLData(string, string)

Saves the IDoc to an XML file (including all segments)

public virtual void SaveXMLData(string IdocFileName, string XMLEncoding)

Parameters

IdocFileName string

Filename and path

XMLEncoding string

XML Encoding e.g. ISO-8859-1

Send(string, string)

Sends the Idoc to the SAP system within a qRFC context of the given TID and inbound queue

public virtual void Send(string tid, string queue)

Parameters

tid string

Transaction ID

queue string

Inbound queue

Send(string)

Sends the Idoc to the SAP system within a tRFC context of the given TID and inbound queue

public virtual void Send(string tid)

Parameters

tid string

Transaction ID

Send()

Sends the Idoc to the SAP system

public virtual void Send()

SendAndWait()

Sends the IDocs and waits until the IDocs is processed. You can call GetCurrentStatus after SendAndWait()

public virtual bool SendAndWait()

Returns

bool

IDoc is processed successfully true/false

ToString()

Returns the idoc as string for debugging purpose

public override string ToString()

Returns

string

Idoc as string