ediCommentTypes

The ediCommentTypes interface represents a collection of comment types that define comments that may exist in an EDI document. A comment type describes the type of comment that has been included in an EDI document and which has been ignored by Framework EDI (FREDI). FREDI allows comments in an EDI document, but is not a recommended practice because including comments in EDI documents are not part of the ASC/X12 and UN/EDIFACT standard, which could be misleading and confusing between trading partners. However, if it must be included, this feature allows trading partners to define what part of the text should not be processed as part of the EDI document data stream.

A sample text in an EDI document with comments can look something like the text below.

ST*850*000000001~
### THIS PART OF THE TEXT IS A COMMENT
### AND IS IGNORED.
BEG*00*SA*A99999-01**19971207~
REF*VR*54321~
ITD*01*3*1**15**16~
DTM*002*19971219~
N1*BT*BUYSNACKS INC.*9*1223334444~
N3*P.O. BOX 0000~
N4*TEMPLE*TX*76503~
SE*9*000000001~
$$$ THIS IS ANOTHER COMMENT TYPE
$$$ AND SHOULD ALSO BE IGNORED.

The text above only shows the transaction set text of an ASC/X12 document. There are comments following the transaction set header ST and the transaction set trailer SE. The comments following the transaction set header has to be defined as a comment type different from the comment following the transaction set trailer because it is started with the string "###", while the ones following the transaction set trailer begins with "$$$". When the two comment types are defined in FREDI, the texts are then ignored.

The following is a code example of defining the comment type in the example above:

    Dim oEdiDoc As Fredi.ediDocument
    Dim oSef As Fredi.ediSchema
    Dim oCommentTypes As Fredi.ediCommentTypes
    Dim sSefFile As String
    Dim sEdiFile As String

    sSefFile = App.Path & "\850.sef"
    sEdiFile = App.Path & "\850.x12"

    Set oEdiDoc = New Fredi.ediDocument

    ' Get the comment types interface where we define out comment types.
    Set oCommentTypes = oEdiDoc.GetCommentTypes

    ' To define the comments following the transaction set header ST
    ' in the example above.
    oCommentTypes.AddCommentType "COMMENT1", "###", "{13:10}"

    ' To define the comments following the transaction set trailer SE
    ' in the example above.
    oCommentTypes.AddCommentType "COMMENT2", "$$$", "{13:10}"

    Set oSef = oEdiDoc.LoadSchema(sSefFile, 0)
    oEdiDoc.LoadEdi sEdiFile



Methods

Properties