Maintaining Scale and Calculation Bases

Objectives

After completing this lesson, you will be able to:
  • Configure Scale and Calculation Bases.
  • Create Scale Templates.
  • Maintain Scales.

Scale Base

This image shows where the scale resides in the Transportation Charge Management master data structure.

The figure shows where the scale resides in the Transportation Charge Management (TCM) master data structure.

The scale base defines how the system interprets the scale.

You can define scale bases in Customizing for Transportation Management under Basic FunctionsCharge CalculationData Source BindingDefine Scale Bases.

Rate Table with Three Scales

This figure shows a Rate Table with Three Scales.

A scale is used to define a parameter that then defines a rate. For example, if a rate depends upon distance and weight, you must define a separate scale for distance and for weight. The distance and weight scales are then used to define the rate. A scale can be reused in multiple rate tables.

In the example in the figure, the rate table has the following three dimensions:

  • Dest zone
  • Origin location
  • Weight in lbs

Therefore, three scales must be defined for each dimension.

Configuration - Scale Base

This figure shows the configuration of the scale base.

Path for Customizing Templates

You can define scale bases in Customizing for Transportation Management under Basic FunctionsCharge CalculationData Source BindingDefine Scale Bases.

Fields

Field Assignment

Field assignment denotes the internal field from /SCMTMS/S_TCSCALE_ITEM_DB, which is assigned to the corresponding scale base and stores the scale values for the scale created with this scale base.

UoM Relevant

Unit of Measure (UoM) relevance checks if a scale base is relevant for the unit of measure.

Dimension

Link to the T006 dimension.

Rounding Rule

The rounding rule indicates whether a rounding rule is applicable to the scale or not.

Numeric

Numeric checks whether the input scale value is numeric or not.

Crcy Scale base

Checks if the scale base is for currencies (example: amount).

Raw values

Checks if the scale base is for raw values (examples: business partner, location).

Date Scale Base

Checks if the scale base is for dates (example: date).

Example

The cost of a shipment depends upon the weight of the goods and the distance traveled. Therefore, the weight and distance form the scale base. To define a scale base for weight, you maintain it in Customizing in the following way:

Scale Base Data

FieldValue
Scale BaseWEIGHT
Scale Base Desc.SCAVAL_WT
UsageBase for Scales
UoM RelevantX
DimensionMass
Rounding RuleX
NumericX

Scale Base Enhancement

This image shows the Scale Base Enhancement.

The standard scale bases reflect the most common in the transportation industry. There are situations in which you may have unique requirements and need an enhancement.

You want to add customer-specific scale bases.

1. Extend scale item structure:

Use the extension and include /SCMTMS/INCL_EEW_TC_SCALE_ITEM. Append the new field with the corresponding data element and search help to structure.

2. Add the scale base in Customizing:

In Customizing, choose Transportation Management → Basic Functions → Charge Calculation → Data Source Binding for Charge Calculation → Define Scale Bases.

3. Enhance the scale UI:

a) Open the Dynpro component configuration /SCMTMS/WDCC_TCM_SCALE_ITM (package /SCMTMS/UI).

b) Use the Web Dynpro enhancement concept to add a new column. The new field from the scale item structure will is available here.

c) The column visibility is controlled by the TCM view exit class /SCMTMS/CL_UI_VIEWEXIT_TCM, method SCALE_ITEM_PROP.

No changes should be necessary.

Calculation Base

This figure shows the Calculation Base.

A calculation base identifies the actual base or factor with which the system calculates the charges for the scale.

There can be various scenarios in which the system must calculate a charge for different forms of weights, for example, gross weight and net weight.

In this case, both gross weight and net weight correspond to the scale base Weight (W), whose dimension is mass. However, by definition, gross weight, and net weight are two entirely different charge aspects. Therefore, they have two different calculation bases, such as "W1" for gross weight and "W2" for net weight.

To follow the scenario given here, you define a calculation base for every scale base. This calculation base is the final element in the charge determination. This means that the calculation base is used to determine the charges.​

In the figure, the charges depend on the weight and the destination location. The scale has the scale base Location. This scale base defines that the scale uses locations only. The scale base can be used for both the source and destination location. The calculation base DESTLOC determines that the destination location of the freight order is used. Technically, in the customizing of the calculation base, you define which field is to be used and which program or class the system calls on to determine the field value.

If the resolution base in the calculation sheet points to the freight order stage, the system derives the values from the specific stage and use it in the calculation.

Configuring the Calculation Base

This image illustrates the configurating of the Calculation Base.

The calculation base is defined in Customizing. Choose Transportation ManagementBasic FunctionsCharge CalculationData Source BindingDefine Calculation Bases.

In the Customizing activity, you define a calculation base for a scale base.

The calculation base indicates on what base that the charge calculation is executed for a corresponding scale. You can assign a default calculation type to the calculation base, for example, absolute or relative. You can also specify the transportation mode category. This restricts the calculation bases in a rate table to calculation bases that have the same transportation mode category as the charge type in the rate table and to those with no specified transportation mode category. ​

When configuring, the following fields can be specified:

Scale Base

The Scale Base refers to the scale base, which will be utilized for this calculation.

Field Assignment

The Field Assignment refers to the internal field assignment of the logistical data.

Currency Field

The Currency Field is used for a currency-based calculation base.

Unit Field

The Unit Field is used for quantity-based calculation bases such as weight, volume, pieces, and so on.

Helper Assignment

The Helper Assignment refers to the program logic, which links to the data source.

Use BAdI

Select if a custom-specific logic is to be specified.

Party Role

The Party Role is used when business partners are specified and such role assignments are required, such as consignee, sold-to, or bill-to party, and so on.

Calculation Type

You can assign a default calculation type to the calculation base. For "same-scale" scale bases, the calculation type is absolute, whereas the quantity fields, which refers from and to will be relative.

Calculation Usage

The Calculation Usage specifies whether the calculation base is used for manual charges or rate tables, or whether it can be used in both situations. Leave blank for no restriction.

TrM Category

The TrM Category restricts the calculation bases in a rate table to calculation bases that have the same transportation mode category as the charge type in the rate table and to calculation bases with no specified transportation mode category.

Calculation Base Enhancement

This image shows the Calculation Base Enhancement.

Calculation base enhancement involves extending the communication structure, adding the calculation base in Customizing, and (optionally) implementing the BAdl or helper class.

Addition of the Scale and Calculation Base

This image shows the addition of Scale and Calculation Base.

When adding the scale and calculation base, it is often necessary to add a new resolution base.

To add a new resolution base, you do the following:

  • Adapt the resolution base configuration. Add a new resolution base to table /SCMTMS/C_RES_BS. This was Customizing, but is now delivered as a control table. Only the resolution base name must be maintained. All other fields are currently not used.
  • Implement logic in BAdl. The data access object provides a BAdI: /SCMTMS/TCC_BO_DATA_ACCESS for customer implementations.

Note

When creating a custom calculation base, it is always necessary to define a scale base for that calculation base.

How to Configure Enhancements to a Calculation Base

1. Extend the communication structure:

a) Use the extension included for the calculation base structure: /SCMTMS/INCL_EEW_TCC_CB.

b) Append a new field with the corresponding data element.

The component name must be the same as on the underlying document.

The field is copied over to the internal communication structure and available in the engine automatically.

2. Add a calculation base in Customizing:

a) In Customizing, choose Transportation Management → Basic Functions → Charge Calculation → Data Source Binding → Define Calculation Bases.

b) Add a new entry and use the new field for the field assignment.

c) Set the scale base and other properties.

3. Implement the BAdl or helper class.

a) If the calculation base needs additional logic, use the BAdI method GET_CALC_BASE_VALUES of BAdI /SCMTMS/TCC_BO_DATA_ACCESS. Refer to the BAdI documentation for details.

b) Set the BAdI flag in the calculation base Customizing.

You can also use the helper class approach, which allows you to extend existing helper classes. The interface /SCMTMS/IF_TCC_CALC_BASE is similar to the BAdI interface.

c) Refer to existing helper classes /SCMTMS/CL_TCC_CB_* for sample implementations.

The BAdI or helper class is called after the value has been retrieved from the communication structure if a field assignment is provided as well.

Scale Templates

This figure shows where the scale template resides in the TCM master data structure.

This figure shows where the scale template resides in the TCM master data structure.

Scale Templates Defined

This image defines the Scale Templates.

A scale template is used to create a scale automatically. The use of a scale template is optional, as you can also create a scale manually.

One advantage of using scale templates is that you can predefine available scale items, reducing the effort required for manual maintenance and avoiding errors due to typos. A scale template is an efficient way to create scales during rate table maintenance.

You can create scale templates either in Customizing or as Master Data. When using Customizing, the templates can be transported between systems and used as templates for creating scales.

In Customizing, choose Transportation ManagementBasic FunctionsCharge CalculationBasic SettingsTemplatesDefine Scale Templates.

Scale Template Fields

The scale template includes the following information:

Scale template

This is the name of the scale template that the system uses to create a scale.

Scale type
Indicates whether the scale values depict the upper or lower boundaries for the scale levels. The scale type defines how the system interprets the scale values during calculation, as follows:
  • From a certain value and upwards (Base Scale)
  • Up to a certain value (To Scale)
  • Exactly one value (Same Scale)
Scale base

Defines how the system interprets the scale. A parameter or a factor can influence transportation charges.

You also have the option of creating scale template items.

When creating scale templates using Customizing, you cannot create items for Same Scales, because they are dependent on Master Data. When creating Scale Templates as Master Data (using the SAP Fiori Launchpad), you can also maintain scale items for Same Scales.

Master data templates can be created and used by users who have no authorization to change customizing. In contrast to templates created in customizing, master data templates cannot be transported across different systems. In the SAP Fiori Launchpad Charge Management Worklist, master data and customizing templates are depicted in their own queries.

Scale Maintenance

This image shows the Master Data Structure.

This diagram shows where the scale resides in the TCM master data structure.

Scale Maintenance Function

This figure illustrates the Scale Maintenance Function.

You can use the scale maintenance function to create and change scales. For example, you can configure the items of a scale according to one of the following:

  • Quantities
  • Volumes
  • Weights
  • Distances
  • Points

Scale maintenance is a prerequisite for the maintenance of rates, as scales are the dimensions of rate tables. You can create scales as own master data, or during rate table maintenance. If you maintain scales as separate master data objects independently from rate tables, you can reuse scales in multiple rate tables.

Scale Creation

You create a new scale in the SAP Fiori Launchpad.

Choose Charge ManagementCreate Scale.

When creating a scale, enter the following information:​

Scale Creation Data

FieldDescriptionValue
Scale BaseUsed to define the parameters that define the rate and is considered as a dimension of a rate table.Length, Partner, Weight
Scale TypeControls how the scale levels are defined. Indicates where the scale values that were specified depict the upper or lower boundaries for the scale levels.Base scale: from a certain value (>=)
To Scale: up to a certain value (<=)
Same scale: for exactly one value (=)
Scale Unit of MeasureUnit of measure for the scale levels.KG, LB, Day, Mile, KM
Rounding ProfileBefore the system accesses the scale to look up a rate in a rate table, the system rounds the input value based on the rounding profile to determine the right scale level.Round Up/Down to 0.01, 10.00
Calculation TypeYou can specify a calculation type for a scale base, which affects how the system calculates charges with the scale. The available calculation types are absolute and relative. Note that you can specify a relative calculation type for numeric scale bases only.Absolute: This is used for non-numeric scales such as Region, Transportation Zone, and Business Partner.
Relative: This is used for numeric scales such as weight, distance, length.

Scale Examples

This image shows how scales can be created for destination zone, weight, and location.

The figure shows how scales can be created for destination zone, weight, and location.