cancel
Showing results for 
Search instead for 
Did you mean: 

Have problem in label printing program while printing continuously

Former Member
0 Kudos

Dear Gurus,

i am working on a label Printing program. my requirement is that to print label as below in one page continuously :

Label 1 Label 2

Label 3 Label 4

Label 5 label 6

.......... ..........

.......... ..........

but i am unable to do , please tell me how to do this . i v already did like this:

Label 1 Label 1

Label 2 Label 2

Label 3 label 3

.......... ..........

.......... ..........

please reply.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Create multiple MAIN windows to correspond to the labels.

MAIN 00 MAIN 01

MAIN 02 MAIN 03

MAIN 04 MAIN 05

When a MAIN window fills it will overflow into the next MAIN. When all are filled it goes to a new page.

Former Member
0 Kudos

not answered

valter_oliveira
Active Contributor
0 Kudos

Imagine you have a list (itab1) with one field only (matnr). To achieve what you need, you must create an itab2, with 2 fields (matnr1 and matnr2).

In your print program do something like:


DATA: l_mod TYPE i,
      l_line TYPE i.
CLEAR: l_mod, l_line.
LOOP AT itab1 INTO wa1.
  ADD 1 TO l_line.
  l_mod = l_line MOD 2.
  IF l_mod NE 0. "position1
    wa2-matnr1 = wa1-matnr.
  ELSE. "position2
    wa2-matnr2 = wa1-matnr.
    APPEND wa2 TO itab2.
    CLEAR wa2.
  ENDIF.
ENDLOOP.

Verify is this code should predict some exceptions (last line or something).

Edit: last line:


...
ENDLOOP.
IF l_mod NE 0. "position1 was not appended
  APPEND wa2 TO itab2.
ENDIF.

Regards.

Valter Oliveira.

Edited by: Valter Oliveira on Sep 11, 2008 1:08 PM