cancel
Showing results for 
Search instead for 
Did you mean: 

want to print 4 labels in a page in sap script

Former Member
0 Kudos

I want to print lebel in sap script for material from table makt and mara. i can print one label in one page. But i want to print 4 labels in a page . how i print it?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Atanu,

What does Label mean?

Is it the description of the material?.

If that is the case then the field that you need to print will be MAKTX in the MAKT table.

If you want to print multiple values in a page,then you will have to move the contents from MAKT and MARA tables into an internal table.This can be acheived by using a simple select querry.This select querry has to be written in the print program of the script.

Now in the print program,loop the above internal table and within the loop call the function WRITE_FORM.

For example,if the internal table that you created is ITAB,then the code will be like this:

loop at ITAB.

call function 'WRITE_FORM'

exporting

element = 'LINE_ITEMS.'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

window = 'MAIN'

  • IMPORTING

  • PENDING_LINES = PENDING_LINES

  • EXCEPTIONS

  • ELEMENT = 1

  • FUNCTION = 2

  • TYPE = 3

  • UNOPENED = 4

  • UNSTARTED = 5

  • WINDOW = 6

  • BAD_PAGEFORMAT_FOR_PRINT = 7

  • SPOOL_ERROR = 8

  • CODEPAGE = 9

  • OTHERS = 10

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

endloop.

If you call the function WRITE_FORM within the loop,then all the values will be written in the script one after the other.

Please revert if you have any other querries.

Reward points if usefull.

Regards,

Kashyap Ivaturi

former_member187457
Active Contributor
0 Kudos

wt does lavel means i...didnt get u....

Former Member
0 Kudos

here label means sticker.