Application Development 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: 

CL_ABAP_TYPEDESCR -> DESCRIBE_BY_DATA field length is doubled

Former Member
0 Kudos

I have a custom program developed on Non Unicode system, that is using CL_ABAP_TYPEDESCR -> DESCRIBE_BY_DATA to get field lengths of the fields in a structure. The code works perfectly file on Non Unicode system where it is developed, However when the same code is imported on a UNICODE system the field lengths of the fields in the same structure are exactly doubled. Anybody has any idea, why this may be happening?

3 REPLIES 3

markus_doehr2
Active Contributor
0 Kudos

> However when the same code is imported on a UNICODE system the field lengths of the fields in the same structure are exactly doubled. Anybody has any idea, why this may be happening?

Yes - because Unicode uses two bytes to represent ONE character.

Markus

0 Kudos

Hello,

Anybody has a solution how to devide each component length by 2...?

I would appreciate it, because then I can use the right length of the field.

thx

nils_buerckel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

please use CL_ABAP_ELEMDESCR with the attribute OUTPUT_LENGTH in order to get the number of characters.

Best regards,

Nils Buerckel

SAP AG