Learn a step-by-step procedure for configuring transportation legs across the supply chain, planning for these shipments, and determining the costs involved with a real-life example. Even though transportation leg planning is well integrated with various SAP modules, in most companies this activity is handled in bits and pieces by the logistics, sales, and finance teams. This overview consolidates the tasks to provide an understanding of the entire process.
Key Concept
Leg planning is a major part of planning out a shipment from a source to destination location. Leg planning resides within the transportation component of Sales & Distribution. It takes into account deliveries, which are part of the sales order and delivery component of SD. Often you’ll need to split your shipment into multiple legs. Leg planning functionality enables you to organize transport more effectively, select proper logistics service providers, prepare shipment papers, and ascertain shipment costs.
I'll demonstrate it with the example of a company with warehouses in San Jose, San Francisco, and Oakland that plans
to ship its product to customers in New York, Washington, and New Jersey. It includes multiple modes of transport: from
the San Jose, San Francisco, and Oakland warehouses to the San Francisco harbor (by truck); from the San Francisco harbor
to the New York harbor (by ship); and from the New York harbor to customers in New York, Washington, and New Jersey (by
truck). This requires what is known in transportation planning as a segmented delivery.
Even though I use SAP 4.7 Enterprise as my frame of reference, the concepts hold true for all earlier and later
versions, including mySAP ERP Central Component (ECC).
My example company appoints a transportation agent for shipment. It prepares shipment papers at the port of origin
(San Francisco) and port of entry (New York) according to applicable shipping terms. Each of the shipment legs involves
different costs, some borne by the shipping party and some by the end consumer. They include costs associated with
insurance, cleaning, and customs in addition to transportation costs. The end consumer in my example is a person who
receives the final shipment of goods in New Jersey. SAP R/3 provides a mechanism, known as transportation planning, which
allows you to plan different legs during a shipment and arrive at best possible approach.
Note
My example is of a shipment within national borders. Most of the concepts for international trade from a transportation leg planning standpoint remain the same except for additional complications of global trade. For example, with global trade you have to deal with rules for crossing water territories, country-specific rules, duty-free zones, and customs requirements. Each of these conditions has an impact on transportation shipments and associated shipment costs.
Leg Types
The five leg types are preliminary leg, main leg, subsequent leg, direct leg, and return leg. The first three are
used in a segmented delivery like that in my example. In the preliminary leg, the leg departure point is the same as the
overall delivery departure point. In the subsequent leg, leg destination is the same as the overall delivery
destination.
A main leg segment is the most important part of the shipment. It covers the major portion of the shipment and is
accompanied by at least one preliminary leg and one subsequent leg. The basic definition of a main leg is a leg that does
not start from an overall delivery departure point and does not terminate at an overall delivery destination point. In my
scenario, shipments from the San Jose, San Francisco, and Oakland warehouses are termed preliminary legs. Shipments from
the San Francisco harbor to the New York harbor are the main leg. Shipments from the New York harbor to customers in New
York, Washington, and New Jersey are subsequent legs.
Other scenarios can have two more types: direct leg and return leg. Direct leg has no preliminary or subsequent legs
and shipment takes place from one source to one destination. A direct leg starts from the overall delivery departure point
and terminates at the overall delivery destination point. Return leg refers to the means of transport to return a shipment
to its original source location. In other words, it completes a 360-degree loop from source to destination and back
— for example, you transfer raw material shipments from the originating location to the destination location and
then ship finished products back.
Leg Planning Steps
To begin, let’s look at how transportation leg planning is done. SAP
performs transportation leg planning in a defined sequence:
1. R/3 first checks whether leg determination can be carried out using the leg determination category defined for
each shipment type.
2. If leg determination needs to be done, R/3 checks for different deliveries in the shipment and attaches the
information to the shipment document. It also determines the points of departure and destination for these
deliveries.
3. R/3 then analyzes the stages for each delivery. Which stages are legs? Were they created manually or
automatically?
4. R/3 checks whether the given shipment is part of a supply chain. It tries to identify whether it is a direct
shipment or part of preliminary leg, main leg, or subsequent leg.
5. Finally, R/3 carries out automatic leg determination, if it is configured, and fills the legs with relevant
data such as shipment cost relevance. However, if the system is configured for manual leg determination, R/3 assigns
deliveries to various stages in the shipment.
I’ll detail this process with a real-life example using a mostly automatic method, explain some of the terms
used in the process, and then discuss this scenario in relation to the shipment type. Finally, I will guide you through
the calculation of shipment costs for each shipment type.
Example Scenario
My scenario is shown in Figure 1. Multiple trucks leave from three shipping points (Oakland, San
Jose, and San Francisco) to take deliveries to the harbor (San Francisco), where they are loaded onto the ship. The ship
then carries the deliveries to the destination harbor (New York). From there, they are loaded onto three different trucks
and then dispatched to different customers (New York, Washington, New Jersey).

Figure 1
Shipping points and legs for the sample scenario
Associate Leg Determination Category and Shipment
Now I’ll show you how to define the leg determination category for my example. This category
determines whether you need to enter legs manually or whether the system determines them automatically, what factors are
considered during leg determination, and how deliveries are created after legs are determined. These categories are
assigned when you define the shipment type. Table 1 shows commonly used leg determination categories
defined in SAP R/3.
Blank |
No legs are to be determined |
0 |
Only determine assignment of deliveries to stages |
1 |
Legs determined according to departure point and itinerary |
2 |
Preliminary and subsequent legs determined according to point of departure and
point of delivery |
3 |
Preliminary and subsequent legs determined according to delivery |
4 |
Same as 1, but shipment type for preliminary and subsequent leg changeable |
|
Table 1 |
Determine leg category according to shipment type |
In my example, preliminary and subsequent legs are determined automatically according to the point of
departure (Oakland, San Francisco, and San Jose) and point of delivery (New York, Washington, and New Jersey).
Transportation planning has six possible leg determination categories, shown in Table 1. My example corresponds to leg
determination category 2.
To assign the category to the shipment, follow menu path Logistics>Execution>
Transportation>Shipments>Define Shipment Types. Choose the appropriate category from the drop-down menu at
the bottom of the screen. The Determine legs drop-down menu asks you to indicate not only what leg
category the shipment falls under, but also whether legs are to be determined automatically or configured manually. In my
scenario, the main leg is defined manually, while preliminary and subsequent legs are determined automatically. The
preliminary leg is determined automatically based on the relation between the loading point and the main leg, while the
subsequent leg is determined automatically based on the relation between the ship-to party and the main leg.
Once you have defined the determination category, assign the categories to the Shipment
type. I have defined three shipment types:
- Figure 2: Preliminary leg by road (0004)

Figure 2
Preliminary leg by road
- Figure 3: Main leg by sea (0005)

Figure 3
Main leg by sea
- Figure 4: Subsequent leg by road (0006)

Figure 4
Define shipment cost type
Shipment type controls whether shipment takes place by truck, rail, sea, or air. You
maintain this using the Shipping type field. If you have shipments taking place using multiple shipping
types, you would have multiple shipment types — one for each mode of transport. You also define the Shipment
type for every subsequent or preliminary leg. Create shipment legs for preliminary or subsequent legs based on
the leg determination category as shown in Table 1.
While defining the shipment type, you can specify how to carry out leg determination. R/3 provides the
following categories for leg determination:
• Blank: System does not perform any leg determination.
• 0: System does not perform any leg determination but allows deliveries to be assigned to various
stages in the chain.
• 1: System performs leg determination across the itinerary. This approach works best when goods are
picked up from individual points in a certain order and delivered to customers in a certain order.
• 2: System performs leg determination with reference to the destination point or departure point.
This approach works when a leg has been created with reference to a destination point or departure point. It works when
goods are shipped by sea in a group, but picked from multiple points and delivered to customers at different points.
• 3: System performs leg determination for each delivery and creates a leg for each delivery. It is
used for transporting large shipments when an entire shipment cannot be covered in a single delivery.
• 4: System performs leg determination across the itinerary with the added logic of taking shipping
types into account. This helps to hide subsequent legs when you are responsible for only a particular leg and not for the
entire process.
Other fields to consider on these screens are:
Note
In many cases, you may have to deal with external transportation systems and data flow that takes place in the form of intermediate documents (IDocs). In this case, follow the ALE/EDI method of exchanging data between SAP and other non-SAP systems. Define logical non-SAP systems using the concept of partner functions, configure the Remote Function Call (RFC) destination, define ALE ports, and maintain partner profiles for logical systems in same way you configure external data communication with vendors/customers.
ShpmtComplType (shipment completion type) controls whether shipment is an outbound
shipment to a customer or an inbound shipment from a vendor. In my scenario, all shipments are defined as
outbound.
In the example, I define ProcessControl as Collective shipment using one mode of
transport. This indicates that multiple shipments were sent from different locations using a single mode of
transport (truck) and delivered to multiple destinations, known as a collective shipment. You can also define
ProcessControl as Individual shipment using mode of transport, Individual shipment using several
modes of transport, Collective shipment using one mode of transport, and Collective
shipment using several modes of transport based on your business scenario.
The Adopt route indicator controls which legs are to be included in the shipment. I have
defined the indicator with the value Adopt all stages for the main leg, indicating that all stages
defined in the route — whether preliminary or subsequent — are included in the shipment and attached to the
main leg. I have used Only stages with leg indicator of shipment header for the preliminary and
subsequent legs. This ensures that only the main leg of the route is included in a shipment and attached to the
preliminary or subsequent leg.
Once you have determined all the shipment legs, R/3 associates deliveries with the appropriate legs. The
system analyzes the point of departure and point of destination for each delivery. If the point of departure for the
delivery is found among departure points for existing legs and the destination is found among destination points for the
legs, then it looks for those legs that connect the departure and destination points. If only a departure point or a
destination point exists, the system assigns all adjoining legs to the delivery. If there is neither a departure point nor
a destination point in the system and delivery is a preliminary or subsequent leg, then the delivery is assigned to all
legs. All other shipments are assigned to main legs.
Determine Shipment Cost
Now that you have defined all shipments along the route, you need to understand what costs are associated
with managing these shipments. These may come in the form of transportation costs, insurance costs, cleaning costs, load
transfer costs, or customs costs. Each of these costs is configured in terms of item categories in R/3 by functional
consultants.
To do so, follow menu path Logistics Execution>Transportation>Shipment Costs>Shipment
Cost Document>Shipment Cost Types and Item Categories or use transaction T_56.
Once you define item categories, you enter the shipment cost type 0001
in Figure
5 to track shipment of a standard type. The shipment cost type is assigned with an internal or external number
range and is used for cost accounting at the time of shipment completion. I defined these settings in the number systems
and Control data portion in Figure 5 by setting 01
as the internal number range and
Shipment completion as the overall shipment status.

The shipment cost type determines the category of document created at the time of shipment completion. I
defined Document cat. as a
in Figure 5 to show the document category for shipment cost
type.
The next step is to associate the item categories and shipment cost type parameters. Assign shipment cost
type (0001) to the appropriate item categories — 0001 to 0006 in
my example, as shown in Figure 6. I associate the costs to different stages in the shipment.
Transportation costs apply at the shipment leg while Insurance applies at shipment
header. You also determine how the system accounts for or calculates various costs by means of route procedure
(RteAutProc). For example, the first entry shows that R/3 would determine the account for general costs
at the shipment header stage while the fourth entry shows that transportation costs would be calculated at the shipment
leg stage.

Figure 6
Assign shipment cost type and item categories
Now that you have defined various costs associated with the shipment, you need to associate these costs to
various legs in the shipment. Select each stage of the shipment and associate each with the shipment cost type. In my
example in Figure 7, I attached shipment cost type 0001 with shipment types
0004, 0005, and 0006. This ensures that R/3 applies the shipment cost
by the standard approach to all three legs of the shipment. (There are many possible approaches to costing methodology
based on client-specific practices.)

Figure 7
Assign shipment cost type to shipment type
Follow menu path Logistics Execution>Transportation>Shipment Costs>Shipment Cost
Document>Shipment Cost Relevance and Default for Shipment Type or use transaction
T_57.
During transportation, all legs of the shipment may not be accounted for in the shipment cost calculation.
If you determine that the load transfer point and border crossing point are not subject to costing for a subsequent leg by
road, you can control this by unchecking all legs in the shipment that are not relevant for costing. This is shown in
Figure 8 where only the Header and Leg shipment segments have been
checked, while Load transfer and Border crossing point are not checked for shipment type
(ShTy) 0006.

Figure 8
Define shipment cost relevance for shipment type
Execute the Transportation Leg Process
Now that I have defined all of the steps for configuring transportation leg planning and ascertaining
shipment costs in the legs of transportation, I can execute shipment of the sample scenario.
Step 1. Create a shipment. Follow menu path
Logistics>LogisticsExecution>Transportation>Transportation Planning>Create Single Document or
use transaction VT01N (Figure 9).

Figure 9
Create shipment for preliminary leg from SFO depot to SFO harbor
Next, you must create a shipment for the preliminary leg from the San Francisco depot to San Francisco
harbor. You define a shipment document for the preliminary leg (Figure 9) associated with shipment type
0004 with shipping type 01 travel using forwarding agent P9. This
shipment has been marked for movement using a truck and involving shipping vendor P9 as forwarding agent.
When you enter the information, R/3 displays planned dates and timings. As the shipment proceeds along the transportation
chain, users enter actual dates and timings as well as the status of the shipment for monitoring. The system also
associates the shipment number with the shipment ($0001 in my example). In Figure 9, note that shipment
has been marked for completion within the preliminary leg (from San Francisco depot to San Francisco harbor). The shipment
was completed at 18:00 on 01/01/2006 against the planned time of 17:00 on that date. Similarly, you can create shipment
documents for the main and subsequent legs.
Step 2. Associate deliveries within a shipment. Follow menu path
Logistics>LogisticsExecution>Transportation>Transportation Planning>Change Single Document or
use transaction VT02N.
When you create a shipment, choose deliveries according to your needs and then assign these deliveries to
the shipment document. Identify delivery documents from the central warehouse (001) and shipping point
(0001) with the destination location as NEW YORK and the transportation planning date
of 01/01/2006, as shown in Figure 10. Once you have selected all such deliveries,
associate these deliveries with a shipment document, as indicated in the next step.

Figure 10
Select Deliveries for Shipment from SFO warehouse to SFO Harbor
Step 3. Maintain the transportation planning point. Follow IMG path Enterprise
Structure>Definition>Logistics Execution>Maintain Transportation Planning Point.
The transportation planning point resembles a group of employees responsible for transportation
activities. Each shipment is assigned to a transportation planning point for planning and shipment completion. Assign the
transportation planning point to a company code. In my example, I define SFO, SJC, and OAK as three transportation
planning points for San Francisco, San Jose, and Oakland.
Step 4. Assign the purchasing organization to a transportation planning point. Follow IMG
path Logistics Execution> Transportation>Shipment Costs>Settlement>Assign Purchasing
data.
Once you define the transportation planning points, assign them to the relevant purchasing organizations
and shipment cost types. For example, if the purchasing organization is identified as 0001 and shipment
cost type of a standard nature as 0001, then you associate SFO, SJC, and OAK to purchasing organization
0001 and shipment cost type 0001. The system automatically books any shipment taking
place from the transportation point against the shipment cost and the relevant purchasing organization.
Step 5. Post goods issue for shipments. Follow menu path Logistics>Logistics
Execution>Outbound Process>Goods Issue for Outbound delivery>Post Goods Issue>Collective Processing via
Outbound Delivery Monitor or use transaction VL06G.
You can post a goods issue for an entire shipment. You do this when there are several deliveries in a
shipment and you do not want to post each delivery individually. Enter the shipment number value in shipment number field
and execute. The system automatically selects all deliveries belonging to the shipment and posts a goods issue for
them.
Step 6. Compute the shipment cost. Follow menu path Logistics>Logistics
Execution>Transportation>Shipment Costs>Create Single Document or use transaction VI01.
Once you have created the shipment document and associated deliveries to the shipment document, calculate costs for each
element of the shipment.
Enter 0001
for Standard shipment cost type and P9
for forwarding agent. These
costs relate to freight costs for forwarding agent P9. Figure 11 shows how general cost item
1050 was calculated for the shipment cost document.

Figure 11
Compute shipment cost
Sachidanand Padgaonkar
Sachidanand Padgaonkar is an SAP Senior Consultant at Infosys Technologies Ltd. with 10 years of consulting experience executing the diverse modules of SAP Financials, Sales and Distribution, and Logistics, with a special focus on the SAP Retail industry solution. Sachidanand is currently a consultant in the SAP space for leading high-tech companies in the San Francisco Bay Area. He has a degree in electrical engineering and an MBA in finance. He has published many articles in international publications and was a speaker at ASUG 2006 in Orlando.
You may contact the author at sachidanand_p@infosys.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.