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

merging FM

Former Member
0 Likes
433

Hey.

I have an internal table with simple strings in it:

itab[1] = 'test one two three'

itab[2] = 'test one two three four'

itab[3] = 'test one two three four five'

I would like to fill it in a way that consider the words completion, meaning that if my cell length in the new internal table is 30 the new table will like that:

new_itab[1] = 'test one two three test one'

new_itab[2] = 'two three four test one two'

new_itab[3] = 'three four five'

If its length is 40, it'll look like that:

new_itab[1] = 'test one two three test one two three'

new_itab[2] = 'four test one two three four five'

I don't want to use many abap commands but in a FM, does anyone know such one ?

I know that FM HRIQ_GB_UCAS_TEXT_WRAP_AROUND does the opposite.

Thanks in advance,

Rebeka

2 REPLIES 2
Read only

Former Member
0 Likes
401

hi check this..

data: begin of itab occurs 0,

field1(30) type c value 'test one test two test three ',

end of itab ,

begin of itab1 occurs 0,

field2(60) type c value 'test one test two test three test four',

end of itab1 ,

begin of itab2 occurs 0 ,

field3(20) type c value 'test one test two ',

end of itab2 .

data: i type i.

i = strlen( itab-field1 ) .

if i le 30 .

concatenate itab-field1 itab1-field2 into itab1-field2 .

write:/ itab1-field2 .

endif.

regards,

venkat

Read only

Former Member
0 Likes
401

I found the solution