‎2007 Jul 07 9:13 AM
hi can any please know , what is labels & why we are using it in Scripts?
‎2007 Jul 07 9:22 AM
Hi Raman,
We use it to create bar code labels.
To create labels in SAPSCRIPT, you will have to define multiple MAIN WINDOWS in the Page Window.. try the following steps..
Main windows in page windows allow you to format text in multiple columns. Define an area in the page window, in which to position the main windows.
1. Create a page window and assign it to a page.
2. Choose Edit --> Main windows.
A dialog box appears.
3. Enter values in the fields Area width and Area height in accordance with the input guidelines for main windows.
4. Enter values in the fields Spacing and Number in the Horizontal group if you want to use multiple columns. You can ignore the fields in the Vertical group.
5. Determine how many columns and line areas are required for label printing. Then enter the corresponding values in the fields in the Horizontal and Vertical groups.
Reward if useful.
Regards
Aneesh.
‎2007 Jul 07 11:19 AM
Hi
You design the layout in SE71 and write the ZPL Command(Zebra Printer ) inur program or layout .
Label size would be 4/6,3/3,3/5 and so on and it will have bar coding also.
TABLES : ZPACK,ZTRN.
DATA: BEGIN OF ITAB OCCURS 0,
ZPKSLIP_NO LIKE ZTRN-ZPKSLIP_NO,
ZCARTON_NO LIKE ZPACK-ZCARTON_NO,
END OF ITAB.
DATA MVAR(12) TYPE C.
DATA MCTR(6) TYPE C.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: ZSLIP FOR ZTRN-ZPKSLIP_NO NO-EXTENSION NO INTERVALS
OBLIGATORY default 6.
SELECTION-SCREEN END OF BLOCK B1.
SELECT * FROM ZPACK INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE
ZPKSLIP_NO EQ ZSLIP-LOW .
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZTEST_RAJ'.
DO 4 TIMES.
MCTR = 100000 + SY-INDEX.
MCTR = MCTR+1(5).
CONCATENATE '55C/06/' MCTR INTO MVAR.
DO 80 TIMES.
ITAB-ZPKSLIP_NO = MVAR.
ITAB-ZCARTON_NO = SY-INDEX.
APPEND ITAB.
CLEAR ITAB.
ENDDO.
ENDDO.
SORT ITAB BY ZPKSLIP_NO ZCARTON_NO.
CALL FUNCTION 'START_FORM'
EXPORTING
FORM = 'ZTEST_RAJ'.
LOOP AT ITAB.
AT NEW ZPKSLIP_NO.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = '101'
WINDOW = 'MAIN'.
ENDAT.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = '102'
WINDOW = 'MAIN'.
AT END OF ZPKSLIP_NO.
CALL FUNCTION 'END_FORM'.
CALL FUNCTION 'START_FORM'
EXPORTING
FORM = 'ZTEST_RAJ'.
ENDAT.
ENDLOOP.
CALL FUNCTION 'END_FORM'.
CALL FUNCTION 'CLOSE_FORM'.
In sap script write :
/E 101
P1 ,,&ITAB-ZPKSLIP_NO(R)&
P1
/E 102
P1 ,,&ITAB-ZCARTON_NO(R)&
Reward all helpfull answers
Regards
Pavan
‎2007 Jul 07 11:22 AM