cancel
Showing results for 
Search instead for 
Did you mean: 

Compare CM with CH

Former Member
0 Kudos

Hi experts!!

I have created a 13CM window in smartforms and i want to print a string in it. But if the string is bigger than the line i want to split it and write in another line.

I know strlen returns the length in characters, so how can i do that??

Please help!!

Thank you in advance!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Calculate number of characters one line can hold.

You may do it by actual writing some text and trial and error to determine it, or calculate from Characters per Inch in Ouput Options of Form Attribute.

Example if you have 10.00 Characters per inch, you will get 10 characters per 2.54 CM.

let's say you calculated that 50 characters can be accomodated in a line.

before writing it in window, you may write a code

data : l_char type i.

l_char = STRLEN( variable ).

if l_char > 50.

l_var1 = variable+0(50).

l_var2 = variable+50(50).

else.....

endif.

BTW, if you want any special splitting if variable greater than a line, it's fine, but if it's simply splitting of text, text should automatically wrap if greater than one line !

Regards,

Mohaiyuddin

Edited by: Mohaiyuddin Soniwala on Dec 3, 2008 1:31 PM

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

It will automatically prints in the next line when first line exceeds.

Former Member
0 Kudos

it is possible (i think) to know which font you are using for your text but i don't want to know how to check that out. and as much as you can change the font as much as you have to change your calculation so that doesn't work either. i.e. it is not easy to have a translation between metric size and font size to know how many characters of a string can be used.

normally smartform does automatically wrap the text to the next line when the content is to long.

if you still have to break up your text yourself you can use FM RKD_WORD_WRAP.

Former Member
0 Kudos

hi ,

in ur window where u want to print the string ,, its better to use template ,

as it adjust accordingly...........

reagards,

prashanti

Former Member
0 Kudos

you can use template the string line automatically comes to the second line ..