11-16-2007 9:26 AM
Hi Experts,
How to get length of a data field. For example data field /BIC/0COSTCENTER length is 9. and the entry in the table is /BIC/0COSTCENTER = 1000 only. How to get the lenth of value in the table.
Any help greatly appreciated. Thanks.
Best Regards,
Suresh.
11-16-2007 9:32 AM
11-16-2007 9:32 AM
Hi Suresh,
do like this
data: var type i.
var = strlen(/BIC/0COSTCENTER).
Reward if it helps,
Satish
11-16-2007 9:32 AM
hi,
by using <b>strlen</b>, you can get the length, As per my knowledge
regards,
pavan
11-16-2007 9:32 AM
Hi
use the ABAP function/command to get the length of a string
<b>STRLEN</b>
Regards
anji
11-16-2007 10:00 AM
11-16-2007 10:05 AM
Below is example code
Data: var1(10) type c value '2500',
var2 type i.
var2 = Strlen( var1 ).
write var2.
<b>Reward Points for helpful answers</b>
Satish
08-31-2020 8:12 AM
data: lv_matnr type matnr, " this could be 18 or 40 characters
lv_len type i.
START-OF-SELECTION.
lv_matnr = '1234'.
DESCRIBE FIELD lv_matnr length lv_len In CHARACTER MODE
write:/ 'length', lv len. " this will be 18 or 40
lv_len = strlen( lv_matnr ).
write:/ 'strlen' , lv_len. " this will give 4