Application Development 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: 

how to check the length of a field symbol value

Former Member
0 Kudos
730

hi all,

i have a problem with string function, i have assined table fields to a field symbol in a loop i want check the length of the assigned fields symbol value in every loop . i have written like ,,,,,len = strlen( <fs>). then i am getting the length of the field label what i ahve assigned to fiels symbol not the field value lenght ,

please advise me on this,

thanks,

sre

1 REPLY 1

Former Member
0 Kudos
96

I think you're on the right track. This should work:

data: len type i.

data: begin of itab OCCURS 1,

a type string value '1',

b type string value '12',

c type string value '123',

end of itab.

FIELD-SYMBOLS: <fs> type ANY.

do 3 times.

assign component sy-index of STRUCTURE itab to <fs>.

len = strlen( <fs> ).

enddo.