Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using Literals

Former Member
0 Likes
734

Hi,

We have 4 types of literals in SAP.Character,numeric,floating-point & hexadecimal literals.Can anyone give the examples for floating-point & hexadecimal literals?When and where it is used?

2 REPLIES 2
Read only

former_member212005
Active Contributor
0 Likes
456

Please search before posting these questions...

Anyways...

Floating-point literals are specified within single quotes as '<mantissa>E<exponent>'. The mantissa can be specified with a leading sign and with or without decimal places, and the exponent can be signed or unsigned, with or without leading zeros. For example, '9.99E9', '-10E-32', and '+1E09' are valid floating-point literals.

A hexadecimal literal is specified within single quotes as if it were a character string. The permissible values are 0-9 and A-F. There must be an even number of characters in the string, and all characters must be in uppercase.

Examples of valid hexadecimal literals are '00', 'A2E5', and 'F1F0FF'. Examples of invalid hexadecimal literals are 'a2e5' (contains lowercase characters), '0' (contains an uneven number of characters), "FF" (enclosed in double quotes), and x'00' (should not have a preceding x).

Hexadecimal values are rarely used in ABAP/4, because they are usually machine-dependent. The use of a hexadecimal value that creates machine dependence should be avoided.

Read only

0 Likes
456

Hi Vin,

Thanks for ur reply.I know what u have mentioned.But what i need is example of those types.that is when and where it is used.