Returns the area or table number of the Transaction Set where the Data Segment is located.
Syntax:
Remarks:
EDI documents can be sectioned into header, detail and summary, which have an area (or table) value of 1, 2, and 3 respectively. Not all documents have all three sections. A segment can be uniquely identified by checking jointly its area, loopsection and ID. Envelope segments (e.g. ISA, GS in X12, and UNB, UNG in EDIFACT) have an area value of 0.
Example
Dim oEdiDoc As Fredi.ediDocument
Dim oSegment As Fredi.ediDataSegment
...Set oSegment = oEdiDoc.FirstDataSegment
While Not oSegment Is Nothing
sSegmentID = oSegment.ID
sLoopSection = oSegment.LoopSection
nArea = oSegment.AreaIf nArea = 2 Then
If sLoopSection = "LX;N1" Then
If sSegmentID = "N1" Then
txtCompanyName.Text = oSegment.DataElementValue(2)
txtCompanyID.Text = oSegment.DataElementValue(4)
End If
End If
ElseIf nArea = 3 Then
If sLoopSection = "" Then
If sSegmentID = "BIN" Then
Set oDataElement = oSegment.DataElement(2)
oDataElement.ExportValue sPath & "EXported" & txtPublicKey.Text
ElseIf sSegmentID = "ERI" Then
txtMethodSend.Text = oSegment.DataElementValue(2)
End If
End If
End If
Set oSegment = oSegment.Next
Wend
Sample