Ansicht
Dokumentation

ABENBIT_FUNCTIONS - BIT FUNCTIONS

ABENBIT_FUNCTIONS - BIT FUNCTIONS

PERFORM Short Reference   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

- bit-set

Bit functions process individual bits and return byte-like results. Currently, one bit function is available:

... bit-set( arg ) ...

This built-in function expects an integer numeric value as an argument. The argument is a numeric expression position of the type i.

  • If the argument is positive, the function creates a byte chain in which the bit has the value 1 at the position specified by the argument. All other bits have the value 0. The position is counted from left to right starting with the most significant bit (MSB).
  • If the argument has the value 0, the result is an empty byte chain.
  • If the argument is negative, the function creates a byte chain in which all bits up to and including the place specified by the argument have the value 1 and all bits after this position have the value 0.

The length of the result is the minimum number of bytes needed to include the set bits.

The function can be used in all places where a bit expression can be used, particularly in bit expressions themselves. The same applies to handling the result as to bit expressions. More specifically, during assignment to an inline declaration DATA(var) or FINAL(var), the resulting byte chain is handled like a byte string of data type xstring, and when passing a generic typed formal parameter, it is handled like a byte field of data type x. An empty byte chain defines a generically typed formal parameter as a byte field with a length of 1 and a hexadecimal value of "00".

Notes

  • The function boolx is a bit function in principle, but due to its properties is handled as a logical function.
  • Unlike the statement SET BIT, the result field does not need to be filled first.

Setting Bits






ROGBILLS - Synchronize billing plans   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 3248 Date: 20240420 Time: 040619     sap01-206 ( 51 ms )