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
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 -
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.
ThanksThanks 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& = <AP-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& := <AK-LGNUM&
LINE/:DEFINE &W_LGTOR& := <AK-LGTOR&
LINE/:DEFINE &W_VBELN& := <AK-VBELN&
LINE/:DEFINE &W_TANUM& := <AP-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& = <AP-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& := <AK-LGNUM&
LINE/:DEFINE &W_LGTOR& := <AK-LGTOR&
LINE/:DEFINE &W_VBELN& := <AK-VBELN&
LINE/:DEFINE &W_TANUM& := <AP-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 <AK-LGTOR& NE ' '
LINE/*Door: <AK-LGTOR&
LINE/*ENDIF.
LINEL1Delivery Number: <AK-VBELN&
LINEL2
LINEL2
LINEL2
LINEL2<BC><AK-VBELN&</>,,
LINE/:IF <AK-LGBZO& NE ' '
LINE= <AK-LGBZO&
LINE/:ENDIF
LINE/WLAST_3
LINE/:DEFINE &LAST_3& = ' '
LINE/:PERFORM LAST_3 IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING <AK-VBELN&
LINE/:CHANGING &LAST_3&
LINE/:ENDPERFORM
LINEB &LAST_3&
LINE/WFUSS
LINE/EFUSS
LINEL1&RLDRU-WIEDR& WHS: <AK-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 <AK-REFNR&
LINE/:USING <AK-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<AK-BDATU& Page &W_PAGE_FROM(C)& of &W_PAGE_TOTAL(C)&
LINE/:ELSE
LINEL1<AK-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 <AP-VLBER& EQ '001'
LINE/:DEFINE &W_VLTYP& := <AP-VLTYP&
LINE/:ELSE
LINE/:DEFINE &W_VLTYP& := <AP-VLBER&
LINE/:ENDIF
LINE/EKOPF_HU
LINE/:IF <AP-VLBER& EQ '001'
LINE/:DEFINE &W_STYPE& := <AP-VLTYP&
LINE/:ELSE
LINE/:DEFINE &W_STYPE& := <AP-VLBER&
LINE/:ENDIF
LINE/EKOPF_TITLE
LINE/*
LINE/EMAIN
LINE/*>> Define Input and output variables used in different Performs calls
LINE/:DEFINE &W_MAKTX& := <AP-MAKTX&
LINE/:DEFINE &W_MATNR& := <AP-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& := <AP-NSOLM(T)&
LINE/:DEFINE &W_TANUM& := <AP-TANUM&
LINE/:DEFINE &W_BRGEW& := <AP-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 <AP-VLBER& EQ '001'
LINE/*IF &PAGE& NE 1
LINE/*IF &W_VLTYP& NE <AP-VLTYP&
LINE/*DEFINE &W_VLTYP& := <AP-VLTYP&
LINE/*ENDIF
LINE/*ENDIF
LINE/*ELSE
LINE/*IF &PAGE& NE 1
LINE/*IF &W_VLTYP& NE <AP-VLBER&
LINE/*DEFINE &W_VLTYP& := <AP-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,,<AP-VLPLA&,,<B><AP-MATNR&</>,,&W_OUT_LINE1&,,<AP-CHARG&,,
LINE= <B><AP-NSOLA(C)&</>,,<AP-ALTME&,, <AP-TANUM&,,,,
LINE/:IF <AP-VLBER& EQ '001'
LINE <AP-VLTYP&
LINE/:ELSE
LINE <AP-VLBER&
LINE/:ENDIF
LINE/*>>Next line
LINELC,,<AP-NLPLA&,,&W_EAN11&,,&W_OUT_LINE2&,,<AP-VFDAT&,,&W_CASEQTY&,,
LINE= CS,,,,,,
LINE/:IF <AP-NLBER& EQ '001'
LINE <AP-NLTYP&
LINE/:ELSE
LINE <AP-NLBER&
LINE/:ENDIF
LINE/*
LINE/:PERFORM F_PAGE_NO IN PROGRAM ZMSPERFORMS_TRANSFER_ORDER
LINE/:USING <AK-REFNR&
LINE/:USING <AK-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><AP-MATNR&</>,,&W_OUT_LINE1&,,<AP-CHARG&,,<AP-TAPOS&,,S,,
LINE/*<AP-VLTYP&,,<AP-VLPLA&,,<b><AP-NSOLA(C)&</>,,<AP-ALTME&
LINE/*,,&W_EAN11&,,&W_OUT_LINE2&,,<AP-VFDAT&,,<AP-BESTQ&,,D,,
LINE/*<AP-NLTYP&,,<AP-NLPLA&,,&W_CASEQTY&,,CS
LINE/
LINE/<<************* End of "Print item details********************>>
LINE/*
LINE/*>> Define variable to store Source Storage Type
LINE/:IF <AP-VLBER& EQ '001'
LINE/:DEFINE &W_VLTYP& := <AP-VLTYP&
LINE/:ELSE
LINE/:DEFINE &W_VLTYP& := <AP-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, -
Displaying line items in main window
Hi
I want to create a sapscript from scratch. How do one display multiple line items in a one window.
Do i loop the internal table in the print program and write to scapscript?Hi,
Make a Main window in sapscript.
Make a text element say ITEM.
and then give the name of ur variable to be printed as &<variable>&
Now in Program side make a new prog...
get the lineitems in itab
open_form....
loop across the itab
write_form
endloop
close_form
Pls ping me if unclear... i think it helps...
Regards,
Abhishek -
Printing digital signature in main window of sapscript at some location
Hi,
I want to print graphics in main window in sapscript. I want to position the graphic ( signature) at some position (preferably right aligned ). How to do that? Can we do that in .bmp graphics. In case we use .tiff format , how to do it. Tell me the steps involved as I have never used RSTXLDMC to upload .tiff files.
Regards,
D.MallickHi
Just open rstxldmc in se38 and execute.
It will gve you a screen. You need to fill the first two blocks only. Remaining are optional.
File Name : Give pathe+name of your .tiff file
Type : Bcol for colour and bmon for mono
Resolution : say 75 (as you wish)
Second block
Text name : only replace astrick by your name ZHEX-MACRO- has to be there.
Actually this program will convert .tiff file into text file.
you can include this text file in any window. Text name is the name of the text file generated
no more changes
Now execute.
Now you can use this text file ZHEX-MACRO-name in any windoow
If useful, give me points
cheers
vamshi -
Hi gurus in scripts i want to display more then one main window on the page
hi gurus in scripts i want to display more then one main window on the page how it is to follow any body explain to me plz.
Hi all,
I am printing check printing from F110 with Z-form and it has been assigne to FBZP also..
My client need to print the check information twise that means main window data two times.
like this:
First main window. : invice# amt amt
9002 4000 4000
9005 5000 4000
Al so they want like to print same in down part of the main window.
First main window. : invice# amt amt
9002 4000 4000
9005 5000 4000
For this i have created instance main window of main window like MAIN 01, but it is not displaying the data in instnce window data
in the instance main window.
Question: Could you please let me know abt the same or good solution. How to cal main window instance , i tried with
/: NEW-WINDOW in instance main window part but it also appering in main windoe also.
could you please let me know how to call instance main window or any other solution to get teh data like my example above.
thx -
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,
DonladHi 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. -
Porblem in displaying the data in main window and footer in sapscript
Hi Friends,
I have created a 2 pages with a main window and 6 footer windows for purchase requistion printout. My requirement is footer windows should only be displayed at the last page. If i bring the footer window at the last page there is blank space in all pages after the main window since the main window size is smaill, if i increase the main window size it is overlaping footer windows at the last page.
I want the main window shouldbe big and footer should be displayed at the last page.
please hellp me to solve this.
Thanks
Gayathri SIf you want to position footer texts right after the last line of the MAIN data (thus, anywhere in the page), you define them as text nodes inside the MAIN window, and you use a template node if you wan't to position them precisely.
If you want to position footer texts relatively to the page edges (and not relatively to the MAIN), do like this (as my previous answer is wrong):
- define your footer windows in the same page of the MAIN, select condition "Only after main window" (so that the windows will be printed on the page of the last line of the MAIN data.
- If the footer windows span over the MAIN window (because you want to maximize MAIN window height on all pages except last where you put the footer, as it was the case for Gayathri), you must add a template node inside the MAIN window, as the last element. Its height must be equal to the part of MAIN that is overriden by the footer windows, so that a new page is triggered automatically if there is no sufficient space and the footer windows will be printed on next page, and if there is enough space, the footer windows will be printed at the bottom of current page. -
How to get watermark in main window of SAPSCRIPT FORM
can anyone help me to get watermark in a SAPSCRIPT FORMS
in all pagesHi vinod,
Thanks for reply I have tried but its not working.
I have 2 main window one "main" and other "Main01". In the main 01 I have insert Bitmap command. I have other values to display main.
watermark is not coming second page.
As u said I have given New-window the bitmap was not displaying.
Please can u give details idea in this regards
Thanks
Regards
Prashanth. -
How to include a main window in sapscript
hi all ,
i just create a sapscript , and i found on sap online help that i could include main window up to 99 times , but i don't know how to include another main window.
regardsHi Kevin,
first Goto T-code SE71 create one test script in that design the layout in the normal method once your design is complete than there one option called EDIT
in that EDIT-> window>creat-> vraible
main
select the option main window placed this window according to u r requriment it will displayed as per logic.
one imporatant point whn u place scond main window it take diffrent higt but it will not take differnt width so u can place scond main wiindow with differnt hight but not not in width.
reward is usefull.
thanks. -
Box in MAIN window of sapscript keeps misaligning...
Hello Experts,
I am currently modifying a sapscript and inside the MAIN window, there is a box command that 'boxes' a
static text. But the problem is, the box misaligns since the number of line items is dynamic.
So, how can I make the box command to just 'box' the static text correctly even though the line item is
dynamic?HI,
Declare the Box and Static text in the main window with a new text element after the text element of the line items . so it will print it in the end when all of the Line items are printed..
(or)
Just create another script with the BOX and the text you want inside the BOX. i.e. this becomes another script which is separate from the line items you are printing there.
call this script in your driver program with start_form FM.
REPORT YTEST_SCRIPT.
DATA:
ITAB TYPE TABLE OF SFLIGHT,
FS TYPE SFLIGHT.
SELECT * FROM SFLIGHT INTO TABLE ITAB.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZSCRIPT_TEST'.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT ITAB INTO FS.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'TEST'
WINDOW = 'MAIN'.
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.
CALL FUNCTION 'END_FORM'. "---------->Ends the previous form
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'START_FORM' "------------> Starts your new script with BOX and Static text
EXPORTING
FORM = 'ZSCRIPT_TEST1'.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'TEST'
WINDOW = 'MAIN'.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'CLOSE_FORM'.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
This will print the BOX and the Static text in a new page after the line items got printed..
This will solve your issue...
Thanks&Regards
Sarves -
Main window of SAPScript versus Main window of smartform
Hi,
In case of Smartform we have one main window per page but in case of SAP Script we can have 0 to 99 Main window on one page.
In case of smartform if the main window on one page gets filled then the remaining long text will jump on main window of second page.
Following are my doubts:
If I define three MAIN windows for three different kind of long texts on page one in SAP Script as follows:
MAIN Window 1 - Long text1
Main Window 2 - Long text2
Main Window 3 - Long text3
1) If the long text 1 on MAIN window 1 of first page gets full does it automatically jump to Main Window 2 of first page ?
2) If I don't want the long text on Main Window 1 to jump on Main window 2 on first page but on Main winodw 1 of next page , is it possible ? How do I do it ?
Answers will be rewarded..
Tushar.In SAPScripts if the long text is filled in the Main Window it will spill over into the same Main Window if it is defined in the next page. Text from one Main Window will nt spill over onto the text to different Main window.
So as far as you questions are concerned:
1. Not it does not automatically jump over into Main Window 2 from Main Window 1 on same page or next page.
2. You just need to define the Same Main Window on the next page so that text gets jumped over to the next page. If it is possible just define the next page as the same page, so that you do not have to create a separate page and attach all the windows.
Hope this helps you...
Shashi Reddy -
Displaying bottom text of main window in box?
Hi all ,
I am working with a sap script, where i need to display standard text in box at end of the main window.
The problem is i am unable to set the dynamic position of the box at bottom of the main window .
please help me to fix this problem?
Thanks,
Vamshi.
Edited by: VAMSHI KRISHNA on Oct 29, 2008 12:04 AMHi Gustavo,
Thanks for your reply.
But here my requirement is the text should be displayed immediately after the data in main window is printed . If i used the bottom window , then it will display exactly in that position despite of the main window data.
So Is there any way to display text in box dynamically, after main window data is completed?
Thanks,
Vamshi. -
Box in a main window in sapscript
Hello Forum!
In my sapscript there's a window MAIN with BOX FRAME. This window is in a first and next page, but the box only appears in the first page, not in the others.
Anybody knows what I shound be change? I need the box always appears (in all pages).
Thanks in advance!!!
Edited by: Pablo Ariel Vicente on Feb 14, 2008 3:57 PMHi!
Try specifying all the parameters (XPOS, YPOS, HEIGHT, WIDTH) in the BOX command. This may resolve the problem.
Cheers! -
Drawing box in main window of sapscript form
Hi all,
I am developing a script for vendor balance confirmation report, in which I have to provide check boxes to allow the user to select an option.
My problem is if I use the BOX statement to draw the box the alignment keeps changing when the size of vendor address changes.
i.e the boxes moves up and down
I have another reference script in which they used the following statement to draw the box <527>.
Please suggest a way to use statement like this <527>
Thanks,
RajanTry it as shown below for drawing dynamic boxes.
Here the code works this way the YORIGIN is incremented by 0.6CM each time it is in the loop thus drawing tables dynamically.
/E TAB
/: POSITION XORIGIN '0.9' CM YORIGIN '+0.6' CM
/: SIZE WIDTH '3.0' CM HEIGHT '0.6' CM
/: BOX FRAME 10 TW.
/: POSITION XORIGIN '3.9' CM
/: SIZE WIDTH '7.3' CM HEIGHT '0.6' CM
/: BOX FRAME 10 TW.
/: POSITION XORIGIN '11.2' CM
/: SIZE WIDTH '2.8' CM HEIGHT '0.6' CM
/: BOX FRAME 10 TW.
/: POSITION XORIGIN '14' CM
/: SIZE WIDTH '2.6' CM HEIGHT '0.6' CM
/: BOX FRAME 10 TW.
/: POSITION XORIGIN '16.6' CM
/: SIZE WIDTH '3.2' CM HEIGHT '0.6' CM
/: BOX FRAME 10 TW
P4 &X_VBAP-KWMENG(C)&,,&X_VBAP- ARKTX&,,&V_TOTALa&,,&V_TOTALb&,,&V_TOTALc&
the driver program's piece of code.
LOOP AT it_vbap INTO x_vbap.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'TAB'
window = 'MAIN'
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.
Regards,
SaiRam
Maybe you are looking for
-
Error creating document from using list using Document Template
Hi All, I am trying to create a document from sharepoint list and upload it to a document library using item added and item updated event receiver methods. I can create metadata from list update in document library but unable to open the document. Th
-
How can I upload .raw2 formated photos from my Lumix DMC-FZ70
I have a Panasonic camera that takes .raw2 formated photos and I get an error from iPhoto that it does not recognize the format.
-
Unable to adjust or export images
After importing my last batch of RAW images, I find that I can't adjust or export any of them. I can't externally edit in Photoshop either. If I drag the image to Photoshop, I get a reduced sized jpeg as it is presumably only a preview. (By the way,
-
Firefox 6 has high cpu consumption
Hi, I have just upgraded from Firefox 5.x to 6.0. I am using Windows 7 32-bit on a Dell Laptop, Core 2 duo, 4 GB RAM. I have observed that FF seems to consume a lot more CPU than before. Also, the memory footprint keeps changing rapidly. I don't have
-
Not able to select paper based on pdf.. yes box is checked
I have adobe arcobat pro....I need to print loan documents using both letter and legal.....paper source will only chose either legal or letter..What to do, again yes the box is checked chose paper source based on pdf