cancel
Showing results for 
Search instead for 
Did you mean: 

Spliting continous text

0 Kudos

Hi

Iam having continous text issue in SAP Scripts, Here my problem is iam having contious text which is coming form print progarm its more than 40 lines curently in testing. May be it can more if it goes to production how could i handle this problem.

I want to print only 40 characters per line if exceeds it should continue in next line adn futher.

One more thing here these text is going out of page layout.

Please let me know if any possible solution.

Regards

Bhaskar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can Use below FMs to split your long texts at desired position.

RKD_WORD_WRAP

RSDG_WORD_WRAP

Thanks,

Sree.

0 Kudos

Hi Sree,

This is helpful if we want to split text into three lines here iam having text which i have to fit into layout

is more than 40 lines.

I am thinking it by handling in print program using offset.

Please let me know if you have any idea,,,

cheers

bhaskar

Former Member
0 Kudos

Hi,

try with below code.

TYPES: BEGIN OF type_lines.

INCLUDE STRUCTURE tline.

TYPES: END OF type_lines.

DATA: tline TYPE STANDARD TABLE OF tline,

wa_tline TYPE type_lines.

DATA: lv_string TYPE string,

lv_text TYPE text65,

lv_length TYPE i.

lv_string =

'textttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt

tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt

tttttttttttttttttttt'.

WHILE lv_string IS NOT INITIAL.

lv_length = 64.----


yout required length

lv_text = lv_string.

WHILE lv_text+lv_length(1) NE space AND lv_length GE 0.

lv_text = lv_text(lv_length).

lv_length = lv_length - 1.

ENDWHILE.

IF lv_length GE 0.

MOVE lv_text TO wa_tline-tdline.

APPEND wa_tline TO tline.

CLEAR wa_tline.

CLEAR lv_text.

ENDIF.

lv_length = lv_length + 1.

SHIFT lv_string LEFT BY lv_length PLACES.

ENDWHILE.

LOOP AT tline INTO wa_tline.

WRITE:/ wa_tline-tdline.

ENDLOOP.

Thanks,

Sree.

Answers (2)

Answers (2)

Former Member
0 Kudos

get itab with splitted text as others mentioned befor

define entry point ->loop at itab-> fil global data ->call entry point via write_form->print global variable

Regards

Stefan Seeburger

Former Member
0 Kudos

use below f.m itself....

RKD_WORD_WRAP----->

if u pass the text in f.m

total length of textline is 35 if i use f.m

exporting.

TEXTLINE = wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

OUTPUTLEN = 10.

then o/p is

wwwwwwwwww

wwwwwwwwww

wwwwwwwwww

wwwww

35 will be splited at 10th position so it is splited into 4 lines.