on 03-04-2020 4:42 PM
While declaring a variable( suppose that it is CHARACTER datatype) in the database level, we use 'CHAR', but, in the programming level,we use 'C'.May I know the reason?
For a common understanding:
For database field definitions in ABAP DDIC as well as for variables in ABAP coding, there are data elements that have an assigned domain which have an assigned data type that has an underlying ABAP type. Custom Data elements and domains can be created, whereas data types and ABAP types are predefined. Data elements, domains and data types are part of the DDIC whereas ABAP types are used by the runtime environment.
Your question:
Why is it, that for database fields one either chooses a data element, or a data type, whereas in ABAP coding, one either choses the data element or the internal ABAP type. And more specific: Why can one not choose the internal ABAP type for database fields or why can one not choose the data type in ABAP coding? You could even go further and ask, why can one not choose the domain in either?
For database field definitions, I would assume, that since the available data types in the DB system are different to those in ABAP, there needs to be a mapping anyway, and it made more sense, especially with regards to initial values, to have this mapping based on the data types instead of the ABAP types.
For ABAP programs, the 'help' just states the following:
Here I would assume, that for simplicity reasons, you can either choose a ABAP type, or, if you want to have the 'full power' of the DDIC capabilities, you should go directly to the data element and not have anything in between and not know what capabilities will be available or not, since they come from the combination of all three: data element (e.g. descriptions), domain (e.g. value help), data type (e.g. initial value).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
DDIC (ABAP Dictionary) types are richer than ABAP. In DDIC, you may have types "CHAR", "CLNT", "CUKY", "UNIT" (etc.) which are all characters from ABAP point of view but have special meanings in DDIC.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.