Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are there so many "char" types in ABAP when you have "string" type?

In the ABAP Dictionary, you can find data elements of "CHAR" types for almost all lengths, so here goes the question: what functionality have them when you have a string element that can afford all the lengths?

I am talking about those with specific length but having the same domain type.

Here I show some of them:

CHAR0001
CHAR0008
CHAR0010
CHAR0016
CHAR0032
CHAR004
CHAR005
CHAR006
CHAR0064
CHAR007
CHAR01
CHAR011
CHAR012
CHAR0128
CHAR02
CHAR022
CHAR0241
CHAR025
CHAR0256
CHAR03
CHAR04
CHAR05
CHAR060
CHAR07
CHAR08
CHAR101
CHAR102
CHAR1024
...
like image 462
JD0001 Avatar asked Mar 04 '23 07:03

JD0001


1 Answers

You have so many because of many reasons.

  1. String type cannot be used as a primary key in a database (transparent) table.
  2. When using a string type in one of the fields of a structure some implicit operations on the variables of such a structure type will not be possible for example by assignments to other fixed length structure.
  3. By using a string type in a structure type you make it no longer a flat structure.
  4. Some data migration interfaces like Direct Input require the load structure to be of a defined fixed length.

I think there are many more, but this was what I could think of in a short period of time.

like image 72
Jagger Avatar answered Apr 26 '23 23:04

Jagger