Ansicht
Dokumentation

MILL_MATH_FRACT_ADJUST - NOTRANSL: Umrechnungsfaktor für vorgegebene dezimale Mengenrasterung näher

MILL_MATH_FRACT_ADJUST - NOTRANSL: Umrechnungsfaktor für vorgegebene dezimale Mengenrasterung näher

TXBHW - Original Tax Base Amount in Local Currency   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

The quantity raster is used so that only values that can be uniquely converted into all other units of measure are permitted for quantities in different units of measure. The quantity raster specifies the increment for all units of measure. Use of the quantity raster means rounding errors no longer occur.

Only quantities that are within this quantity raster, i.e. are a whole number multiple of the determined increment per unit of measure, can be processed consistently.

For certain conversion factors, an increment may arise that no longer allows the system to post by piece, for example. In this case, an approximation of the conversion factors is needed so that the increment is small enough.

With this function, the conversion factors are approximated so that all quantities can be displayed with the available decimal places with any increment that can be specified, without the increment becoming larger.

When selecting the increment in the base unit of measure, it is necessary to differentiate between the following cases:

  • PC is the base unit of measure: increment = 1 (trivial).
  • PC is an alternative unit of measure: The increment is the quantity in the base unit of measure per piece. If a piece is to split up into smaller parts (partial quantities) later (e.g. cutting of a cable), the increment still needs to be set as though PC was not a unit of measure used.
  • If PC is not a unit of measure that is used, an increment in the smallest displayable quantity in the base unit of measure is usually required (e.g. with 3 decimal places 0.001 ).

If the increment is to be convertible into physical alternative units of measure (of the same dimensions), the increment in the base unit of measure must be a multiple of the smallest common increment of all of the alternative units of measure of the same dimensions that are to be considered MURC_QUANTITY_CHECK).

If the conversion into physical alternative units of measure (of the same dimensions) is still to be taken into consideration during determination of the quantity raster for the alternative quantities, it is necessary to also specify the increment in the alternative unit of measure during the call. The subsequent use of physical alternative units of measure not planned at the start (in particular, in the case of imperial measurement systems) must be treated as a new definition of an alternative unit of measure with different dimensions.

Example

Base unit of measurement:
KG (3 decimal places)

Alternative unit of measure
PC (0 decimal places)
M  (2 decimal places)

Conversion factors:
7 KG =  5 PC    <=>   1,4    KG/PC
3 KG = 16 M     <=>   0,1875 KG/M

i.e. 1 PC = 7,466666666... M

=> smallest increment in relation to all units of measure (see also MURC_QUANTITY_CHECK)

1,4 * 0,015 / 0,005 KG = 4,2 KG = 3 PC = 22,4 M

Call with
1,4 KG (increment per PC in base unit)
3 / 16 (conversion factor for /)
5      (length of numerator and denominator of conversion factor)
3      (decimal places)

=> Approximated conversion factor for posting by piece

1400 KG = 7467 M   <=>   0,18749163... KG/M
                   <=>   7,467         M /PC

If the quantity M is also to be uniquely converted into IN (inches), the increment in M must be determined as follows and also specified as the factor for the numerator of the conversion factor (

By def.: 127 M = 5000 IN

=> Factor 127 is "increment" for the alternative unit of measure. As a result, the new approximated conversion factor is

1400 KG = 7493 M   <=>   0.18684105... KG/M
                   <=>   7,493         M /PC/>

If the quantities are to be uniquely converted between M, IN and YD (yards), the increment in M must be converted as follows:

By def.: 127 M = 5000 IN
         381 M = 1250 FT

=> The smallest common multiple (scm) of all factors of the alternative unit of measure that the quantity raster relates to is the "increment" across all alternative units of measurement: kgV(127, 381) = 381. As are result there is a new approximated conversion factor

  70 KG =  381 M   <=>   0,18372703... KG/M
                   <=>   7,620         M /PC

Notes

The subsequent definition of additional alternative units of measure would only lead to an increase in the increment if the new conversions are not approximated and a particular combination of prime factors exists (above all the following must apply: all prime factors except 2 and 5 of the numerator ( / ) must be contained in the numerator ( /PC), so that the quantity in the alternative unit of measure is a finite decimal number). If approximation of conversion factors is used, the increment remains the same as when originally defined.

The increment is influenced by the following criteria:

  • Number of alternative units of measure
  • Format of data maintenance for quantities (number of figures in total and number of decimal places in the case of fixed decimal places)
  • Format of data maintenance for conversion factors (for rational conversion factors, the number of characters for numerator and denominator)
  • Value of conversion factors

If the display of quantities shows fewer decimal places than the data maintenance of the quantities, the user cannot see the quantity raster up to a particular multiple of the increment (the "particular multiple" has the same dependencies as the increment - with the exception of the number of alternative units of measure; in addition, there is naturally also a dependency between the number of decimal places for the display and data maintenance).

Geometric interpretation - practical application: good parts processing (e.g. foil industry)

Typically, the following units are used: area in M2 (base unit), number of PC, length in M. The following applies:

area = width x length <=> M2/PC = M2/M x M/PC

This means the area per piece corresponds to the width multiplied by the length per piece. There, the width is a conversion factor, the length is a quantity (length and width are interchangeable in this statement, whereby the important point is that one of the two dimensions is a conversion factor and the other is a quantity).

The equation for the area corresponds exactly to the general equation for the alternative quantity processing:

Quantity in base unit = conversion factor x quantity in alt. unit

Splitting of quantities / conversion factors - practical application: Cutting processing

There are two different cases: cutting the length (quantity) and cutting the width (conversion factor).

  • The first case has already been described above: during definition of the increment in the base unit, you proceed as though PC was not an alternative unit of measure being used. The length can then be split as any multiple of the increment in the alternative unit.
  • The following applies for the second case:
    The denominator of the width must remain the same (all prime factors except 2 and 5 must be contained in the numerator of the length, which remains the same, otherwise the quantity in M2 would have an infinite number of decimal places; the prime factors 2 and 5 cannot be included, as otherwise the quantity in M2 would have more than the permitted decimal places).
    The numerator of the width must still contain all prime factors except 2 and 5 that it had before cutting, as otherwise the new quantity (and the offcut) in M2 would lead to quantities in the alternative unit that with infinite decimal places.

For cutting the width, the function must therefore be called as follows:
- The increment of the length is transferred as the increment in the base unit of measure.
- The inverted increment of the new width is transferred as the conversion factor
- The numerator of the old raster width of the area without the prime factors 2 and 5 is transferred as the factor for the numerator ( MURC_ROUND_FOR_FRACT with the old raster width shifted right to the decimal point delivered the numerator returns all prime factors except 2 and 5). The factor cannot be further enhanced (e.g. by any factors determined by physical alternative units).

Area: 1,4      M2
Width: 1400 / 7467 M2/M = 0,187... M2/M  
Length:  7,467    M

0,1 M should be cut from the width: 0,1 * 7467 -> 747
MURC_ROUND_FOR_FRACT (0,14) -> 7

I_VALUE          = 7,467
I_NUMER          = 7467
I_DENOM          = 747
I_NUM_FACTOR_ALT = 7

O_NUMER          = 7467
O_DENOM          = 749

The new widths are 749/7467 M2/M = 0,1003... M2/M and 651/7467 M2/M = 0,0872... M2/M
The new areas are 0,749 M2 and 0,651 M2. The sum of the new values produces exactly the old value; in addition, the basic conditions regarding the number of decimal places and length of numerator and denominator are met.

Further information





Parameters

I_DECIMALS
I_DENOM
I_FRACT_LENGTH
I_NUMER
I_NUM_FACTOR_ALT
I_VALUE
O_DENOM
O_NUMER

Exceptions

I_DECIMALS_INVALID
I_FRACT_LENGTH_INVALID
I_VALUE_INVALID
OVERFLOW
O_FACTORS_INVALID

Function Group

MILL_MATH

RFUMSV00 - Advance Return for Tax on Sales/Purchases   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 13208 Date: 20240523 Time: 065435     sap01-206 ( 191 ms )