2007 Jan 15 10:40 AM
Hello all!!
I´m working with type C, and I wonder how can I get, in my program, the length of a variable or a parameter declarated like this:
PARAMETER: chain(10).
I know that its lenght is 10 (max) but I would like to know if there is a way in ABAP to get it dynamically, I mean, in the program.
Thank you very much.
Reyes.
2007 Jan 15 10:43 AM
use describe statement as follows.
data: n type i.
describe field chain length n.
if you want exact length of the content in chain.
then use strlen().
regds,
kiran
Hello all!!
I´m working with type C, and I wonder how can I get, in my program, the length of a variable or a parameter declarated like this:
PARAMETER: chain(10).
I know that its lenght is 10 (max) but I would like to know if there is a way in ABAP to get it dynamically, I mean, in the program.
Thank you very much.
Reyes.
2007 Jan 15 10:43 AM
use describe statement as follows.
data: n type i.
describe field chain length n.
if you want exact length of the content in chain.
then use strlen().
regds,
kiran
2007 Jan 15 10:43 AM
USE <b>STRLEN</b> OPTION
DATA: CHAIN(10) TYPE C VALUE 'ABCDEFGHIJ'.
DATA : LEN TYPE I.
LEN = STRLEN( CHAIN ).
WRITE:/ 'length of chain is', LEN.
regards,
vijay
2007 Jan 15 10:44 AM
Hi Reyes,
check this option:
data len type i.
i = STRLEN( chain ).hope this helps,
Sajan Joseph.
2007 Jan 15 10:56 AM
say ur field has 'ABAP'.
now, V1 = strlen( chain ).
so, V1 returns 4.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |