EDIFACT SMDG BAPLIE Bayplan/Stowage Plan Occupied and Empty Locations Last updated: 2026-09-29

BAPLIE is the bayplan/stowage plan message. Shipping lines, terminals and vessel planners exchange it to describe where every container is stowed on a vessel. SMDG maintains the implementation - this sample follows SMDG 3.1 on D13B.

Each stowage location group gives the cell in bay-row-tier format, with the container's EQD details, weight, ports of loading and discharge, and dangerous goods or reefer settings.

At a glance

Standard
EDIFACT SMDG
Version
D13B (SMDG 3.1)
Sent by
Shipping line or terminal to terminal, line or vessel
Responses
CONTRL, APERAK
ediFabric .NET template
TSBAPLIE in EdiFabric.Templates.Edifact
OpenEDI definition
View BAPLIE in the spec library

BAPLIE structure

The full EDIFACT SMDG BAPLIE layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 10 loops and 35 segment positions, in file order. Loops are shaded and their segments indented; Max use is how many times a segment or loop may repeat.

Segment / loop Name Usage Max use
UNHMessage headerMandatory1
BGMBeginning of messageOptional1
DTMDate/time/periodOptional>1
RFF loopReferenceOptional>1
RFFReferenceOptional1
DTMDate/time/periodOptional>1
NAD loopName and addressOptional>1
NADName and addressOptional1
CTA loopContact informationOptional>1
CTAContact informationOptional1
COMCommunication contactOptional>1
TDT loopDetails of transportOptional>1
TDTDetails of transportOptional1
RFFReferenceOptional1
FTXFree textOptional1
LOC loopPlace/location identificationOptional>1
LOCPlace/location identificationOptional1
DTMDate/time/periodOptional>1
UNSSection controlOptional1
LOC loopPlace/location identificationOptional>1
LOCPlace/location identificationOptional1
FTXFree textOptional>1
RFFReferenceOptional1
EQD loopEquipment detailsOptional>1
EQDEquipment detailsOptional1
NADName and addressOptional>1
MEAMeasurementsOptional>1
HANHandling instructionsOptional>1
DIMDimensionsOptional>1
RFFReferenceOptional>1
GDSNature of cargoOptional>1
FTXFree textOptional>1
LOC loopPlace/location identificationOptional>1
LOCPlace/location identificationOptional1
TSRTransport service requirementsOptional1
TDTDetails of transportOptional1
TMP loopTemperatureOptional>1
TMPTemperatureOptional1
RNGRange detailsOptional1
DTMDate/time/periodOptional1
EQA loopAttached equipmentOptional>1
EQAAttached equipmentOptional1
NADName and addressOptional1
CNTControl totalOptional1
UNTMessage trailerMandatory1

Sample BAPLIE file

An SMDG 3.1 bayplan with occupied stowage locations. Paste it into EdiNation to see every element named and validated.

UNB+UNOA:2+SID+RID+20130430:1159+I-EX1/1+++++T01'
UNH+M-EX1/1+BAPLIE:D:13B:UN:SMDG31'
BGM+659::LOADONLY+M-EX1/1++38'
DTM+137:201304130959:203'
NAD+WZ+HNE:TERMINALS:306'
TDT+20+123W45+++HLC:LINES:306++9354351:11:ANINA'
RFF+VON:123E38'
LOC+5+BEANR'
DTM+136:201304301048:203'
LOC+61+FRLEH'
DTM+178:201305012100:203'
UNS+D'
LOC+147+0200688:9711:5'
EQD+CN+SUDU1234569:6346:5+42U0:6346:5+++5'
NAD+CF+HSD:LINES:306'
MEA+AAE+AET+KGM:22600'
DIM+13+CMT:::92'
CNT+8:1'
LOC+147+0200690:9711:5'
FTX+AGW++LOST:STOWLOC:306'
RFF+EQ:SUDU123459'
CNT+8:0'
UNT+21+M-EX1/1'
UNZ+1+I-EX1/1'

The same BAPLIE as JSON

ediFabric turns every loop, segment and element into a named field. This is the transaction from the sample, in the JSON that ediFabric Native and Cloud return and accept.

{
  "UNH": {
    "MessageReferenceNumber_01": "M-EX1/1",
    "MessageIdentifier_02": {
      "MessageType_01": "BAPLIE",
      "MessageVersionNumber_02": "D",
      "MessageReleaseNumber_03": "13B",
      "ControllingAgencyCoded_04": "UN",
      "AssociationAssignedCode_05": "SMDG31"
    }
  },
  "BGM": {
    "DOCUMENTMESSAGENAME_01": {
      "Documentnamecode_01": "659",
      "Codelistresponsibleagencycode_03": "LOADONLY"
    },
    "DOCUMENTMESSAGEIDENTIFICATION_02": {
      "Documentidentifier_01": "M-EX1/1"
    },
    "Responsetypecode_04": "38"
  },
  "DTM": [
    {
      "DATETIMEPERIOD_01": {
        "Dateortimeorperiodfunctioncodequalifier_01": "137",
        "Dateortimeorperiodtext_02": "201304130959",
        "Dateortimeorperiodformatcode_03": "203"
      }
    }
  ],
  "NADLoop": [
    {
      "NAD": {
        "Partyfunctioncodequalifier_01": "WZ",
        "PARTYIDENTIFICATIONDETAILS_02": {
          "Partyidentifier_01": "HNE",
          "Codelistidentificationcode_02": "TERMINALS",
          "Codelistresponsibleagencycode_03": "306"
        }
      }
    }
  ],
  "TDTLoop": [
    {
      "TDT": {
        "Transportstagecodequalifier_01": "20",
        "Meansoftransportjourneyidentifier_02": "123W45",
        "CARRIER_05": {
          "Carrieridentifier_01": "HLC",
          "Codelistidentificationcode_02": "LINES",
          "Codelistresponsibleagencycode_03": "306"
        },
        "EXCESSTRANSPORTATIONINFORMATION_07": {
          "Excesstransportationreasoncode_01": "9354351",
          "Excesstransportationresponsibilitycode_02": "11",
          "Customershipmentauthorisationidentifier_03": "ANINA"
        }
      },
      "RFF": {
        "REFERENCE_01": {
          "Referencecodequalifier_01": "VON",
          "Referenceidentifier_02": "123E38"
        }
      },
      "LOCLoop": [
        {
          "LOC": {
            "Locationfunctioncodequalifier_01": "5",
            "LOCATIONIDENTIFICATION_02": {
              "Locationidentifier_01": "BEANR"
            }
          },
          "DTM": [
            {
              "DATETIMEPERIOD_01": {
                "Dateortimeorperiodfunctioncodequalifier_01": "136",
                "Dateortimeorperiodtext_02": "201304301048",
                "Dateortimeorperiodformatcode_03": "203"
              }
            }
          ]
        },
        {
          "LOC": {
            "Locationfunctioncodequalifier_01": "61",
            "LOCATIONIDENTIFICATION_02": {
              "Locationidentifier_01": "FRLEH"
            }
          },
          "DTM": [
            {
              "DATETIMEPERIOD_01": {
                "Dateortimeorperiodfunctioncodequalifier_01": "178",
                "Dateortimeorperiodtext_02": "201305012100",
                "Dateortimeorperiodformatcode_03": "203"
              }
            }
          ]
        }
      ]
    }
  ],
  "UNS": {
    "Sectionidentification_01": "D"
  },
  "LOCLoop": [
    {
      "LOC": {
        "Locationfunctioncodequalifier_01": "147",
        "LOCATIONIDENTIFICATION_02": {
          "Locationidentifier_01": "0200688",
          "Codelistidentificationcode_02": "9711",
          "Codelistresponsibleagencycode_03": "5"
        }
      },
      "EQDLoop": [
        {
          "EQD": {
            "Equipmenttypecodequalifier_01": "CN",
            "EQUIPMENTIDENTIFICATION_02": {
              "Equipmentidentifier_01": "SUDU1234569",
              "Codelistidentificationcode_02": "6346",
              "Codelistresponsibleagencycode_03": "5"
            },
            "EQUIPMENTSIZEANDTYPE_03": {
              "Equipmentsizeandtypedescriptioncode_01": "42U0",
              "Codelistidentificationcode_02": "6346",
              "Codelistresponsibleagencycode_03": "5"
            },
            "Fulloremptyindicatorcode_06": "5"
          },
          "NAD": [
            {
              "Partyfunctioncodequalifier_01": "CF",
              "PARTYIDENTIFICATIONDETAILS_02": {
                "Partyidentifier_01": "HSD",
                "Codelistidentificationcode_02": "LINES",
                "Codelistresponsibleagencycode_03": "306"
              }
            }
          ],
          "MEA": [
            {
              "Measurementpurposecodequalifier_01": "AAE",
              "MEASUREMENTDETAILS_02": {
                "Measuredattributecode_01": "AET"
              },
              "VALUERANGE_03": {
                "Measurementunitcode_01": "KGM",
                "Measure_02": "22600"
              }
            }
          ],
          "DIM": [
            {
              "Dimensiontypecodequalifier_01": "13",
              "DIMENSIONS_02": {
                "Measurementunitcode_01": "CMT",
                "Heightmeasure_04": "92"
              }
            }
          ]
        }
      ],
      "CNT": {
        "CONTROL_01": {
          "Controlqualifier_01": "8",
          "Controlvalue_02": "1"
        }
      }
    },
    {
      "LOC": {
        "Locationfunctioncodequalifier_01": "147",
        "LOCATIONIDENTIFICATION_02": {
          "Locationidentifier_01": "0200690",
          "Codelistidentificationcode_02": "9711",
          "Codelistresponsibleagencycode_03": "5"
        }
      },
      "FTX": [
        {
          "Textsubjectcodequalifier_01": "AGW",
          "TEXTREFERENCE_03": {
            "Freetextdescriptioncode_01": "LOST",
            "Codelistidentificationcode_02": "STOWLOC",
            "Codelistresponsibleagencycode_03": "306"
          }
        }
      ],
      "RFF": {
        "REFERENCE_01": {
          "Referencecodequalifier_01": "EQ",
          "Referenceidentifier_02": "SUDU123459"
        }
      },
      "CNT": {
        "CONTROL_01": {
          "Controlqualifier_01": "8",
          "Controlvalue_02": "0"
        }
      }
    }
  ],
  "UNT": {
    "NumberofSegmentsinaMessage_01": "21",
    "MessageReferenceNumber_02": "M-EX1/1"
  }
}

Parse and validate a BAPLIE file

Read the file into typed objects with ediFabric .NET, or post it to the ediFabric Cloud REST API from any language and get JSON back.

using EdiFabric.Templates.EdifactD13B;

License.SetSerial("YOUR_SERIAL_KEY");

using (var stream = File.OpenRead(@"C:\edi\Bayplan.txt"))
using (var reader = new EdifactReader(stream, (unb, ung, unh) => typeof(TSBAPLIE).GetTypeInfo()))
{
    var items = await reader.ReadToEndAsync();
    foreach (var transaction in items.OfType<TSBAPLIE>())
    {
        if (transaction.IsValid(out MessageErrorContext errors))
            Console.WriteLine($"{transaction.UNH.MessageReferenceNumber_01} is valid");
        else
            Console.WriteLine(string.Join(Environment.NewLine, errors.Flatten()));
    }
}
curl -X POST 'https://api.edination.com/v2/edifact/read' \
-H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \
-H 'Content-Type: application/octet-stream' \
--data-binary '@Bayplan.txt'

Generate a BAPLIE file

Populate a TSBAPLIE object in .NET, or post JSON in the shape shown above to ediFabric Cloud, and get a valid BAPLIE file back.

using EdiFabric.Templates.EdifactD13B;

License.SetSerial("YOUR_SERIAL_KEY");

var transaction = new TSBAPLIE();

//  Message header (ref id = M-EX1/1)
transaction.UNH = new UNH();
transaction.UNH.MessageReferenceNumber_01 = "0001";
transaction.UNH.MessageIdentifier_02 = new S009();
transaction.UNH.MessageIdentifier_02.MessageType_01 = "BAPLIE";
transaction.UNH.MessageIdentifier_02.MessageVersionNumber_02 = "D";
transaction.UNH.MessageIdentifier_02.MessageReleaseNumber_03 = "13B";
transaction.UNH.MessageIdentifier_02.ControllingAgencyCoded_04 = "UN";
transaction.UNH.MessageIdentifier_02.AssociationAssignedCode_05 = "SMDG31";

//  Partial BAPLIE(code 659), loaded containers only(LOADONLY), final stage(code 38)
transaction.BGM = new BGM();
transaction.BGM.DOCUMENTMESSAGENAME_01 = new C002();
transaction.BGM.DOCUMENTMESSAGENAME_01.Documentnamecode_01 = "659";
transaction.BGM.DOCUMENTMESSAGENAME_01.Codelistresponsibleagencycode_03 = "LOADONLY";
transaction.BGM.DOCUMENTMESSAGEIDENTIFICATION_02 = new C106();
transaction.BGM.DOCUMENTMESSAGEIDENTIFICATION_02.Documentidentifier_01 = "M-EX1/1";
transaction.BGM.Responsetypecode_04 = "38";

//  Repeating DTM
transaction.DTM = new List<DTM>();

// ... set the remaining loops and segments the same way

// SegmentBuilders is in the Common project of the example repository
using (var stream = new MemoryStream())
{
    using (var writer = new EdifactWriter(stream))
    {
        writer.Write(SegmentBuilders.BuildUnb("1"));
        writer.Write(transaction);
    }
    Console.WriteLine(Encoding.UTF8.GetString(stream.ToArray()));
}
# the JSON returned by /read, edited or produced by your application
curl -X POST 'https://api.edination.com/v2/edifact/write' \
-H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \
-H 'Content-Type: application/json' \
--data-binary '@Bayplan.json' \
-o 'Bayplan.txt'

Complete ediFabric .NET example

A complete C# program for the EDIFACT SMDG BAPLIE, built on TSBAPLIE in EdiFabric.Templates.Edifact. The same code is in the ediFabric .NET examples on GitHub.

using EdiFabric.Core.Model.Edi;
using EdiFabric.Framework.Readers;
using EdiFabric.Framework.Writers;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using EdiFabric.Core.Model.Edi.Edifact;
using EdiFabric.Templates.EdifactD13B;
using EdiFabric.Examples.EDIFACT.Common;

namespace EdiFabric.Examples.EDIFACT.BAPLIE
{
    class Program
    {
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());
            Read();
            Write();
        }

        ///
        /// Read Bayplan
        ///
        static void Read()
        {
            var ediStream = File.OpenRead(Directory.GetCurrentDirectory() + @"\..\..\..\Files\Edifact\Bayplan.txt");

            List ediItems;
            using (var ediReader = new EdifactReader(ediStream, "EdiFabric.Templates.Edifact"))
                ediItems = ediReader.ReadToEnd().ToList();

            var transactions = ediItems.OfType();

            foreach (var transaction in transactions)
            {
                if (transaction.HasErrors)
                {
                    //  partially parsed
                    var errors = transaction.ErrorContext.Flatten();
                }
            }
        }

        ///
        /// Write Bayplan
        ///
        static void Write()
        {
            var transaction = BuildBayplan("M-EX1/1");

            using (var stream = new MemoryStream())
            {
                using (var writer = new EdifactWriter(stream))
                {
                    writer.Write(SegmentBuilders.BuildUnb("1"));
                    writer.Write(transaction);
                }

                var ediString = stream.LoadToString();
            }
        }

        ///
        /// Build bayplan.
        /// Original from http://www.smdg.org/assets/assets/BAPLIE3.1.1-02.pdf?
        ///
        static TSBAPLIE BuildBayplan(string controlNumber)
        {
            var result = new TSBAPLIE();

            //  Message header (ref id = M-EX1/1)
            result.UNH = new UNH();
            result.UNH.MessageReferenceNumber_01 = controlNumber.PadLeft(14, '0');
            result.UNH.MessageIdentifier_02 = new S009();
            result.UNH.MessageIdentifier_02.MessageType_01 = "BAPLIE";
            result.UNH.MessageIdentifier_02.MessageVersionNumber_02 = "D";
            result.UNH.MessageIdentifier_02.MessageReleaseNumber_03 = "13B";
            result.UNH.MessageIdentifier_02.ControllingAgencyCoded_04 = "UN";
            result.UNH.MessageIdentifier_02.AssociationAssignedCode_05 = "SMDG31";

            //  Partial BAPLIE(code 659), loaded containers only(LOADONLY), final stage(code 38)
            result.BGM = new BGM();
            result.BGM.DOCUMENTMESSAGENAME_01 = new C002();
            result.BGM.DOCUMENTMESSAGENAME_01.Documentnamecode_01 = "659";
            result.BGM.DOCUMENTMESSAGENAME_01.Codelistresponsibleagencycode_03 = "LOADONLY";
            result.BGM.DOCUMENTMESSAGEIDENTIFICATION_02 = new C106();
            result.BGM.DOCUMENTMESSAGEIDENTIFICATION_02.Documentidentifier_01 = "M-EX1/1";
            result.BGM.Responsetypecode_04 = "38";

            //  Repeating DTM
            result.DTM = new List();

            //  Date/time (UTC) when message has been prepared
            var dtm1 = new DTM();
            dtm1.DATETIMEPERIOD_01 = new C507();
            dtm1.DATETIMEPERIOD_01.Dateortimeorperiodfunctioncodequalifier_01 = "137";
            dtm1.DATETIMEPERIOD_01.Dateortimeorperiodtext_02 = "201304130959";
            dtm1.DATETIMEPERIOD_01.Dateortimeorperiodformatcode_03 = "203";
            result.DTM.Add(dtm1);

            //  Repeating NAD Groups
            result.NADLoop = new List();

            //  Begin NAD Group
            var nadLoop1 = new Loop_NAD_BAPLIE();

            //  Function of sender (terminal)
            nadLoop1.NAD = new NAD();
            nadLoop1.NAD.Partyfunctioncodequalifier_01 = "WZ";
            nadLoop1.NAD.PARTYIDENTIFICATIONDETAILS_02 = new C082();
            nadLoop1.NAD.PARTYIDENTIFICATIONDETAILS_02.Partyidentifier_01 = "HNE";
            nadLoop1.NAD.PARTYIDENTIFICATIONDETAILS_02.Codelistidentificationcode_02 = "TERMINALS";
            nadLoop1.NAD.PARTYIDENTIFICATIONDETAILS_02.Codelistresponsibleagencycode_03 = "306";

            //  End NAD Group
            result.NADLoop.Add(nadLoop1);

            //  Repeating TDT Groups
            result.TDTLoop = new List();

            //  Begin TDT Group
            var tdtLoop1 = new Loop_TDT_BAPLIE();

            //  Discharge voyage number, vessel operator, vessel identification
            tdtLoop1.TDT = new TDT();
            tdtLoop1.TDT.Transportstagecodequalifier_01 = "20";
            tdtLoop1.TDT.Meansoftransportjourneyidentifier_02 = "123W45";
            tdtLoop1.TDT.CARRIER_05 = new C040();
            tdtLoop1.TDT.CARRIER_05.Carrieridentifier_01 = "HLC";
            tdtLoop1.TDT.CARRIER_05.Codelistidentificationcode_02 = "LINES";
            tdtLoop1.TDT.CARRIER_05.Codelistresponsibleagencycode_03 = "306";
            tdtLoop1.TDT.EXCESSTRANSPORTATIONINFORMATION_07 = new C401();
            tdtLoop1.TDT.EXCESSTRANSPORTATIONINFORMATION_07.Excesstransportationreasoncode_01 = "9354351";
            tdtLoop1.TDT.EXCESSTRANSPORTATIONINFORMATION_07.Excesstransportationresponsibilitycode_02 = "11";
            tdtLoop1.TDT.EXCESSTRANSPORTATIONINFORMATION_07.Customershipmentauthorisationidentifier_03 = "ANINA";

            //  Loading voyage number
            tdtLoop1.RFF = new RFF();
            tdtLoop1.RFF.REFERENCE_01 = new C506();
            tdtLoop1.RFF.REFERENCE_01.Referencecodequalifier_01 = "VON";
            tdtLoop1.RFF.REFERENCE_01.Referenceidentifier_02 = "123E38";

            //  Repeating LOC TDT Groups
            tdtLoop1.LOCLoop = new List();

            //  Begin LOC TDT Group 1
            var locTdtLoop1 = new Loop_LOC_BAPLIE_2();

            //  Place of departure
            locTdtLoop1.LOC = new LOC();
            locTdtLoop1.LOC.Locationfunctioncodequalifier_01 = "5";
            locTdtLoop1.LOC.LOCATIONIDENTIFICATION_02 = new C517();
            locTdtLoop1.LOC.LOCATIONIDENTIFICATION_02.Locationidentifier_01 = "BEANR";

            //  Repeating DTM
            locTdtLoop1.DTM = new List();

            //  Actual departure time
            var dtmLoc1 = new DTM();
            dtmLoc1.DATETIMEPERIOD_01 = new C507();
            dtmLoc1.DATETIMEPERIOD_01.Dateortimeorperiodfunctioncodequalifier_01 = "136";
            dtmLoc1.DATETIMEPERIOD_01.Dateortimeorperiodtext_02 = "201304301048";
            dtmLoc1.DATETIMEPERIOD_01.Dateortimeorperiodformatcode_03 = "203";
            locTdtLoop1.DTM.Add(dtmLoc1);

            //  End LOC TDT Group 1
            tdtLoop1.LOCLoop.Add(locTdtLoop1);

            //  Begin LOC TDT Group 2
            var locTdtLoop2 = new Loop_LOC_BAPLIE_2();

            //  Next port of call
            locTdtLoop2.LOC = new LOC();
            locTdtLoop2.LOC.Locationfunctioncodequalifier_01 = "61";
            locTdtLoop2.LOC.LOCATIONIDENTIFICATION_02 = new C517();
            locTdtLoop2.LOC.LOCATIONIDENTIFICATION_02.Locationidentifier_01 = "FRLEH";

            //  Repeating DTM
            locTdtLoop2.DTM = new List();

            //  Estimated arrival time
            var dtmLoc2 = new DTM();
            dtmLoc2.DATETIMEPERIOD_01 = new C507();
            dtmLoc2.DATETIMEPERIOD_01.Dateortimeorperiodfunctioncodequalifier_01 = "178";
            dtmLoc2.DATETIMEPERIOD_01.Dateortimeorperiodtext_02 = "201305012100";
            dtmLoc2.DATETIMEPERIOD_01.Dateortimeorperiodformatcode_03 = "203";
            locTdtLoop2.DTM.Add(dtmLoc2);

            //  End LOC TDT Group 2
            tdtLoop1.LOCLoop.Add(locTdtLoop2);

            //  End TDT Group
            result.TDTLoop.Add(tdtLoop1);

            //  End of message header
            result.UNS = new UNS();
            result.UNS.Sectionidentification_01 = "D";

            //  Repeating LOC Groups
            result.LOCLoop = new List();

            //  Begin LOC Group 1
            var locLoop1 = new Loop_LOC_BAPLIE();

            //  Stowage location (used)
            locLoop1.LOC = new LOC();
            locLoop1.LOC.Locationfunctioncodequalifier_01 = "147";
            locLoop1.LOC.LOCATIONIDENTIFICATION_02 = new C517();
            locLoop1.LOC.LOCATIONIDENTIFICATION_02.Locationidentifier_01 = "0200688";
            locLoop1.LOC.LOCATIONIDENTIFICATION_02.Codelistidentificationcode_02 = "9711";
            locLoop1.LOC.LOCATIONIDENTIFICATION_02.Codelistresponsibleagencycode_03 = "5";

            //  Repeating EQD Groups
            locLoop1.EQDLoop = new List();

            //  Begin EQD Group
            var eqdLocLoop1 = new Loop_EQD_BAPLIE();

            //  40' open top container
            eqdLocLoop1.EQD = new EQD();
            eqdLocLoop1.EQD.Equipmenttypecodequalifier_01 = "CN";
            eqdLocLoop1.EQD.EQUIPMENTIDENTIFICATION_02 = new C237();
            eqdLocLoop1.EQD.EQUIPMENTIDENTIFICATION_02.Equipmentidentifier_01 = "SUDU1234569";
            eqdLocLoop1.EQD.EQUIPMENTIDENTIFICATION_02.Codelistidentificationcode_02 = "6346";
            eqdLocLoop1.EQD.EQUIPMENTIDENTIFICATION_02.Codelistresponsibleagencycode_03 = "5";
            eqdLocLoop1.EQD.EQUIPMENTSIZEANDTYPE_03 = new C224();
            eqdLocLoop1.EQD.EQUIPMENTSIZEANDTYPE_03.Equipmentsizeandtypedescriptioncode_01 = "42U0";
            eqdLocLoop1.EQD.EQUIPMENTSIZEANDTYPE_03.Codelistidentificationcode_02 = "6346";
            eqdLocLoop1.EQD.EQUIPMENTSIZEANDTYPE_03.Codelistresponsibleagencycode_03 = "5";
            eqdLocLoop1.EQD.Fulloremptyindicatorcode_06 = "5";

            //  Repeating NAD
            eqdLocLoop1.NAD = new List();

            //  Container operator (HSD)
            var nadEqd1 = new NAD();
            nadEqd1.Partyfunctioncodequalifier_01 = "CF";
            nadEqd1.PARTYIDENTIFICATIONDETAILS_02 = new C082();
            nadEqd1.PARTYIDENTIFICATIONDETAILS_02.Partyidentifier_01 = "HSD";
            nadEqd1.PARTYIDENTIFICATIONDETAILS_02.Codelistidentificationcode_02 = "LINES";
            nadEqd1.PARTYIDENTIFICATIONDETAILS_02.Codelistresponsibleagencycode_03 = "306";
            eqdLocLoop1.NAD.Add(nadEqd1);

            //  Repeating MEA
            eqdLocLoop1.MEA = new List();

            //  Gross weight (22.6 t)
            var meaEqd1 = new MEA();
            meaEqd1.Measurementpurposecodequalifier_01 = "AAE";
            meaEqd1.MEASUREMENTDETAILS_02 = new C502();
            meaEqd1.MEASUREMENTDETAILS_02.Measuredattributecode_01 = "AET";
            meaEqd1.VALUERANGE_03 = new C174();
            meaEqd1.VALUERANGE_03.Measurementunitcode_01 = "KGM";
            meaEqd1.VALUERANGE_03.Measure_02 = "22600";
            eqdLocLoop1.MEA.Add(meaEqd1);

            //  Repeating DIM
            eqdLocLoop1.DIM = new List();

            //  Overheight (92 cm)
            var dimEqd1 = new DIM();
            dimEqd1.Dimensiontypecodequalifier_01 = "13";
            dimEqd1.DIMENSIONS_02 = new C211();
            dimEqd1.DIMENSIONS_02.Measurementunitcode_01 = "CMT";
            dimEqd1.DIMENSIONS_02.Heightmeasure_04 = "92";
            eqdLocLoop1.DIM.Add(dimEqd1);

            //  End EQD Group
            locLoop1.EQDLoop.Add(eqdLocLoop1);

            //  Control total
            locLoop1.CNT = new CNT();
            locLoop1.CNT.CONTROL_01 = new C270();
            locLoop1.CNT.CONTROL_01.Controlqualifier_01 = "8";
            locLoop1.CNT.CONTROL_01.Controlvalue_02 = "1";

            //  End LOC Group 1
            result.LOCLoop.Add(locLoop1);

            //  Begin LOC Group 2
            var locLoop2 = new Loop_LOC_BAPLIE();

            //  Stowage location (blocked)
            locLoop2.LOC = new LOC();
            locLoop2.LOC.Locationfunctioncodequalifier_01 = "147";
            locLoop2.LOC.LOCATIONIDENTIFICATION_02 = new C517();
            locLoop2.LOC.LOCATIONIDENTIFICATION_02.Locationidentifier_01 = "0200690";
            locLoop2.LOC.LOCATIONIDENTIFICATION_02.Codelistidentificationcode_02 = "9711";
            locLoop2.LOC.LOCATIONIDENTIFICATION_02.Codelistresponsibleagencycode_03 = "5";

            //  Repeating FTX
            locLoop2.FTX = new List();

            //  Lost slot
            var ftxLoc1 = new FTX();
            ftxLoc1.Textsubjectcodequalifier_01 = "AGW";
            ftxLoc1.TEXTREFERENCE_03 = new C107();
            ftxLoc1.TEXTREFERENCE_03.Freetextdescriptioncode_01 = "LOST";
            ftxLoc1.TEXTREFERENCE_03.Codelistidentificationcode_02 = "STOWLOC";
            ftxLoc1.TEXTREFERENCE_03.Codelistresponsibleagencycode_03 = "306";
            locLoop2.FTX.Add(ftxLoc1);

            //  Equipment causing lost slot
            locLoop2.RFF = new RFF();
            locLoop2.RFF.REFERENCE_01 = new C506();
            locLoop2.RFF.REFERENCE_01.Referencecodequalifier_01 = "EQ";
            locLoop2.RFF.REFERENCE_01.Referenceidentifier_02 = "SUDU123459";

            //  Control total
            locLoop2.CNT = new CNT();
            locLoop2.CNT.CONTROL_01 = new C270();
            locLoop2.CNT.CONTROL_01.Controlqualifier_01 = "8";
            locLoop2.CNT.CONTROL_01.Controlvalue_02 = "0";

            //  End LOC Group 2
            result.LOCLoop.Add(locLoop2);

            return result;
        }
    }
}

More operations in ediFabric .NET

Template and sample downloads

ediFabric .NET parses, validates and generates the EDIFACT SMDG BAPLIE with TSBAPLIE in EdiFabric.Templates.Edifact. The template ships in the NuGet package; download the source to adapt it to a trading partner's implementation guide.

BAPLIE questions

What is SMDG?

The User Group for Shipping Lines and Container Terminals. It maintains the BAPLIE, MOVINS and COARRI implementation guides the industry uses.

What is the difference between BAPLIE 2.x and 3.x?

Version 3 is based on newer directories (D13B) and describes the vessel, stowage locations and equipment in more detail, including VGM weights and better reefer and dangerous goods data.

How is a stowage position encoded?

LOC+147 carries the cell as bay, row and tier, for example 0120382.

How do I parse and generate EDIFACT SMDG BAPLIE files in .NET?

In .NET, install EdiFabric and EdiFabric.Templates.Edifact, read the file with EdifactReader into TSBAPLIE objects and write them back with EdifactWriter. From any other language, post the file to the ediFabric Cloud REST API, which returns the same structure as JSON and converts JSON back to EDIFACT SMDG.

Resources

Parse your first EDIFACT SMDG BAPLIE in five minutes

The Community plan is free forever and needs no credit card. It includes ediFabric .NET, Native and Cloud with one serial key.

Sign up free Validate EDI files free