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

Truncating chracaters

Former Member
0 Likes
401

Hi,

I am getting data in one of the line of internal table which is greater than ceratin say 50 characters.

If that data is greater than 50 characters then I want to truncate remaining charaters after 50.

How do I do it ?

Hi,

I am getting data in one of the line of internal table which is greater than ceratin say 50 characters.

If that data is greater than 50 characters then I want to truncate remaining charaters after 50.

How do I do it ?

2 REPLIES 2
Read only

Former Member
0 Likes
383

That is easy. While populating data you can handle taht.

ITAB-STRING = G_STRING+0(50).

Here ITAB-STRING is your internal table field which is 50 characters long.

G_STRING is actual string which can have any length.

Read only

Former Member
0 Likes
383

hi Tushar ,

you can do this,

Loop at itab into wa.

len = strlen ( wa-string1 ).

if len gt 50.

wa-string1 = wa-string1+(50).

modify table itab from wa transporting string1.

endif.

endloop.

regards

satesh