‎2007 Jun 15 3:06 AM
Hi,
does both the statements gives the same results or it depends on anything
DESCRIBE FIELD Itab LENGTH LEN IN byte MODE.
DESCRIBE FIELD Itab LENGTH LEN IN CHARACTER MODE.
thanks
‎2007 Jun 15 3:15 AM
Both are same but only diffrence is DESCRIBE FIELD Itab LENGTH LEN IN CHARACTER MODE. it allows charcter fields
see the below example :
if you use charcter mode ( Internal table should contains all charcters)
tables : mara.
data i_mara like mara occurs 0 with header line.
data v_line type i.
start-of-selection.
select * from mara into table i_mara up to 1000 rows.
DESCRIBE field I_mara LENGTH v_line IN byte MODE.
write v_line.
DESCRIBE FIELD I_mara LENGTH v_line IN CHARACTER MODE.
write v_line.
‎2007 Jun 15 3:15 AM
Both are same but only diffrence is DESCRIBE FIELD Itab LENGTH LEN IN CHARACTER MODE. it allows charcter fields
see the below example :
if you use charcter mode ( Internal table should contains all charcters)
tables : mara.
data i_mara like mara occurs 0 with header line.
data v_line type i.
start-of-selection.
select * from mara into table i_mara up to 1000 rows.
DESCRIBE field I_mara LENGTH v_line IN byte MODE.
write v_line.
DESCRIBE FIELD I_mara LENGTH v_line IN CHARACTER MODE.
write v_line.
‎2007 Jun 15 3:21 AM
hi,
they gave different results. they can somehow give the same in some situation
‎2007 Jun 15 3:32 AM
Hi LEONARD,
I READ SOMEWHERE THAT THEY BOTH WOULD RETURN DIFFERENT VALUES IN SOME CASES.CAN YOU TELL ME IN WHAT CASE THEY WOULD RETURN DIFFERNENT VALUES
THANKS
‎2007 Jun 15 3:45 AM
See the below information :
LENGTH ilen IN { BYTE | CHARACTER } MODE
Effect
The length directly used by the data object dobj in the memory is determined in bytes or characters depending on the addition MODE and is assigned to the data object ilen. The data type i is expected for ilen.
You must specify the addition MODE in Unicode programs. The variant with the addition IN BYTE MODE determines the length of the data object dobj in bytes. The variant with the addition IN CHARACTER MODE determines the length of the data object dobj in characters. When using IN CHARACTER MODE, the data type of dobj must be flat and character-type. You can only specify IN BYTE MODE for deep data types and in this case, the length of the reference (8 bytes) is determined.
In non-Unicode programs and in releases prior to 6.10, LENGTH can be used without the addition MODE. In this case, the addition IN BYTE MODE is used implicitly
Note
For data objects with a fixed length, the length is determined that is specified during the creation of the data object. To determine the the used length of character-type data objects without counting the trailing spaces, you can use the built-in function strlen.
Example
Calculation of bytes required for the display of one character. The result is greater than 1 in multi-byte systems. .
DATA: text(1) TYPE c,
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.
‎2007 Jun 15 2:19 PM
Hi ,
so you mean to to say in 4.6c the describe would assume in BYTE MODE , EVEN THOUGH WE DON'T MENTION EXPLICITILY.
let me know whether my assumption is right or wrong.
In ECC 6.0 , the BYTE and CHARACTER mode differ in deep data types,
what you mean by data types.
Let me know
‎2007 Jun 15 2:43 PM
Hi ,
so you mean to to say in 4.6c the describe would assume in BYTE MODE , EVEN THOUGH WE DON'T MENTION EXPLICITILY.
let me know whether my assumption is right or wrong.
In ECC 6.0 , the BYTE and CHARACTER mode differ in deep data types,
what you mean by data types.
Let me know