DESCRIBE FIELD with unassigned field character

Here is one for you.

Why doesn't the following code fragment end with a short dump GETWA_NOT_ASSIGNED and instead return type C with a length of 2 ?

 FIELD-SYMBOLS: <fs_any> TYPE any. DESCRIBE FIELD <fs_any> TYPE DATA(l_type) LENGTH DATA(l_length) IN BYTE MODE DECIMALS DATA(l_decimals). 

I could not find anything in the ABAP documentation about this behavior.

EDIT:

It seems like a short dump is never expected. I tried this also with

 FIELD-SYMBOLS: <fs_any> TYPE i. 

and

 FIELD-SYMBOLS: <fs_any> TYPE but000. 

so the vwegert answer seems plausible because the declaration of a variable without any type of type DATA: var. defaults to C length 1 .

+6
source share
1 answer

Personal opinion, not supported by documentation: Because DATA foo. implicitly creates the variable TYPE C LENGTH 1 , this is what DESCRIBE FIELD returns in this case. You are probably using the Unicode system - on my system it returns a length of 1. I would say that you caused some kind of undocumented behavior, maybe even an error. I would highly recommend NOT relying on this - I assume that it can be changed at any time.

+5
source

All Articles