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

Meaningfull text

Former Member
0 Likes
601

HI Experts,

    I want to display some text based on the user inputs,Question here is i want to display it meaningful way.

For ex, if i gave length as 50, output is displayed with last word splitted and coming to new line, like "PAV" in one line

and "AN" in another line. actual word is PAVAN. so in such case the whole word will print on the next line instead of splitting.

1)split the text based on user input(length)

2)split it meaningfully.

Anyone suggest how to proceed for this.

HI Experts,

    I want to display some text based on the user inputs,Question here is i want to display it meaningful way.

For ex, if i gave length as 50, output is displayed with last word splitted and coming to new line, like "PAV" in one line

and "AN" in another line. actual word is PAVAN. so in such case the whole word will print on the next line instead of splitting.

1)split the text based on user input(length)

2)split it meaningfully.

Anyone suggest how to proceed for this.

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
564

There are some FM easy to find for this requirement. Look from CATSXT_SPLIT_LONGTEXT to SPLIT_TEXTLINE thru SE37 with *SPLIT*TEXT*.

Regards,

Raymond

Read only

Former Member
0 Likes
564

Hi Pavan,


Check below code. It will work.


DATA V_TEXT TYPE STRING.


PARAMETERS V_LENGTH TYPE I.

V_TEXT = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.


START-OF-SELECTION.

   DATA IT_STR TYPE STANDARD TABLE OF STRING.

   CALL FUNCTION 'SOTR_SERV_STRING_TO_TABLE'
     EXPORTING
       TEXT                = V_TEXT
       LINE_LENGTH  = V_LENGTH
       LANGU            = SY-LANGU
     TABLES
       TEXT_TAB        = IT_STR.

You will get line wise splitted sting in IT_STR as a row.


Thanks & Regards,

JP