cancel
Showing results for 
Search instead for 
Did you mean: 

Can we wrap up words in Scripts????

Former Member
0 Kudos

Hi All,

I am displaying flowing data under some headings in my script. there is one description field of 40 characters. I have set offset and have split the long entries in two lines. 20 characters in one row and 20 in the next.

Now the problem here I am facing is the word which is at the end of the first twenty characters breaks up sometimes and comes in the socond line. I don't want this.

Is there any way by which we can make the last word come into the second line if it dint reach the end??

So that if it is half printed and twenty characters got over it comes fully in the next line as we use PROTECT ENDPROTECT, to wrap paragraphs.

Example:

This I am now getting :

Code Code Description

SAP System Application and prod

ucts in data processing

This is how I want it :

Code Code Description

SAP System Application and

products in data processing

Any way out????

Thanks a ton!

Navita

Accepted Solutions (1)

Accepted Solutions (1)

former_member181962
Active Contributor
0 Kudos

Hi Navitha,

Do the necessary processing in the driver program itself using the fm:

RKD_WORD_WRAP

Regards,

Ravi Kanth Talagana

Former Member
0 Kudos

Thanks, I'll try this out.

Former Member
0 Kudos

Hi,

Chk out the max length you can accomodate in your window and according to that split the text and then use the same.

Splitting can be done using the FM: TEXT_SPLIT.

Regards,

Narendra.

Former Member
0 Kudos

Thanks for ur reply

Actually text splitting is not the problem, but will that function module take care or the words also, words shudn't get split in between. Please see the example I have shown

Code Description

System Application Prod

ucts in data processing

should come as :

Code Description

System Application

Products in data processing

I'll try with this FM tomorrow

Thanks,

Navita

Former Member
0 Kudos

Hi,

Please go thru the below documentation for the FM : Text_split

The input text is split once in the specified line length word-compatibly. Recognized separators are SPACE and hyphen (-). The hyphen remains in the result, space does not. The result is filled with spaces from the end of the last word until the specified length.

If the separator used (SPACE or '-') is followed by more separators, they are returned as leading separators in REST.

If there is no separator between the second character (separators in the first position in the text are ignored) and the position specified in length LENGTH, the text is split at this position, not word-compatibly, if necessary. In this case the remaining text can have a leading separator even if separators only occur singly.

If the actual value assigned to the formal parameter REST is shorter than the remaining text (trailing spaces are ignored), no exception is raised, the text is truncated.

If the actual value of the formal parameter LINE is shorter than LENGTH, no exception is raised, the split first part of length LENGTH is truncated at LINE. The characters cut off are not returned in REST, which contains the remaining text from the split position.

The calling program should avoid these special cases, i.e. the actual value assigned to the formal parameter LINE should be at least as big as LENGTH.

The actual length of the formal paramter REST should be as big as the length of the text passed.

Regards,

Narendra.

Former Member
0 Kudos

Thanks a lot for this help

I'll try it out tomorrow as I dont have SAP access today

Thanks again,

Navita

Former Member
0 Kudos

Thanks a lot

solved my problem

Answers (1)

Answers (1)

Former Member
0 Kudos

to split the sentence use the FM TEXT_SPLIT

this aoutmatically takes care of words and will push the last word to the next line without breaking it up