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

Problem encountered when using RKD_WORD_WRAP

Former Member
0 Likes
1,047

Hi all,

I have encountered a problem when using RKD_WORD_WRAP. The problem is that the paragraph is not being formatted nicely when i try to printout in Smartforms.

Eg is that I want to format this paragraph;

"Text Conversion: Convert Text Formats

The function module CONVERT_TEXT provides the

following format conversion options:"

However, when I output it out, the text was being displayed like this;

"Text Conversion: Convert Text Formats

The function module CONVERT_TEXT provides

the

following format conversion options:"

The problem is that even though after the "the" word, although that line still has some spaces, thecorresponsing words just wont get concatenate to the 2nd line (as seen above).

Is there any way to fix this?? Or is there a standard value to be use for the outputlens parameter so that the above situation will not occurs??

3 REPLIES 3
Read only

Former Member
0 Likes
750

You can use other FM in order to get perfect functionality :

SWA_STRING_SPLIT -> pass the text and mention line length ,it split the data accordingly.

Thanks

Seshu

Read only

Former Member
0 Likes
750

Hi,

The function module SWA_STRING_SPLIT that you have said is not working successfully. It is still giving me the same problem where it is appending a new line where there is still enough space for the word on the current line.

Read only

0 Likes
750

Check the below program and output :

report ztest_ytt.

data input type string.

data SWASTRTAB like SWASTRTAB occurs 0 with header line.

start-of-selection.

input = 'The function module SWA_STRING_SPLIT that you have said is not

working successfully. It is still giving me the same problem where it is

appending a new line where there is still enough space for the word on

the current line'.

CALL FUNCTION 'SWA_STRING_SPLIT'

EXPORTING

INPUT_STRING = input

MAX_COMPONENT_LENGTH = 100

  • TERMINATING_SEPARATORS =

  • OPENING_SEPARATORS =

TABLES

STRING_COMPONENTS = SWASTRTAB

EXCEPTIONS

MAX_COMPONENT_LENGTH_INVALID = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

loop at SWASTRTAB.

write:/ SWASTRTAB-STR.

endloop.

This is output :

The function module SWA_STRING_SPLIT that you have said is not working successfully. It is still

giving me the same problem where it is appending a new line where there is still enough space for

the word on the current line

Suppose you want to print 100 charcters in each line .. upto 95 charcters you have words perfectly the next will start at 97th ,so here word is <b>' Function'</b>

so this word will not fit into that line since you have 4 charcters,Function word is containg 8 charcters,this word will come in next line.

Check the program and give what ever input and see the results.

Thanks

Seshu