Skip to Content
-1
May 19, 2020 at 03:33 PM

Size of fields in internal table

137 Views

Hello,

I have a couple of basic question about declaring internal tables and inserting/appending data.

Let's say I work with standard content and have a variable of type 0FISCPER. I declare two tables , each single column, one standard and one sorted:

TYPES: BEGIN OF z_s_fiscper,
        FISCPER TYPE /BI0/OIFISCPER,
       END OF z_s_fiscper.

DATA: l_t_fiscper TYPE TABLE OF /BI0/OIFISCPER,
      l_t_tfiscper TYPE SORTED TABLE OF z_s_fiscper WITH UNIQUE KEY FISCPER,
      l_v_fiscper TYPE /BI0/OIFISCPER.

l_v_fiscper = '2020001'.

APPEND l_v_fiscper TO l_t_fiscper.
"INSERT l_v_fiscper INTO TABLE l_t_tfiscper.

First thing that surprises me a bit is that the size of a field in standard table is twice as long as for undelying data type:

The single table column is (seemingly) 14 digits long ([1x1(14)], while its content (fiscal period) is only 7 digits long. Cannot understand te meaning of it.

Another trouble is that nonetheless appending a line to a standard table works fine, but trying to insert a line into a sorted table of the same size and structure results in compile time error L_V_FISCPER and the row type of "L_T_FISCPER" are incompatible.

Which is strange, as the structure of the sorted table looks pretty much the same:

I am sure the answers are simple and are already included someplace in the Product Assistance, but I currently fail to figure out.

Thank you,

Val

Attachments

tablefieldsize.jpg (39.6 kB)