Totals in Main Window

Hi All,
I want to display the totals of cases,eaches and weight in the last page of the main window.
I am using Bottom and Endbottom to display the totals.
I am using the following code in the main window.
IF &page& eq &sapscript-formpages&
Bottom
Endbottom.
ENDIF
But the total is printing on each page of the main window.
It displays the total for that page and adds that amount to the next items on the next page and display the totals.
I want the whole sum of all the items to be displayed in last page main window.
I also tried using &nextpage& eq 0
Please solve my answer.
Thanks

Thanks for your reply. Here is the code if the line editor.
SFORMZMTOCOLL02
HFORMZMTOCOLL02
OLANE
HEADFORM      ZMTOCOLL02      SAP                                                   DEF EPrint transfer order list                         ZMTOCOLL02              00029AGANGULY    46C 20041220120018RCHALASA    640 2006103116381413200072 E0                                                                                100
LINE/:FORM CPI 10; LPI 6; TAB-STOP 1 CH; START-PAGE FIRST;
LINE/:FORM FORMAT LETTER LANDSCAPE; PARAGRAPH L; RDI; RDIDEV;
LINE/:PARAGRAPH B ALIGN BLOCK; LINE-SPACE 1 LN; FONT-SIZE 28;
LINE/:PARAGRAPH L LINE-SPACE 1 LN;
LINE/:PARAGRAPH L0 LINE-SPACE 0.80 LN;
LINE/:PARAGRAPH L1 LINE-SPACE 1 LN;
LINE/:PARAGRAPH L2 LINE-SPACE 1 LN;
LINE/:PARAGRAPH L3 LINE-SPACE 0.80 LN;
LINE/:PARAGRAPH L4 LINE-SPACE 1 LN;
LINE/:PARAGRAPH L5 LINE-SPACE 1 LN;
LINE/:PARAGRAPH L6 LINE-SPACE 1 LN;
LINE/:PARAGRAPH L8 LINE-SPACE 1 LN;
LINE/:PARAGRAPH L9 LINE-SPACE 1 LN;
LINE/:PARAGRAPH LC LINE-SPACE 0.80 LN;
LINE/:PARAGRAPH LH LINE-SPACE 1 LN;
LINE/:PARAGRAPH LT LINE-SPACE 0.80 LN;
LINE/:PARAGRAPH LV LINE-SPACE 1 LN;
LINE/:PARAGRAPH LX LINE-SPACE 0.80 LN;
LINE/:PARAGRAPH L TAB 1 36 CH LEFT;
LINE/:PARAGRAPH L0 TAB 1 1 CH LEFT; TAB 2 16 CH LEFT; TAB 3 46 CH CENTER;
LINE/:PARAGRAPH L0 TAB 4 57 CH CENTER; TAB 5 62 CH LEFT; TAB 6 65 CH LEFT;
LINE/:PARAGRAPH L0 TAB 7 72 CH LEFT; TAB 8 96 CH RIGHT; TAB 9 100 CH CENTER;
LINE/:PARAGRAPH L1 TAB 1 38 CH LEFT; TAB 2 75 CH LEFT; TAB 3 90 CH LEFT;
LINE/:PARAGRAPH L2 TAB 1 40 CH LEFT; TAB 2 90 CM LEFT;
LINE/:PARAGRAPH L3 TAB 1 1 CH LEFT; TAB 2 16 CH LEFT; TAB 3 46 CH CENTER;
LINE/:PARAGRAPH L3 TAB 4 57 CH CENTER; TAB 5 62 CH LEFT; TAB 6 65 CH LEFT;
LINE/:PARAGRAPH L3 TAB 7 77 CH CENTER; TAB 8 91 CH CENTER; TAB 9 100 CH CENTER;
LINE/:PARAGRAPH L4 TAB 1 5 CH LEFT;
LINE/:PARAGRAPH L5 TAB 1 40 CH LEFT; TAB 2 42 CH LEFT; TAB 3 46 CH LEFT;
LINE/:PARAGRAPH L5 TAB 4 57 CH LEFT;
LINE/:PARAGRAPH L6 TAB 1 5 CH LEFT; TAB 2 7 CH LEFT; TAB 3 40 CH LEFT;
LINE/:PARAGRAPH L6 TAB 4 42 CH LEFT; TAB 5 46 CH LEFT; TAB 6 57 CH LEFT;
LINE/:PARAGRAPH L6 TAB 7 75 CH LEFT;
LINE/:PARAGRAPH L8 TAB 1 20 CH LEFT; TAB 2 42 CH LEFT; TAB 3 55 CH LEFT;
LINE/:PARAGRAPH L9 TAB 1 20 CH LEFT;
LINE/:PARAGRAPH LC TAB 1 1 CH LEFT; TAB 2 15 CH LEFT; TAB 3 30 CH LEFT;
LINE/:PARAGRAPH LC TAB 4 56 CH LEFT; TAB 5 74 CH CENTER; TAB 6 83 CH CENTER;
LINE/:PARAGRAPH LC TAB 7 90 CH CENTER; TAB 8 97 CH CENTER; TAB 9 101 CH CENTER;
LINE/:PARAGRAPH LH TAB 1 18 CH LEFT; TAB 2 26 CH LEFT; TAB 3 31 CH LEFT;
LINE/:PARAGRAPH LT TAB 1 1 CH LEFT; TAB 2 15 CH LEFT; TAB 3 30 CH LEFT;
LINE/:PARAGRAPH LT TAB 4 56 CH LEFT; TAB 5 74 CH CENTER; TAB 6 83 CH CENTER;
LINE/:PARAGRAPH LT TAB 7 90 CH CENTER; TAB 8 97 CH CENTER; TAB 9 101 CH CENTER;
LINE/:PARAGRAPH LV TAB 1 3 CH LEFT; TAB 2 23 CH LEFT; TAB 3 34 CH LEFT;
LINE/:PARAGRAPH LV TAB 4 55 CH LEFT;
LINE/:PARAGRAPH LX TAB 1 1 CH LEFT; TAB 2 16 CH LEFT; TAB 3 46 CH CENTER;
LINE/:PARAGRAPH LX TAB 4 57 CH CENTER; TAB 5 62 CH LEFT; TAB 6 65 CH LEFT;
LINE/:PARAGRAPH LX TAB 7 72 CH LEFT; TAB 8 96 CH RIGHT; TAB 9 100 CH CENTER;
LINE/:STRING B BOLD ON;
LINE/:STRING BC FONT COURIER; FONT-SIZE 12; ULINE ON; MARK OFF; BARCODE BC_EANH;
LINE/:STRING BD FONT COURIER; FONT-SIZE 72; ULINE ON; MARK OFF; BARCODE ZBC_EANH;
LINE/:STRING H BOLD ON;
LINE/:STRING HD FONT COURIER; FONT-SIZE 14; BOLD ON;
LINE/:STRING U ULINE ON;
LINE/:WINDOW CUST_WIN TYPE VAR;
LINE/:WINDOW DETAIL_A TYPE CONST;
LINE/:WINDOW DETAIL_F TYPE CONST;
LINE/:WINDOW FUSS TYPE VAR;
LINE/:WINDOW KOPF TYPE VAR;
LINE/:WINDOW LAST_3 TYPE VAR;
LINE/:WINDOW MAIN
LINE/:WINDOW PICKLOC TYPE VAR;
LINE/:WINDOW SHP_INST TYPE VAR;
LINE/:PAGE FIRST NEXT FIRST;
LINE/:PAGE FIRST MAIN 0 1.97 CH 7.70 CM 27 CM 21.97 LN;
LINE/:PAGE FIRST WINDOW CUST_WIN 10 CM 3 CM 11 CM 2 CM;
LINE/:PAGE FIRST WINDOW DETAIL_A 1.97 CH 6 CM 27 CM 4 LN;
LINE/:PAGE FIRST WINDOW DETAIL_F 1.97 CH 6 CM 27 CM 26.69 LN;
LINE/:PAGE FIRST WINDOW FUSS 78.74 CH 40.87 LN 28.74 CH 8.27 LN;
LINE/:PAGE FIRST WINDOW KOPF 1.97 CH 0.94 LN 27 CM 12.76 LN;
LINE/:PAGE FIRST WINDOW LAST_3 24 MM 14 MM 29 MM 15 MM;
LINE/:PAGE FIRST WINDOW PICKLOC 19 CM 0.50 CM 7 CM 5 CM;
LINE/:PAGE FIRST WINDOW SHP_INST 1.97 CH 40.87 LN 76 CH 8.27 LN;
END
HEADFORM      ZMTOCOLL02      SAP                                                   TXT EPrint transfer order list                         ZMTOCOLL02              00029AGANGULY    46C 20041220120018RCHALASA    640 2006103116381413200468 E0                                                                                100
LINE/:FORM TEXT 'Print transfer order list';
LINE/:PARAGRAPH B TEXT 'Paragr.blocked';
LINE/:PARAGRAPH L TEXT 'Paragr.flush left';
LINE/:PARAGRAPH L0 TEXT 'Flush left 1st item line';
LINE/:PARAGRAPH L1 TEXT 'Flush left header 1st line';
LINE/:PARAGRAPH L2 TEXT 'Flush left bar code';
LINE/:PARAGRAPH L3 TEXT 'Flush left 1st item line';
LINE/:PARAGRAPH L4 TEXT 'Flush left heading 2';
LINE/:PARAGRAPH L5 TEXT 'Flush left 2nd item line';
LINE/:PARAGRAPH L6 TEXT 'Flush left 3rd item line';
LINE/:PARAGRAPH L8 TEXT 'Paragr.footer line';
LINE/:PARAGRAPH L9 TEXT 'Paragr."Repeat Print"';
LINE/:PARAGRAPH LC TEXT 'Line Item heading';
LINE/:PARAGRAPH LH TEXT 'Header data HU elements';
LINE/:PARAGRAPH LT TEXT 'Line Item heading-2nd line';
LINE/:PARAGRAPH LV TEXT 'Data of packaging';
LINE/:PARAGRAPH LX TEXT 'Flush left 1st item line';
LINE/:STRING B TEXT 'Bold';
LINE/:STRING BC TEXT 'Bar code EAN-128';
LINE/:STRING BD TEXT 'Bar code EAN-128 22 mm';
LINE/:STRING H TEXT 'Character sequence highlighted';
LINE/:STRING HD TEXT 'Form Heading';
LINE/:STRING U TEXT 'Character sequence underlined';
LINE/:WINDOW CUST_WIN TEXT 'Customer Window';
LINE/:WINDOW DETAIL_A TEXT 'Detail headers';
LINE/:WINDOW DETAIL_F TEXT 'Detail Box Frame';
LINE/:WINDOW FUSS TEXT 'Footer text';
LINE/:WINDOW KOPF TEXT 'List header';
LINE/:WINDOW LAST_3 TEXT 'Last_3';
LINE/:WINDOW MAIN TEXT 'Main window';
LINE/:WINDOW PICKLOC TEXT 'Pick Location Barcode';
LINE/:WINDOW SHP_INST TEXT 'Shipping Instructions';
LINE/:PAGE FIRST TEXT 'First page';
LINE/WDETAIL_A
LINELC,,Storage,,<B>Material No.</>,,Material Description,,Batch,,Target Qty,,
LINE= UOM,,T.O. #,,,,STYPE
LINELC,,Bin,,NDC,,,,SLED,,Cases,,,,
LINE/*
LINE/*
LINE/*,,<b>Material No.</>,,Material Description,,Batch,,S.Item,,,,STYPE,,
LINE/*Storage,,Target Qty.,,UOM
LINE/*,,NDC,,,,SLED,,Stk.Cat.,,,,,,Bin,,Cases
LINE/WDETAIL_F
LINE/:BOX HEIGHT '1.7' LN
LINE/*The top line
LINE/:POSITION PAGE
LINE/:POSITION XORIGIN '2.0' CH YORIGIN '13.5' LN
LINE/:SIZE WIDTH '104' CH HEIGHT '0' LN
LINE/:BOX FRAME 10 TW
LINE/*
LINE/:POSITION PAGE
LINE/:POSITION XORIGIN '2.0' CH YORIGIN '17' LN
LINE/:SIZE WIDTH '104.0' CH HEIGHT '0' LN
LINE/:BOX FRAME 10 TW
LINE/*The bottom line
LINE/:POSITION PAGE
LINE/:POSITION XORIGIN '2.0' CH YORIGIN '40' LN
LINE/:SIZE WIDTH '104' CH HEIGHT '0' LN
LINE/:BOX FRAME 10 TW
LINE/*
LINE/*The 1st vertical line
LINE/:POSITION PAGE
LINE/:POSITION XORIGIN '2.0' CH YORIGIN '13.50' LN
LINE/:SIZE WIDTH '0' CH HEIGHT '26.5' LN
LINE/:BOX FRAME 10 TW
LINE/*
LINE/*The 2nd vertical line
LINE/:POSITION PAGE
LINE/:POSITION XORIGIN '15.0' CH YORIGIN '13.50' LN
LINE/:SIZE WIDTH '0' CH HEIGHT '26.5' LN
LINE/:BOX FRAME 10 TW
LINE/*
LINE/*The 3nd vertical line
LINE/:POSITION PAGE
LINE/:POSITION XORIGIN '30.0' CH YORIGIN '13.50' LN
LINE/:SIZE WIDTH '0' CH HEIGHT '26.5' LN
LINE/:BOX FRAME 10 TW
LINE*
LINE/*The 4th vertical line
LINE/:POSITION PAGE
LINE/:POSITION XORIGIN '57.0' CH YORIGIN '13.50' LN
LINE/:SIZE WIDTH '0' CH HEIGHT '26.5' LN
LINE/:BOX FRAME 10 TW
LINE/*
LINE/*The 5th vertical line
LINE/:POSITION PAGE
LINE/:POSITION XORIGIN '69.0' CH YORIGIN '13.50' LN
LINE/:SIZE WIDTH '0' CH HEIGHT '26.5' LN
LINE/:BOX FRAME 10 TW
LINE/*
LINE/*The 6th vertical line
LINE/:POSITION PAGE
LINE/:POSITION XORIGIN '82.0' CH YORIGIN '13.50' LN
LINE/:SIZE WIDTH '0' CH HEIGHT '26.5' LN
LINE/:BOX FRAME 10 TW
LINE/*
LINE/*The 7th vertical line
LINE/:POSITION PAGE
LINE/:POSITION XORIGIN '88.00' CH YORIGIN '13.50' LN
LINE/:SIZE WIDTH '0' CH HEIGHT '26.5' LN
LINE/:BOX FRAME 10 TW
LINE*
LINE/*The 8th vertical line
LINE/:POSITION PAGE
LINE/:POSITION XORIGIN '100.00' CH YORIGIN '13.5' LN
LINE/:SIZE WIDTH '0' CH HEIGHT '26.5' LN
LINE/:BOX FRAME 10 TW
LINE*
LINE/*The 9th vertical line
LINE/:POSITION PAGE
LINE/:POSITION XORIGIN '106.00' CH YORIGIN '13.5' LN
LINE/:SIZE WIDTH '0' CH HEIGHT '26.5' LN
LINE/:BOX FRAME 10 TW
LINE*
LINE/WCUST_WIN
LINE/:DEFINE &W_NLPLA& = &LTAP-NLPLA&
LINE/:DEFINE &W_NAME1& := ' '
LINE/:DEFINE &W_NAME2& := ' '
LINE/:DEFINE &W_STRAS& := ' '
LINE/:DEFINE &W_ORT01& := ' '
LINE/:DEFINE &W_REGIO& := ' '
LINE/:DEFINE &W_PSTLZ& := ' '
LINE/:DEFINE &W_KUNNR& := ' '
LINE/:PERFORM F_CUST_ADRC IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING &W_NLPLA&
LINE/:CHANGING &W_NAME1&
LINE/:CHANGING &W_NAME2&
LINE/:CHANGING &W_STRAS&
LINE/:CHANGING &W_ORT01&
LINE/:CHANGING &W_REGIO&
LINE/:CHANGING &W_PSTLZ&
LINE/:CHANGING &W_KUNNR&
LINE/:ENDPERFORM
LINE* Customer No.: &W_KUNNR&
LINE* &W_NAME1&
LINE* &W_STRAS&
LINE* &W_ORT01&, &W_REGIO& &W_PSTLZ&
LINE/WPICKLOC
LINE/*>> Define Input and output variables used in different Performs calls
LINE/:DEFINE &W_LGNUM& := &LTAK-LGNUM&
LINE/:DEFINE &W_LGTOR& := &LTAK-LGTOR&
LINE/:DEFINE &W_VBELN& := &LTAK-VBELN&
LINE/:DEFINE &W_TANUM& := &LTAP-TANUM&
LINE/:DEFINE &W_OUT_LINE1_BC& := ' '
LINE/******************************************************************
LINE/*>> THIS PERFORM CALL IS USED TO GET THE BAR CODE FOR PICK PROCESS
LINE/*>> Input - Door for warehouse number
LINE/*>> Input - Sales and distribution document number
LINE/*<< Output - Line 1
LINE/******************************************************************
LINE/:PERFORM F_PICK_PROCESS_BC IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING &W_LGNUM&
LINE/:USING &W_LGTOR&
LINE/:USING &W_VBELN&
LINE/:USING &W_TANUM&
LINE/:CHANGING &W_OUT_LINE1_BC&
LINE/:ENDPERFORM
LINE/*<< End of F_PICK_PROCESS_BC  perform cal>>
LINEL2
LINEL2
LINEL2
LINEL2
LINEL2
LINEL2<BD>&W_OUT_LINE1_BC&</>
LINEL2
LINEL2
LINEL2
LINE/WSHP_INST
LINE/:DEFINE &W_NLPLA& = &LTAP-NLPLA&
LINE/:DEFINE &W_PRINT& := ' '
LINE/:DEFINE &W_VSBED& := ' '
LINE/:DEFINE &W_VTEXT& := ' '
LINE/:DEFINE &W_SDABW& := ' '
LINE/:DEFINE &W_BEZEI& := ' '
LINE/:DEFINE &W_LINE1& := ' '
LINE/:DEFINE &W_LINE2& := ' '
LINE/:DEFINE &W_LINE3& := ' '
LINE/:DEFINE &W_LINE4& := ' '
LINE/:DEFINE &W_LINE5& := ' '
LINE/:PERFORM F_SHIP_INSTRUCTIONS IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING    &W_NLPLA&
LINE/:CHANGING &W_PRINT&
LINE/:CHANGING &W_VSBED&
LINE/:CHANGING &W_VTEXT&
LINE/:CHANGING &W_SDABW&
LINE/:CHANGING &W_BEZEI&
LINE/:CHANGING &W_LINE1&
LINE/:CHANGING &W_LINE2&
LINE/:CHANGING &W_LINE3&
LINE/:CHANGING &W_LINE4&
LINE/:CHANGING &W_LINE5&
LINE/:ENDPERFORM
LINE/:IF       &W_PRINT& NE ' '
LINE* Shipping Conditions   : &W_VTEXT& &'('W_BEZEI')'&
LINE/:IF &W_LINE1& NE ' ' OR &W_LINE2& NE ' ' OR &W_LINE3& NE ' ' OR &W_LINE4& NE ' ' OR &W_LINE5& NE ' '
LINE* Shipping Instructions :
LINE*     &W_LINE1&
LINE*     &W_LINE2&
LINE*     &W_LINE3&
LINE*     &W_LINE4&
LINE*     &W_LINE5&
LINE/:ENDIF
LINE/:ENDIF
LINE/WKOPF
LINE/EKOPF
LINE/:BITMAP 'Z_LOGO' OBJECT GRAPHICS ID BMAP TYPE BCOL DPI 100
LINE/*L
LINE/*L
LINE/*L
LINEL ,,<HD>TRANSFER ORDER COLLECTIVE</>
LINE/*>> Define Input and output variables used in different Performs calls
LINE/:DEFINE &W_LGNUM& := &LTAK-LGNUM&
LINE/:DEFINE &W_LGTOR& := &LTAK-LGTOR&
LINE/:DEFINE &W_VBELN& := &LTAK-VBELN&
LINE/:DEFINE &W_TANUM& := &LTAP-TANUM&
LINE/:DEFINE &W_OUT_LINE1_BC& := ' '
LINE/******************************************************************
LINE/*>> THIS PERFORM CALL IS USED TO GET THE BAR CODE FOR PICK PROCESS
LINE/*>> Input - Door for warehouse number
LINE/*>> Input - Sales and distribution document number
LINE/*<< Output - Line 1
LINE/******************************************************************
LINE/:PERFORM F_PICK_PROCESS_BC IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING &W_LGNUM&
LINE/:USING &W_LGTOR&
LINE/:USING &W_VBELN&
LINE/:USING &W_TANUM&
LINE/:CHANGING &W_OUT_LINE1_BC&
LINE/:ENDPERFORM
LINE/*<< End of F_PICK_PROCESS_BC  perform call>>
LINEL1Door: &W_OUT_LINE1_BC&,,
LINE/*IF &LTAK-LGTOR& NE ' '
LINE/*Door: &LTAK-LGTOR&
LINE/*ENDIF.
LINEL1Delivery Number: &LTAK-VBELN&
LINEL2
LINEL2
LINEL2
LINEL2<BC>&LTAK-VBELN&</>,,
LINE/:IF &LTAK-LGBZO& NE ' '
LINE= &LTAK-LGBZO&
LINE/:ENDIF
LINE/WLAST_3
LINE/:DEFINE &LAST_3& = ' '
LINE/:PERFORM LAST_3 IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING &LTAK-VBELN&
LINE/:CHANGING &LAST_3&
LINE/:ENDPERFORM
LINEB &LAST_3&
LINE/WFUSS
LINE/EFUSS
LINEL1&RLDRU-WIEDR&  WHS: &LTAK-LGNUM&
LINE/
LINE/
LINE/
LINE/
LINE/
LINE/
LINE/*>> Define Input and output variables used in to Performs call
LINE/:DEFINE &W_PAGE_FROM& = ' '.
LINE/:DEFINE &W_PAGE_TOTAL& = ' '.
LINE/:DEFINE &W_PAGE_FLAG& = 'N'.
LINE/:DEFINE &TOT_CASE& = ' '.
LINE/******************************************************************
LINE/*>> This perform call is used to Get Consolidated Page No.
LINE/*>> Input - Reference No., Delivery Document No.
LINE/*<< Output - Page No., Total Page No., Page Flag
LINE/******************************************************************
LINE/:PERFORM F_PAGE_NO IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING &LTAK-REFNR&
LINE/:USING &LTAK-VBELN&
LINE/:CHANGING &W_PAGE_FROM&
LINE/:CHANGING &W_PAGE_TOTAL&
LINE/:CHANGING &W_PAGE_FLAG&
LINE/:ENDPERFORM
LINE/*<< End of F_PAGE_NO  perform cal>>
LINE/*
LINE/*PERFORM F_TOTALS IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/*USING &W_MATNR&
LINE/*USING &W_NSOLM&
LINE/*CHANGING &TOT_CASE&
LINE/*ENDPERFORM
LINE/*IF &W_PAGE_FROM& EQ &W_PAGE_TOTAL&
LINE/*<B>DELIVERY TOTALS</>
LINE/*<B>CASES:&TOT_CASE&</>
LINE/*<B>EA,,,,,,:</>
LINE/*<B>WEIGHT:</>
LINE/*ELSE
LINE/*
LINE/*
LINE/*
LINE/*
LINE/*
LINE/*ENDIF
LINE/:IF &W_PAGE_FLAG& EQ 'Y'
LINEL1&LTAK-BDATU&  Page &W_PAGE_FROM(C)& of &W_PAGE_TOTAL(C)&
LINE/:ELSE
LINEL1&LTAK-BDATU&  Page &PAGE& of &SAPSCRIPT-FORMPAGES(C)&
LINE/:ENDIF.
LINE/WMAIN
LINE/*************************************************************************
LINE/** Caution: Elements KOPF_TA, KOPF_HU, KOPF_TITLE will be print only    *
LINE/**          on the first page of TO                                     *
LINE/**          KOPF_HU must be in Window MAIN because of variable number   *
LINE/**                  of lines.                                           *
LINE/**          KOPF_TA and KOPF_TITLE have the same structure as           *
LINE/**                  window KOPF. -> Changes must maintain twice         *
LINE/*************************************************************************
LINE/EKOPF_TA
LINE/:IF  &LTAP-VLBER& EQ '001'
LINE/:DEFINE &W_VLTYP& := &LTAP-VLTYP&
LINE/:ELSE
LINE/:DEFINE &W_VLTYP& := &LTAP-VLBER&
LINE/:ENDIF
LINE/EKOPF_HU
LINE/:IF  &LTAP-VLBER& EQ '001'
LINE/:DEFINE &W_STYPE& := &LTAP-VLTYP&
LINE/:ELSE
LINE/:DEFINE &W_STYPE& := &LTAP-VLBER&
LINE/:ENDIF
LINE/EKOPF_TITLE
LINE/*
LINE/EMAIN
LINE/*>> Define Input and output variables used in different Performs calls
LINE/:DEFINE &W_MAKTX& := &LTAP-MAKTX&
LINE/:DEFINE &W_MATNR& := &LTAP-MATNR&
LINE/:DEFINE &W_OUT_LINE1& := ' '
LINE/:DEFINE &W_OUT_LINE2& := ' '
LINE/:DEFINE &W_CASEQTY& := ' '
LINE/:DEFINE &TOT_CASE& := ' '
LINE/:DEFINE &TOT_EA& := ' '
LINE/:DEFINE &TOT_EA& := ' '
LINE/:DEFINE &W_PAGE_FROM& := ' '
LINE/:DEFINE &W_PAGE_TOTAL& := ' '
LINE/:DEFINE &W_PAGE_FLAG& := 'N'
LINE/:DEFINE &W_NSOLM& := &LTAP-NSOLM(T)&
LINE/:DEFINE &W_TANUM& := &LTAP-TANUM&
LINE/:DEFINE &W_BRGEW& := &LTAP-BRGEW&
LINE/******************************************************************
LINE/*>> This perform call is used to Warp the Material description
LINE/*>> Input - Material description
LINE/*<< Output - Line 1 ,Line2
LINE/******************************************************************
LINE/:PERFORM F_WORDWRAP_MAKTX IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING &W_MAKTX&
LINE/:CHANGING &W_OUT_LINE1&
LINE/:CHANGING &W_OUT_LINE2&
LINE/:ENDPERFORM
LINE/*
LINE/*<< End of F_WORDWRAP_MAKTX  perform cal>>
LINE/**********************************************************************
LINE/*This perform call is used to fetch the International Article Number(NDC)
LINE/*From MARA table passing material number as an input parameter
LINE/*>> Input - Material number
LINE/*<< Output - International article number
LINE/**********************************************************************
LINE/:PERFORM F_GET_NDC IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING &W_MATNR&
LINE/:CHANGING &W_EAN11&
LINE/:ENDPERFORM
LINE/*
LINE/*<< End of F_GET_NDC perform call >>
LINE/*********************************************************************
LINE/*This perform is used for Case Quantity Conversion
LINE/*From MARA table passing material number as an input parameter
LINE/*>>Input - Material number
LINE/*<<Output -Case Quantity
LINE/*********************************************************************
LINE/:PERFORM F_GET_CASE_QUANTITY IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING &W_MATNR&
LINE/:USING &W_NSOLM&
LINE/:CHANGING &W_CASEQTY&
LINE/:ENDPERFORM
LINE/*<< End of F_GET_CASE_QUANTITY  perform call >>
LINE/*********************************************************************
LINE/*>> Page break by Source Storage Type
LINE/*>> Driver program will return item data sorted by Source Storage Type
LINE/*
LINE/*IF  &LTAP-VLBER& EQ '001'
LINE/*IF        &PAGE& NE 1
LINE/*IF     &W_VLTYP& NE &LTAP-VLTYP&
LINE/*DEFINE &W_VLTYP& := &LTAP-VLTYP&
LINE/*ENDIF
LINE/*ENDIF
LINE/*ELSE
LINE/*IF        &PAGE& NE 1
LINE/*IF     &W_VLTYP& NE &LTAP-VLBER&
LINE/*DEFINE &W_VLTYP& := &LTAP-VLBER&
LINE/*ENDIF
LINE/*ENDIF
LINE/*ENDIF
LINE/*
LINE/*<< End of code " Page break by Source Storage Type
LINE/*****************************************************************
LINE/*<< Print item details
LINE/******************************************************
LINELT,,&LTAP-VLPLA&,,<B>&LTAP-MATNR&</>,,&W_OUT_LINE1&,,&LTAP-CHARG&,,
LINE= <B>&LTAP-NSOLA(C)&</>,,&LTAP-ALTME&,,   &LTAP-TANUM&,,,,
LINE/:IF  &LTAP-VLBER& EQ '001'
LINE  &LTAP-VLTYP&
LINE/:ELSE
LINE  &LTAP-VLBER&
LINE/:ENDIF
LINE/*>>Next line
LINELC,,&LTAP-NLPLA&,,&W_EAN11&,,&W_OUT_LINE2&,,&LTAP-VFDAT&,,&W_CASEQTY&,,
LINE= CS,,,,,,
LINE/:IF  &LTAP-NLBER& EQ '001'
LINE  &LTAP-NLTYP&
LINE/:ELSE
LINE  &LTAP-NLBER&
LINE/:ENDIF
LINE/*
LINE/:PERFORM F_PAGE_NO IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING &LTAK-REFNR&
LINE/:USING &LTAK-VBELN&
LINE/:CHANGING &W_PAGE_FROM&
LINE/:CHANGING &W_PAGE_TOTAL&
LINE/:CHANGING &W_PAGE_FLAG&
LINE/:ENDPERFORM
LINE/*
LINE/*IF &W_PAGE_FROM& EQ &W_PAGE_TOTAL&
LINE/:PERFORM F_TOTALS IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING &W_MATNR&
LINE/:USING &W_NSOLM&
LINE/:CHANGING &TOT_CASE&
LINE/:ENDPERFORM
LINE/*
LINE/:PERFORM F_TOTALS_EA IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING &W_MATNR&
LINE/:USING &W_NSOLM&
LINE/:CHANGING &TOT_EA&
LINE/:ENDPERFORM
LINE/*
LINE/:PERFORM F_TOTALS_WEIGHT IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING &W_TANUM&
LINE/:USING &W_BRGEW&
LINE/:CHANGING &TOT_WT&
LINE/:ENDPERFORM
LINE/*
LINE/:IF &PAGE& EQ &SAPSCRIPT-FORMPAGES&
LINE/:PROTECT
LINE* <B>,,,,DELIVERY TOTALS</>,,
LINE/ <B>,,,,CASES:&TOT_CASE&</>
LINE/ <B>,,,,EA:&TOT_EA&</>
LINE/ <B>,,,,WEIGHT:&TOT_WT&LBS</>
LINE/:ENDPROTECT
LINE/:ENDIF
LINE/*
LINE/*,,<b>&LTAP-MATNR&</>,,&W_OUT_LINE1&,,&LTAP-CHARG&,,&LTAP-TAPOS&,,S,,
LINE/*&LTAP-VLTYP&,,&LTAP-VLPLA&,,<b>&LTAP-NSOLA(C)&</>,,&LTAP-ALTME&
LINE/*,,&W_EAN11&,,&W_OUT_LINE2&,,&LTAP-VFDAT&,,&LTAP-BESTQ&,,D,,
LINE/*&LTAP-NLTYP&,,&LTAP-NLPLA&,,&W_CASEQTY&,,CS
LINE/
LINE/<<************* End of "Print item details********************>>
LINE/*
LINE/*>> Define variable to store Source Storage Type
LINE/:IF  &LTAP-VLBER& EQ '001'
LINE/:DEFINE &W_VLTYP& := &LTAP-VLTYP&
LINE/:ELSE
LINE/:DEFINE &W_VLTYP& := &LTAP-VLBER&
LINE/:ENDIF
LINE/*End of definition
LINE/*
LINE/*
LINE/ESERIAL
LINE/*
LINE/EPACKAGING
LINE/*
END
ACTVSAP
E
The last Text Elements SERIAL and PACKAGING are not used.
I need the total of the CASES, Eaches and Weight to be displayed in the last page either in the main window or in the footer.
Thanks,

Similar Messages

  • How to do SUBTOTAL AND TOTAL in Main Window of SAPSCRIPT.

    Hello Friends,
    I am modifying standard SAPSCRIPT of packing slip. My client wants a subtotal and total in Main Window of Script for Eg. (They want Material Number wise Subtotal and finally Grandtotal at bottom in Main Window)
    Now i got stucked up here how to do it ?
    here is my sample code.
    LOOP AT XVBPLP WHERE VENUM = SHENR.
    IF XVBPLP-POSNR IS INITIAL.
        Versandelement
          PERFORM PACKING_TREE USING XVBPLP-UNVEL.
        ELSE.
        Lieferposition (Anteil)
          VBPLP = XVBPLP.
      CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            ELEMENT = 'DELPOS'.                     "Main Window call
    clear vbplp.
    ENDLOOP.
    Pls guide me for the same.

    HI,
    For the Line items, put a ELEMENT in the Smartform, and you will call this with in the LOOP and ENDLOOP, so here with in the LOOP count the TOTAL value.
    then create new element after the Line item Element, and call this Element after the Line items prints,
    /E  LINE_ITEM
      &1& &2 & &3&     " This will be in the loop and you need to caliculate the totla here
    /E SUB_TOTAL.
    &SUb_TOTAL&  " After all the line items pritns then call this Element
    Regards
    Sudheer

  • Display  6 line items and total in main window

    Hi,
    I want to display only 6 line items in main window( on first page and also total of the main window of first page), and consecutively in all the apges i want to display only 6 line itms and total in each page of main window, how to write logic for this.
    Thanks,
    Donlad

    Hi r u talking about Snmartform if yes
    Let us take the page you are using as PAGE1, you can achuve this using the Command Node. call the same page after 6 items as follows
    1.create Table.--->Main area , Header and footer.
    2.Declare a variable V_count type sy-tabix.
    a.Now click on the table tab>Main Area>right Create>Command (insert a command node after the Line type you r using to print the data), in this COMMAND node give the condition V_COUNT = 6. GOTO>PAGE1 (it maens you r  triggering the new page after the 6 lines.
    b. after this command noder insert the Program lines heate increase the value of V_COUNT.
    Maintain another variable the use that for page totals...
    total can be doneautomatically by using the TABle-->CALCULATION TAB.
    let me know if you more clear info, iam sure u r problem willbe solved.

  • Display of total in Main window in Sapscript

    Hello guys,
    can you please help me with the following?
    Working with Standard transaction F.2c standard program RFDUZI00 whereby I have to make a copy of the standard Sapscript F_DUZI_01 for a specific company code and modify its layout. Requirement is that:
    On the 1st page, the table should contain a maximum of 12 lines.
    On the following page (if several pages are required), the subtotals and the sum total cannot be displayed alone on the last page. If so, the 2 last lines of the previous page should be reported on the last page (and, of course, deleted from the page before the last page)
    Can  please anyone who's done smething similar help me to implement the above?

    Hi
    U can create a secondary window tyoe VAR placed in the footer of the oages when u print the subtotal or the total
    Max

  • Scripts totals prinint in main window

    Hi,
    i want to print gross value, discount,output tax and total amount after printing all line items in main window. can any one tell me where i have to write the code for this gross value, discount,output tax and total amount. i mean how to check the condition that all lines are over to print gross value, discount,output tax and total amount. i need to print this information at the bottom of main window. can any one pls let me know the process.
    Thanks & Regards
    Munna

    Hi Syed..
    In the Layout MAIN WINDOW:
    1. Create a Text element after the Text element that displays the line items:
    <b>/E LINE_ITEMS</b>
    &WA-MATNR&,, &WA-MENGE&
    <b>/E  ELE_TOTAL
    </b>
    Total = &V_TOTAL&
    2. In the Print program
       Calculate the Total into the Variable V_TOTAL
    Then Call the WRITE_FORM after the LOOP .. ENDLOOP
    LOOP AT ITAB INTO WA.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'LINE_ITEMS'
    TYPE = 'BODY'
    FUNCTION = 'SET'
    WINDOW = 'MAIN' .
    ENDLOOP. 
    <b>CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'ELE_TOTAL'
    TYPE = 'BODY'
    FUNCTION = 'SET'
    WINDOW = 'MAIN' .</b>
    reward if Helpful.

  • Sapscript  total pages in main window

    Hi,
    in <u>main window</u> of my sapscript i need to know total number of pages,
    i'm using &sapscript-formpages& but it doesn't work;
    also tried with &sapscript-jobpages& but with no result.
    In debug it give me "0".
    What's the way to know number of pages in MAIN?
    Thanks.
    Message was edited by:
            Tony De Vivo

    Hi Vallamuthu,
    Thanks for the reply... I am currently modifying the sapscript F110_PRENUM_CHCK. Here we need only the page "NEXT" for our purpose. For this purpose we deleted pages "FIRST"  & "LAST" from my custom sapscript. Now i have only "NEXT" page in my sapscript. I put the code you mentioned even then i don't see overflow happening here. In debug, i saw page as "2".
    regards
    Ajay

  • Dispalying total below the main window.

    Dear All,
    I have one main window in script and there I am disploaying few line items.
    Just below the main window I have created another window for displaying total of the line item.
    How I will adjust the window that TOTAL should comes exactly below the line items.
    Please guide.
    Thanks & Regards,
    Abhay.

    Hi ,
    If it is a Script ,
    Please dont create another window:
    keep the totals in the main window only
    this gets displayed after the total
    Reward if Use full
    Karthick

  • How to print a window (ex:total)only after end of main window in SAP Script

    How to print a window(ex: total) only after end of main window in SAP Script
    Thank you.

    Create a total window and place it after your main window, get the number of lines in your main window and place counter
    Ex,&SAPSCRIPT-COUNTER_1(+)&,
    IF SAPSCRIPT-COUNTER_1& EQ <number of lines in main window>
    **print total
    ENDIF.
    Regards,
    Sairam

  • Printing totals at the end of the main window?

    Hi All,
    This is Hr related and the data displayed in the main window is regarding the five benefit plans. I need to add the values from each plan. But the number of plans displayed is not constant. The plans for which he is eligible are displayed. So I need to display the totals after completion of the data.
    I want to print totals in the main window at the end of the form.  The print program is a standard SAP program and it is not to be changed. I had calculated the totals by calling a perform in the script editor. Thats working fine.
    But the problem is while displaying it. Is there a solution to print totals at the end of the form without changing the print program or without creating a new element(as it cannot be called from the print program)?
    Thanks
    Satish

    See there are so many element which ends with the ATLAST, like INVEST_AT_LAST.
    You need to find out which AT_LAST is triggering in your prorgram. Or, you can use the AT_LAST element of the same family where you put your PERFORM to get the total.
    Say if you put your code at BENEFI_AT_EACH_PERSON, you can use the BENEFI_AT_LAST for displaying the TOTAL.
    Hope it helps..!
    Regards,
    Naimesh Patel

  • What is the difference between Constant Window, Variable Window,Main Window

    hello all
    what is the difference between 1) Constant Window
                                                2) Variable Window
                                                3) Main Window   in SAP SCRIPT

    Hi,
    Window Types
    When defining a form window, you must select a window type for the window.
    You can choose between three types:
    Constant Windows (CONST)
    Variable Windows (VAR)
    Main Windows (MAIN)
    Constant Windows (CONST)
    Starting with Release 4.0, the system internally processes windows of type CONST similar to windows of type VAR.
    Therefore, if you create a new window, always use type VAR.
    Variable Windows (VAR) 
    The contents of variable windows is processed again for each page, on which the window appears.
    The system outputs only as much text as fits into the window. Text exceeding the window size is truncated;
    the system does not trigger a page break. Unlike constant windows, the page windows declared as variable windows may have different sizes on different form pages.
    As far as the processing of the window contents is concerned, the system currently treats constant and variable windows alike.
    The only difference is that constant windows have the same size throughout the form.
    Main Windows (MAIN) 
    Each form must have one window of type MAIN. Such a window is called the main window of the form.
    For SAPscript forms, the main window has a central meaning:
    It controls the page break.
    It contains the text body that may cover several pages.
    It allows to fix text elements at the upper and lower margins of the allocated page window (for example, for column headings).
    As soon as a window of type MAIN is full, SAPscript automatically triggers a page break and continues to
    output the remaining text in the main window of the subsequent page. Page windows of type MAIN have the same width throughout the form.
    The SAPscript composer thus avoids reformatting of the text after each page break.
    If a page does not have a main window, the system implicitly processes all other windows of the page and continues with the subsequent page.
    This page must not call itself as subsequent page (recursive call), since this would produce an endless loop.
    In such a case, SAPscript terminates the output after three subsequent pages.
    For printing header lines or totals, the different output areas of the main window are of special importance.
    go through this links:
    In Scripts Variable window and constant wind difference?
    Main Window
    Re: Main Window in SAP Script
    What is the difference between Constant window and variable window?
    Regards
    Adil

  • Problem with line items print in Script MAIN window.

    Dear Friends,
    I am facing a problem with display the line items in main window.
    Here i have created my form with 2 pages,
    in first page i have created header window(my header information is full length of page), in second page i have created 2 windows, one for MAIN window and second for FOOTER window,
    i am having the Footer information about to off the page.
    and in my main window total 3 line items are coming, if i am having 3 line items then it is displaying properly (first 3 line items then immediately footer information on same page) but if am having more then 3 line items say four, then in my second page first it is printing 3 line items then it is switching into another page. After that footer is coming but. in previous page after printing 3 line items the remaining page is empty..
    my client want me to remove that place also. he wants to display continue..
    i think so u people r understand what is my problem...pls advice me what i want to do to solve this problem.
    Thanks
    Sridhar.

    Hi Sridher,
    If you want to display the footer information only on the last page why dont you use a table to display your details and place the footer details in the table footer instead of a seperate footer window.
    Regards,
    Vidya.

  • Frame line not display in next page of main window

    hi Xpert,
    I am creating layout in SAP SCRIpt,it working fine only the main window of next page  frame line is not display.
    i m define next page as a FIRST page and writing main window of first page following coding
    /:           POSITION XORIGIN '0.50' CM YORIGIN '7.75' CM
    /:           SIZE HEIGHT '17' CM WIDTH '19.25' CM
    /:           BOX  FRAME 10 TW
    when i run the program first page are coming properly and only when i go in second page of output then main window lines not displaying.
    please guide me how to solve this problem.
    Regards,
    pravin

    Hi Praveen,
    In that case why you have to make the main window in the first page and secondry window.
    You can use it as manin window itself. Print the total amount in the main window itself in the first page. and copy that main window to the second page.
    In the first page under the main window create a text. and there u print the total value and text.
    Now copy the main window to the second page..only COPY DONT CREATE NEW.
    In the second page now under the main window create the table to print the line items. What every u add in the second page main window it will come in the first age also in the smartforms. But it will nto get printed in the first page.After the text to print the totals call the COMMAND option and call next page in that.
    Hope you got me..
    Regards
    Ansari

  • Smartforms main window is not printing

    Hi,
    I would like to ask what to do with this problem.
    The smartform main window is not printing in all the pages.  All the other windows, even the window with the total data is printing.  The only problem is the contents of the main window is not printing.
    Also, the problem only happens when the I've changed printer.
    When I use LOCL as printer, the smartform is OK but when I change the printer, the problem is encountered.
    This also happens when I change environment from development server to production server.  In production server, even the LOCL printer is encountering the problem.
    thanks.

    Hi Mike,
    Have you checked the device type in transaction SPAD? Try to click on Full Admininstration from application toolbar and select device types.
    Hope the above helps.
    Cheers,
    Patrick

  • Smartform main window with grid lines...

    Hi Gurus,
    I am printing the line items in the main window using grid lines of pattern. This main window can print 10 lines only. Here my requirement is i need to get the empty grid lines till the window ends after finishing the printing of all line items.
    for example if it has only 2 lines then i need 2 lines of data and remaining 8 lines should print empty grid lines.
    this table control have 14 columns. some times 2 lines of data occupies 3 lines. because any column value may be morethan of column width. for this type of example i have to print empty lines 7 only. because any item line occupied 2 lines.
    hope it is clear.
    Regards,
    Vijay

    Hello Vijay,
    In order to do this you could make a template(the outlines of your layout). This template must be in the main window, so if there are more than 11 lines the complete template will be printed in the second page.
    If you require a total box at the end of the template then make a new window fill only the value and the total will always be printed in the box..
    Let me know if the solution is not clear. I shall explain in more detail.

  • Script problem in main window

    Hi,
      In main window there is box at the bottom of the page which is used for totals and the space before it is used for items. I want the items to go to next page instead of overwriting on the totals . please help

    Hi,
    You can use
    /: bottom
    /: endbottom
    command in the main window and put the box and the totals in that so they will be printed at the end of the page with out any overlapping of the items
    Regards
    Sarves

Maybe you are looking for

  • Infinity Order Shambles - Where to complain? What ...

    Hi, I've never had internet from BT, and the way it's looking I won't for a while either given the utterly shambolic performance over the last fortnight with my order. Here's what happened: 1. Checked on the availability of fibre to my area through t

  • Zen NX is not recognized by my lap

    Just for kicks I gave Pocket DivX Encoder a try. It sure is quick, and the file was definitely readable on my Zen, but I prefer to use my usual video converter, megui. The problem is all of the video files that i have made with megui weren't 'seekabl

  • I Need to Write the current Date and Time

    I need to write the current date and time to calculate the spend time in each instruction. What is the instrucion? Thanks. MIGUEL ANGEL CARO [email protected]

  • How do I customize settings for Drafts mailbox on an Exchange account?

    My company's IT department set up my work email to sync with my iPhone. It's an Exchange account. Right now, I can't send or edit emails that I compose and save as a draft on my office computer from my iPhone. I believe that I need to edit the settin

  • Flash 9 wont install on my MAC!! HELP!!

    Hi all- Everytime I try to install Flash 9 on my MAC (non-Intel) I get this weird error message: Error message 1008:5,-5000 It then says that I don't have "Access Priveledge" I have uninstalled Flash 8, but it still won't install. I read that the onl