Posted: Fri Jan 22, 2010 4:29 pm Post subject: Performs an lpstat -p for the unix queue
Code:
REPORT ZPRINTLS NO STANDARD PAGE HEADING.
*---------------------------------------------------------------------*
* Function Performs an lpstat -p for the unix queue associated*
* with an SAP output device. *
* *
* Inputs SAP output device via dropdown *
* *
* Outputs Output from lpstat -p *
* *
* Authorisations C Calls *
* *
* Customising Requires TCP/IP destination configuration in SM59. *
* A destination SERVER_EXEC_'HOST NAME' is required *
* for each application server supporting a print *
* spooler. *
* *
* Programmer Andy Dunne *
* *
* Version 1.1 *
* *
* Changes 1.0 02.06.1998 Initial Prototype *
* 1.1 02.06.1998 Conversion to RFC *
* *
* SAP Release: 3.0x, 3.1x *
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
* Global Variables. *
*---------------------------------------------------------------------*
DATA: BEGIN OF TABL OCCURS 10,
LINE(90),
END OF TABL.
DATA: PARCOM_LOC(100) TYPE C.
*
DATA: NAME(45) TYPE C,
SIZE(10) TYPE C,
DATE(12) TYPE C,
LINE LIKE TABL-LINE,
SERVER_DEST(33) TYPE C,
SUM(16) TYPE C.
*---------------------------------------------------------------------*
* FORM MAKE_LOC. *
*---------------------------------------------------------------------*
FORM MAKE_LOC.
CLEAR: PARCOM_LOC.
SELECT SINGLE * FROM TSP03 WHERE PADEST = PADEST.
PARCOM_LOC(9) = 'lpstat -p'.
PARCOM_LOC+9(45) = TSP03-PAOSNAME.
ENDFORM.
*---------------------------------------------------------------------*
* FORM MAKE_DEST *
*---------------------------------------------------------------------*
FORM MAKE_DEST.
CLEAR: SERVER_DEST.
SERVER_DEST(12) = 'SERVER_EXEC_'.
SERVER_DEST+12(20) = TSP03-PAHOST.
TRANSLATE SERVER_DEST TO UPPER CASE.
ENDFORM.
*---------------------------------------------------------------------*
* FORM COLLECT_DATA. *
*---------------------------------------------------------------------*
FORM COLLECT_DATA.
REFRESH TABL.
CALL FUNCTION 'RFC_REMOTE_PIPE' DESTINATION SERVER_DEST
EXPORTING COMMAND = PARCOM_LOC
READ = 'X'
TABLES PIPEDATA = TABL.
ENDFORM.
*-------------------------------------------------------------------*
* FORM FILE_LIST. *
*-------------------------------------------------------------------*
FORM FILE_LIST.
FORMAT RESET.
CLEAR SUM.
LOOP AT TABL.
CLEAR LINE.
LINE = TABL-LINE.
WRITE /2 LINE.
PERFORM VERTICAL_LINES.
SUM = SUM + SIZE.
ENDLOOP.
WRITE:/1(90) SY-ULINE.
ENDFORM.
*-------------------------------------------------------------------*
* FORM WRITE_PAGE_HEADING. *
*-------------------------------------------------------------------*
FORM WRITE_PAGE_HEADING.
WRITE:/1(90) SY-ULINE.
PERFORM VERTICAL_LINES.
FORMAT INTENSIFIED.
WRITE: /2(89) SPACE COLOR 1.
WRITE: 2 SY-DATUM COLOR 1.
WRITE: 35 'Print List Viewer' COLOR 1.
PERFORM VERTICAL_LINES.
WRITE:/1(90) SY-ULINE.
PERFORM VERTICAL_LINES.
FORMAT INTENSIFIED.
WRITE: /2(89) SPACE COLOR 3.
PERFORM VERTICAL_LINES.
FORMAT RESET.
WRITE:/1(90) SY-ULINE.
ENDFORM.
*-------------------------------------------------------------------*
* FORM VERTICAL_LINES. *
*-------------------------------------------------------------------*
FORM VERTICAL_LINES.
PERFORM WRITE_VLINE USING ' ' 1.
PERFORM WRITE_VLINE USING ' ' 90.
ENDFORM.
*-------------------------------------------------------------------*
* WRITE_VLINE. *
*-------------------------------------------------------------------*
FORM WRITE_VLINE USING MODE POS.
IF MODE NE 'T'.
FORMAT INTENSIFIED.
ENDIF.
POSITION POS.
WRITE: SY-VLINE.
IF MODE NE 'T'.
FORMAT RESET.
ENDIF.
ENDFORM.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.