Thursday, May 3, 2007

Sample Sapscripts Label Printing Program

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)&

5 comments:

PHP Web Development Company Chennai said...

Its highly informative. I would be visiting your blog hereafter regularly to gather valuable information.
Real Estate Script

Web Design Chennai said...

Hey really I read love your blog… I am really thanks to you to share this informations in internet to my kind of persons… really I loved loved your blog…. I will come back to your blog every updates…
http://www.winwebsolutionz.com

kristinawils said...

Great post and very well written, that will really help you to learn Web Design, web development and SEO Strategies to help businesses web design company . You can find out many useful information about web design, seo and his work by visiting his blog and I Just wanna say thanks you for the information you have shared. Web Design Company India

catharine said...

Hey !!!Genuinely it's really possible to earn money online; I really felt that this website is quite impressive and a great idea to earn hundred's of Dollars daily.
VISIT : http://www.earnglobalmoney.info
www.earnglobalmoney.info

seventyros said...

Excellent Online Resource for SAP EP and SAP Web Dynpro ABAP. Visit Learn SAP Online

Free Certification Material