‎2008 May 29 9:49 AM
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
‎2008 May 29 10:01 AM
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
‎2008 Aug 05 2:25 PM