SAP Function ABL_MOVE_REQUIRED_LENGTH - Required length for MOVE to a type C target field

Parameter Reference Type Length Default Optional Text
SRCDECS RSEX2IN-DECIMALS I 4 0 X Number of decimal places (type P only)
SRCLEN RSEX2IN-LENGTH I 4 X Internal length of source field
SRCTYPE RSEX2IN-TYPE C 1 ABAP/4 type of source field

Parameter Reference Type Length Text
DESTLEN RSEX2IN-LENGTH I 4 Safe length for a type C target field

Exception Text
ILLEGAL_DECS Invalid number of decimal places
ILLEGAL_LEN Invalid length
ILLEGAL_TYPE Invalid or inconvertible type

Functionality
If you want to use a MOVE statement to move data from a source field toa type C field, this function module calculates the required length ofthe target field so that no data is lost. If the type C field is thenreassigned to the source field, the contents of the source field do notchange.

Example
Applied to the source field type F (float point number), the functionmodule returns 24 as the required length because a floating pointnumber can include 1 leading sign, up to 17 valid digits, 1decimal point, the letter "E", 1 exponential sign and up to 3exponential places.

Notes
The module does not check each time whether the combination of inputvalues makes sense.
If you use this function module to calculate the "safe" target fieldlength for WRITE TO or the output length for WRITE, you should be awareof the following:

  • The maximum output length for WRITE is 255, whereas the target field
  • length for WRITE TO is unrestricted.
    • This function module ignores formatting characters with WRITE or WRITE
    • TO.