Application Development 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: 

label printing in sato printer

Former Member
0 Kudos
448

Hello Friends,

I need some information about printing label from sap through sato printer.

I have a requirement to print the labels through smartforms and the output should go to label printer

ie SATO printer.

pls tell me how can we connect sato printer to SAP ??

pls discuss

Regards,

Sunny

7 REPLIES 7

GauthamV
Active Contributor
0 Kudos
181

You can use SPAD transaction to create your own output devices

and attach it to the printer.

Former Member
0 Kudos
181

Hi Sunny,

About SATO printer Goto SPAD and Configure as required,

AND I have Developed a Label Printing program previously,

Look at that and modify accordingly,

SELECT MATNR FROM MARA INTO TABLE IT_MARA

WHERE MATNR IN S_MATNR.

SELECT MATNR FROM MARC INTO TABLE IT_MARC

FOR ALL ENTRIES IN IT_MARA

WHERE MATNR EQ IT_MARA-MATNR AND

LVORM NE 'X'.

SELECT MATNR LGORT LGPBE FROM MARD

INTO TABLE IT_MARD

FOR ALL ENTRIES IN IT_MARC

WHERE MATNR EQ IT_MARC-MATNR AND

WERKS IN S_WERKS AND

LGORT IN S_LGORT AND

LGPBE IN S_LGPBE.

SELECT MATNR LGORT LGPBE FROM MARD

INTO TABLE IT_MARD

FOR ALL ENTRIES IN IT_MARA

WHERE MATNR EQ IT_MARA-MATNR AND

WERKS IN S_WERKS AND

LGORT IN S_LGORT AND

LGPBE IN S_LGPBE.

  • To get the Material Description

IF IT_MARD IS NOT INITIAL.

SELECT MATNR MAKTX FROM MAKT

INTO TABLE IT_MAKT

FOR ALL ENTRIES IN IT_MARD

WHERE MATNR EQ IT_MARD-MATNR AND

SPRAS EQ SY-LANGU.

ENDIF.

LOOP AT IT_MARD INTO WA_MARD.

READ TABLE IT_MAKT INTO WA_MAKT WITH KEY MATNR = WA_MARD-MATNR.

  • To get the Material Class

SELECT SINGLE SCLASS SKLART L~CLINT INTO WA_KLAH

FROM KSSK AS L INNER JOIN KLAH AS S ON SCLINT EQ LCLINT

WHERE L~OBJEK EQ WA_MARD-MATNR AND

( LKLART = 'TEC' OR LKLART = '001').

IF SY-SUBRC EQ 0.

  • To get the Material Class Text

SELECT SINGLE KSCHL FROM SWOR

INTO CORRESPONDING FIELDS OF WA_SWOR

WHERE CLINT EQ WA_KLAH-CLINT AND

SPRAS = SY-LANGU AND

KLPOS = '01'.

MOVE WA_SWOR-KSCHL TO WA_FINAL-TDLINE.

MOVE WA_MARD-MATNR TO WA_FINAL-MATNR.

MOVE WA_MAKT-MAKTX TO WA_FINAL-MAKTX.

MOVE WA_MARD-LGPBE TO WA_FINAL-LGPBE.

MOVE WA_MARD-LGORT TO WA_FINAL-LGORT.

MOVE WA_KLAH-CLASS TO WA_FINAL-CLASS.

APPEND WA_FINAL TO IT_FINAL.

CLEAR : WA_FINAL.

CLEAR : WA_MARD.

ENDLOOP.

PERFORM ALIGN_DATA.

PERFORM WRITE_SCRIPT_DATA.

FORM ALIGN_DATA .

LOOP AT IT_FINAL INTO WA_FINAL.

CNT1 = CNT1 + 1.

ENDLOOP.

IF IT_FINAL IS NOT INITIAL.

LOOP AT IT_FINAL INTO WA_FINAL.

CNT = SY-TABIX MOD 2.

IF CNT EQ 0.

MOVE WA_FINAL-MATNR TO WA_FINAL2-MATNR1.

MOVE WA_FINAL-MAKTX TO WA_FINAL2-MAKTX1.

MOVE WA_FINAL-LGPBE TO WA_FINAL2-LGPBE1.

MOVE WA_FINAL-LGORT TO WA_FINAL2-LGORT1.

MOVE WA_FINAL-CLASS TO WA_FINAL2-CLASS1.

MOVE WA_FINAL-TDLINE TO WA_FINAL2-TDLINE1.

APPEND WA_FINAL2 TO IT_FINAL2.

CLEAR : WA_FINAL2.

ELSE.

MOVE WA_FINAL-MATNR TO WA_FINAL2-MATNR.

MOVE WA_FINAL-MAKTX TO WA_FINAL2-MAKTX.

MOVE WA_FINAL-LGPBE TO WA_FINAL2-LGPBE.

MOVE WA_FINAL-LGORT TO WA_FINAL2-LGORT.

MOVE WA_FINAL-CLASS TO WA_FINAL2-CLASS.

MOVE WA_FINAL-TDLINE TO WA_FINAL2-TDLINE.

ENDIF.

ENDLOOP.

CNT = CNT1 MOD 2.

IF CNT NE 0.

APPEND WA_FINAL2 TO IT_FINAL2.

CLEAR : WA_FINAL2.

ENDIF.

ENDIF.

ENDFORM. " ALIGN_DATA

FORM WRITE_SCRIPT_DATA .

IT_FINAL1 = IT_FINAL2.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

FORM = 'ZMY20_LABEL_1'

LANGUAGE = SY-LANGU.

PERFORM 'WRITE_FORM'.

PERFORM MULTIPLE_PAGE_PRINTING.

CALL FUNCTION 'CLOSE_FORM'.

ENDFORM. " WRITE_SCRIPT_DATA

FORM WRITE_FORM .

CALL FUNCTION 'START_FORM'

EXPORTING

FORM = 'ZMY20_LABEL_1'

LANGUAGE = SY-LANGU

STARTPAGE = 'PAGE1'.

IF NOT IT_FINAL1 IS INITIAL.

CLEAR : WA_FINAL1.

LOOP AT IT_FINAL1 INTO WA_FINAL1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'ELEMENT1'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'.

DELETE TABLE IT_FINAL1 FROM WA_FINAL1.

EXIT.

ENDLOOP.

ENDIF.

IF NOT IT_FINAL1 IS INITIAL.

CLEAR : WA_FINAL1.

LOOP AT IT_FINAL1 INTO WA_FINAL1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'ELEMENT2'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'.

DELETE TABLE IT_FINAL1 FROM WA_FINAL1.

EXIT.

ENDLOOP.

ENDIF.

IF NOT IT_FINAL1 IS INITIAL.

CLEAR : WA_FINAL1.

LOOP AT IT_FINAL1 INTO WA_FINAL1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'ELEMENT3'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'.

DELETE TABLE IT_FINAL1 FROM WA_FINAL1.

EXIT.

ENDLOOP.

ENDIF.

IF NOT IT_FINAL1 IS INITIAL.

CLEAR : WA_FINAL1.

LOOP AT IT_FINAL1 INTO WA_FINAL1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'ELEMENT4'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'.

DELETE TABLE IT_FINAL1 FROM WA_FINAL1.

EXIT.

ENDLOOP.

ENDIF.

CALL FUNCTION 'END_FORM'.

ENDFORM. " WRITE_FORM

Thanks & Regards,

Dileep. C

0 Kudos
181

Hi Sunny,

After Opening SPAD,

give your output device name, (eg like LOCL)

and click on OUTPUT Devices,

now select Device type as you required...

and you can also select the page type. and Tray .........Etc..

Thanks & Regards,

Dileep .C

Former Member
0 Kudos
181

Hi,

It is same as normal printer only. contact with basis team. they will do it.

tcode : spad

i dveloped label printing alread using smartform.

feel free for ask

0 Kudos
181

Thanks for the reply..

May i knw which printer u have used for label printing??

im using device type LB_SAT

0 Kudos
181

hi,

we used zebra printer.

0 Kudos
181

Hi Sunny,

LB_SAT is sato Printer,

All the LB_ series for Label Printing. anyone can be used,

and we used IBM 4400.

Its nothing but just assigning a new printer to a new Output device.

Thanks & regards,

Dileep .C