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

Data Type Length --- Urgent

Former Member
0 Likes
631

Hi,

Can anyone tell me how bits/bytes is one character... Is there any function module to find out the length of a character / string / any other data types in terms of bits/bytes???

Regards

Jiku

5 REPLIES 5
Read only

graghavendra_sharma
Contributor
0 Likes
603

8 bits = 1 byte

To find out the length of string you can use the command STRLEN

Read only

former_member253923
Participant
0 Likes
603

One character is 1 byte. This differs from data type to data type. Packed contains 2 numbers packed into 1 byte. Check out the help on data types. It has some info on this.

Read only

Former Member
0 Likes
603

hi

1 byte = 8 bits.

to find out lenght of a given string then use strlrn function.

for ex: 's1 = 'asdf'

data: i1 type i.

i1 = strlen(s1)

write:/10 i1.

if helpful reward some points.

with regards,

suresh babu aluri.

Read only

oliver
Active Contributor
0 Likes
603

Hi Jiku,

length of a character depends on your system settings, if the system is running on UniCode (2 Byte) or Non UniCode (1 Byte).

Length of a string: http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb33d9358411d1829f0000e829fbfe/frameset.htm

Length of other data type look into DESCRIBE syntax.

Best regards,

ok

Message was edited by:

Oliver Kohl

Read only

Former Member
0 Likes
603

Hi,

8 bits = 1 byte.

data : str(10) value 'Apple',

ln(10).

ln = STRLEN( str ).

write ln.

Regards,

Bhaskar