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

split a string into line

Former Member
0 Likes
475

Hi Gurus,

I want to split a particular string into lines. I have a string concatenate by values separated by semicoloumn.While print this string in smartform have to print into several rows. but I dont know the exctact length of the field concatenated into a string. My requirement is to split the string into lines but each line have to end with semicoloum, that is all values have to end in a particlar line should not continue on a next line.

Foe eg:

Var1 = 'abcdef'

var2 = 'qwert'

var3 = 'asdfghjkl'.

String = var1;var2;var3.

in printform have to print in a line with length 20 means

Output should be in the below format:

line1 - abcedf;qwert;

line2 - asdfghjkl.

Even there is some space in line1 to hold var3, but i want it in a next line.

Thanks in advance.

Reagrds,

Bhuvana.

2 REPLIES 2
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
424

You can use function module rkd_word_wrap function for the same pass output length as 20 and separator as ;.

Nabheet

Read only

Former Member
0 Likes
424

Hi,

Check the below FM's with same functionality

RKD_WORD_WRAP

RSDG_WORD_WRAP

ALVDG_WORD_WRAP

@Nabheet, You are quick and I impressed