07-16-2008 4:19 AM
Hi friends,
Declarations:
FIELD-SYMBOLS: <f>.
data: len TYPE i,
typ(1),
dec TYPE i.
Statement:
DESCRIBE FIELD <f> LENGTH len TYPE typ DECIMALS dec.
Error:
In Unicode, DESCRIBE LENGTH can only be used with the IN BYTE MODE or in character mode addition.
Thanks,
Vamsykrishna.
07-16-2008 4:26 AM
Hi,
eg:
DATA: text TYPE c LENGTH 1,
blen TYPE i,
clen TYPE i,
bytes TYPE i.
DESCRIBE FIELD text: LENGTH blen IN BYTE MODE,
LENGTH clen IN CHARACTER MODE.
bytes = blen / clen.
If you want the length in bytes give the addition IN BYTE MODE and if you want the characters, give IN CHARACTER MODE.
Regards,
Subramanian
07-16-2008 4:28 AM
Hello Vamsy
Simply speaking Unicode means: 1 Character <> 1 Byte
Unicode characters are either 2 or 4 Bytes large. A SAP Unicode system is a 2-Byte system yet internally characters may be represented by up to 4 Bytes ([ABAP and Unicode: Character Codes|http://help.sap.com/saphelp_nw04/helpdata/en/62/3f2cb0b35311d5993800508b6b8b11/content.htm]).
Conclusion: You need to specify which type of length (IN BYTE MODE or IN TEXT MODE) you want to have because the result is different:
DESCRIBE FIELD <f> LENGTH len TYPE typ DECIMALS dec IN TEXT MODE / IN BYTE MODE.
Regards
Uwe.