Application Development and Automation 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: 
Read only

DESCRIBE statement

Former Member
0 Likes
1,288

Dear all,

I m simply trying to get the length of a variable and written the following code.


DATA : var(20) type c,
       len type i.
       
       
 describe field var length len.
 
 write : /len.

But it giving an error : In Unicode DESCRIBE length can only be used with the IN BYTE MODE or IN CHARACTER MODE addition.

Can any one suggest some solution.

Regards,

Maverick

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,206

Hi

Add that extra in the Statement IN CHARACTER MODE or IN BYTE MODE

For more info Please take F1 help

Cheers

Ram

Edited by: Ramchander Krishnamraju on Oct 21, 2009 8:09 AM

12 REPLIES 12
Read only

Former Member
0 Likes
1,207

Hi

Add that extra in the Statement IN CHARACTER MODE or IN BYTE MODE

For more info Please take F1 help

Cheers

Ram

Edited by: Ramchander Krishnamraju on Oct 21, 2009 8:09 AM

Read only

former_member222860
Active Contributor
0 Likes
1,206

Tried F1 ?

DATA : var(20) type c,
       len type i.

describe field var length len IN CHARACTER MODE.

write:/ len.

Read only

Former Member
0 Likes
1,206

else try with this as well

assign the char variable to string variable and use

gv_len = strlen ( string_name )

cheers

s.janagar

Read only

sachin_jadhav8
Participant
0 Likes
1,206

Hi,

Just try this ,

DATA : var(20) type c,

len type i.

describe field var length len.

write : / len.

Click On Goto - Attribute - Uncheck Unicode checks active check box say Save

Come back in programme & activate it.

Reagrds ,

SACHIN

Read only

sachin_jadhav8
Participant
0 Likes
1,206

Hi,

Just try this ,

DATA : var(20) type c,

len type i.

describe field var length len.

write : / len.

Click On Goto - Attribute - Uncheck Unicode checks active check box say Save

Come back in programme & activate it.

Reagrds ,

SACHIN

Read only

sachin_jadhav8
Participant
0 Likes
1,206

Hi,

Just try this ,

DATA : var(20) type c,

len type i.

describe field var length len.

write : / len.

Click On Goto - Attribute - Uncheck Unicode checks active check box say Save

Come back in programme & activate it.

Reagrds ,

SACHIN

Read only

sachin_jadhav8
Participant
0 Likes
1,206

Hi,

Just try this ,

DATA : var(20) type c,

len type i.

describe field var length len.

write : / len.

Click On Goto - Attribute - Uncheck Unicode checks active check box say Save

Come back in programme & activate it.

Reagrds ,

SACHIN

Read only

Former Member
0 Likes
1,206

The error message clearly tells you to add either the IN BYTE MODE or IN CHARACTER MODE addition. What else is the issue you are facing here?

Read only

Former Member
0 Likes
1,206

Describe is used to describe length of a field & how many number of lines for an internal table.

in case of field we have to provide in which format we have to read i.e. Character or Binary

in case of Internal Table no need to provide these things it will directly write number of lines to our field type integer.

*For Field

DESCRIBE FIELD dobj LENGTH ilen IN {BYTE|CHARACTER} MODE .

for more information go to F1 help

*For Internal Table

data:ivbap type standard table of <any table>,

da_tfill type i.

describe table ivbap lines da_tfill

Read only

Former Member
0 Likes
1,206

HI,

Rewrite your code as

DATA : var(20) type c,
       blen type i,
       clen type i.



 describe field var length blen in byte mode.

 describe field var length clen in character mode.

 write : blen , clen.

here blen will give you the length in byte mode and clen in character mode.

Regards,

Anirban

Read only

Former Member
0 Likes
1,206

Hi Maverick,

try this code.

DATA : var(20) type c,

len type i .

field-symbols <g1> type any.

assign var to <g1>.

describe field <g1> length len in CHARACTER MODE.

write : /' length :', len.

from kallam.

Read only

Former Member
0 Likes
1,206

Hi Maverick

I am facing the same problem as you had encountered. May you share with me which is the correct syntax to use for DESCRIBE?

Thank you very much.

Regards

Kang Ring