Professional Documents
Culture Documents
Print Report With Logo (Utility Program To Print Any Report With Logo)
Print Report With Logo (Utility Program To Print Any Report With Logo)
Applies To:
This Utility Program is developed in SAP R/3 Enterprise. Function modules in Function group STXD & SLST are invoked.
Summary
This article provides a solution to print any simple report with a logo. By: Bala JK Company: Yash Technologies, Inc Date: 30 January 2006
Table of Contents
Applies To:........................................................................................................................................1 Summary ..........................................................................................................................................1 Table of Contents .............................................................................................................................1 Utility Program to Print Report with Logo .........................................................................................1 Requirement...........................................................................................................................1 Solution...................................................................................................................................1 Solution Code .........................................................................................................................1 Author Bio.........................................................................................................................................8
2006 SAP AG
Print Report with Logo (Utility Program to print any report with Logo)
Solution Code Below is the source code of the utility program to print any simple Report with Logo.
REPORT Z_PRINT_REPORT_WITH_LOGO. *----------------------------------------------------------------------* * PROGRAM * TITLE * AUTHOR Z_PRINT_REPORT_WITH_LOGO Utility program to print any simple Report with Logo Bala * * *
*----------------------------------------------------------------------* * DESCRIPTION: * * * * * * * * * * Step 1: Create a standard text and Insert your Logo Step 2: Get the standard text to Int. table T_LINE Step 3: Submit the report and export the list to memory Step 4: Get the List from memory Step 5: Convert the list to ASCI format Step 6: Format the List and Append to Int. table T_LINE Step 7: Print your List with Logo This Program is used to Print Any Simple Report with Logo. * * * * * * * * * * *
*----------------------------------------------------------------------*
*----------------------------------------------------------------------* * INTERNAL TABLE DECLARATION *----------------------------------------------------------------------* DATA: T_LIST T_SOLI TYPE STANDARD TABLE OF ABAPLIST WITH HEADER LINE, TYPE STANDARD TABLE OF SOLI WITH HEADER LINE,
2006 SAP AG
Print Report with Logo (Utility Program to print any report with Logo)
T_LINE T_HEAD TYPE STANDARD TABLE OF TLINE TYPE STANDARD TABLE OF THEAD WITH HEADER LINE, WITH HEADER LINE, WITH HEADER LINE, WITH HEADER LINE.
T_ITCPO TYPE STANDARD TABLE OF ITCPO T_ITCPP TYPE STANDARD TABLE OF ITCPP
*----------------------------------------------------------------------* SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001. PARAMETERS: P_PROG TYPE RS38M-PROGRAMM OBLIGATORY, P_VART TYPE RSVAR-VARIANT. SELECTION-SCREEN END OF BLOCK B1. "Your Report Name
*----------------------------------------------------------------------* * Make sure you have created a standard text in SO10 & Insert your Logo * In this example standard text "ZLOGO" is used. CALL FUNCTION 'READ_TEXT' EXPORTING CLIENT ID LANGUAGE NAME OBJECT IMPORTING = SY-MANDT = 'ST' = SY-LANGU = 'ZLOGO' = 'TEXT' "Your standard Text Name
2006 SAP AG
Print Report with Logo (Utility Program to print any report with Logo)
HEADER TABLES LINES EXCEPTIONS ID LANGUAGE NAME NOT_FOUND OBJECT REFERENCE_CHECK = 1 = 2 = 3 = 4 = 5 = 6 = T_LINE = T_HEAD
WRONG_ACCESS_TO_ARCHIVE = 7 OTHERS = 8.
*----------------------------------------------------------------------* * Program Name & Variant Name from Selection screen SUBMIT (P_PROG) USING SELECTION-SET P_VART EXPORTING LIST TO MEMORY AND RETURN. WAIT UP TO 1 SECONDS.
2006 SAP AG
Print Report with Logo (Utility Program to print any report with Logo)
*----------------------------------------------------------------------* * GET THE LIST FROM MEMORY & CONVERT TO ASCI *
*----------------------------------------------------------------------* * Get the List from Memory CALL FUNCTION 'LIST_FROM_MEMORY' TABLES LISTOBJECT = T_LIST EXCEPTIONS NOT_FOUND OTHERS = 1 = 2.
* Get ASCI of List CALL FUNCTION 'LIST_TO_ASCI' TABLES LISTASCI LISTOBJECT EXCEPTIONS EMPTY_LIST = 1 = T_SOLI = T_LIST
2006 SAP AG
Print Report with Logo (Utility Program to print any report with Logo)
CLEAR T_LIST.
REFRESH T_LIST.
*----------------------------------------------------------------------* * Int. table T_LINE already having the Logo (Standard text) * Set Tag Column to List LOOP AT T_SOLI. MOVE: '/=' TO T_LINE-TDFORMAT,
REFRESH T_SOLI.
*----------------------------------------------------------------------* * Print Your Report with Logo * Note: Form SYSTEM is defaulted to T_HEAD-TDFORM and its Orientation * * is Portrait Format. If your Report Width is more, make a copy of Form SYSTEM and change the Orientation to Landscape Format
2006 SAP AG
Print Report with Logo (Utility Program to print any report with Logo)
CALL FUNCTION 'PRINT_TEXT' EXPORTING DEVICE DIALOG HEADER OPTIONS IMPORTING RESULT TABLES LINES EXCEPTIONS CANCELED DEVICE FORM OPTIONS UNCLOSED UNKNOWN FORMAT TEXTFORMAT COMMUNICATION = 1 = 2 = 3 = 4 = 5 = 6 = 7 = 8 = 9 = T_LINE = T_ITCPP = 'PRINTER' = 'X' = T_HEAD = T_ITCPO
BAD_PAGEFORMAT_FOR_PRINT = 10 OTHERS IF SY-SUBRC NE 0. * Pop a Message ENDIF. * --------------------------- End of Program --------------------------* = 11.
2006 SAP AG
Print Report with Logo (Utility Program to print any report with Logo)
Executing the Utility Program: Enter your Report name and Variant Name in the selection screen.
Author Bio
Bala, working as a Technical Consultant for the last 6 years. Designing interfaces between SAP and 3rd party systems is his area of interest. Expertise in Cross-Applications, Web service and Enhancement frame work. Currently working as a technical consultant in an IS-Retail implementation Project.
2006 SAP AG