cancel
Showing results for 
Search instead for 
Did you mean: 

To continue data printing in next line in script

Former Member
0 Kudos

Hello,

Problem area: Script

I have a problem with sizing of data. I want to print description of material in a window but it can not accomodate 40 char in one line, so now I have to take remaning descriprion in next line . How to do it.

I can not reduce the font also.

Please help .. Urgent.

Thanks ,

Madhura

Accepted Solutions (1)

Accepted Solutions (1)

glio_ad
Active Participant
0 Kudos

Hello.

I would do all the pre-processing in the printing program as follows:

assume we have an itab internal table for the main window's line items to print

DATA: BEGIN OF itab OCCURS 0,

matnr(18),

maktx(100), "but only 40 can be displayed in a single row.

END OF itab.

DATA: wa_itab LIKE itab.

DATA: wl_current_tabix LIKE sy-tabix.

DATA: wl_len TYPE i.

itab-maktx = text-001.

APPEND itab.

LOOP AT itab.

wl_len = STRLEN( itab-maktx ).

IF wl_len > 40.

wl_current_tabix = sy-tabix + 1.

CLEAR wa_itab.

MOVE itab-maktx+40 TO wa_itab-maktx.

INSERT wa_itab INTO itab INDEX wl_current_tabix.

CLEAR itab-maktx+40 WITH space.

wl_current_tabix = wl_current_tabix - 1.

MODIFY itab INDEX wl_current_tabix.

ENDIF.

ENDLOOP.

LOOP AT itab.

write:/ itab.

ENDLOOP.

So, in the printing program, you need to "prepare" the internal as if the next line contains only the characters of text you need to print that didn't fit in the previous line.

This code does exactly what you need.

Please reward points.

Regards,

George

Edited by: George Lioumis on Jan 3, 2008 5:29 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank You.