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

line break issue

Former Member
0 Likes
706

Hi,

I am adding long texts to few documents using function modules. The function module structure field takes 32 char. when I am tried to update the long texts, it breaks in the middle of a word.For example:

suppose my text is "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. They have commit to use Calibre but they hesitate to introduce ccccccccccccccccccccccccccccc"

it updates as:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. They have commit to use Calibre but they hesitate to i

ntroduce ccccccccccccccccccccccccccccc

Because the 132 character finishes at "i" and hence the word introduce breaks in middle.

Is there any way to concatenate the word so that the word will be complete and will break from the next.

Thanks.

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
654

Check this code snippet:

DATA: v_char(400) TYPE c.

v_char =
`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
& `xxxxxx. They have commit to use Calibre but they hesitate to `
& ` introduce ccccccccccccccccccccccccccccc`.

WRITE: v_char.

DATA: it_132 TYPE STANDARD TABLE OF tdline,
      v_132 TYPE tdline.

CALL FUNCTION 'RKD_WORD_WRAP'
  EXPORTING
    textline            = v_char
    outputlen           = 132
  TABLES
    out_lines           = it_132
  EXCEPTIONS
    outputlen_too_large = 1
    OTHERS              = 2.
IF sy-subrc = 0.
  LOOP AT it_132 INTO v_132.
    WRITE : / v_132.
  ENDLOOP.
ENDIF.

Hope this helps.

BR,

Suhas

Check this code snippet:

DATA: v_char(400) TYPE c.

v_char =
`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
& `xxxxxx. They have commit to use Calibre but they hesitate to `
& ` introduce ccccccccccccccccccccccccccccc`.

WRITE: v_char.

DATA: it_132 TYPE STANDARD TABLE OF tdline,
      v_132 TYPE tdline.

CALL FUNCTION 'RKD_WORD_WRAP'
  EXPORTING
    textline            = v_char
    outputlen           = 132
  TABLES
    out_lines           = it_132
  EXCEPTIONS
    outputlen_too_large = 1
    OTHERS              = 2.
IF sy-subrc = 0.
  LOOP AT it_132 INTO v_132.
    WRITE : / v_132.
  ENDLOOP.
ENDIF.

Hope this helps.

BR,

Suhas

1 REPLY 1
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
655

Check this code snippet:

DATA: v_char(400) TYPE c.

v_char =
`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
& `xxxxxx. They have commit to use Calibre but they hesitate to `
& ` introduce ccccccccccccccccccccccccccccc`.

WRITE: v_char.

DATA: it_132 TYPE STANDARD TABLE OF tdline,
      v_132 TYPE tdline.

CALL FUNCTION 'RKD_WORD_WRAP'
  EXPORTING
    textline            = v_char
    outputlen           = 132
  TABLES
    out_lines           = it_132
  EXCEPTIONS
    outputlen_too_large = 1
    OTHERS              = 2.
IF sy-subrc = 0.
  LOOP AT it_132 INTO v_132.
    WRITE : / v_132.
  ENDLOOP.
ENDIF.

Hope this helps.

BR,

Suhas