SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Performs an lpstat -p for the unix queue



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Connect to External system, Unix и Perl
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Fri Jan 22, 2010 4:29 pm    Post subject: Performs an lpstat -p for the unix queue Reply with quote

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                                         *
*---------------------------------------------------------------------*

*---------------------------------------------------------------------*
* Tables.                                                             *
*---------------------------------------------------------------------*
TABLES: TSP03.

*---------------------------------------------------------------------*
* 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.

DATA: FILE(45) TYPE C.


*-------------------------------------------------------------------*
* Parameters.                                                       *
*-------------------------------------------------------------------*
SELECTION-SCREEN SKIP 2.
PARAMETERS: PADEST LIKE TSP03-PADEST.

*-------------------------------------------------------------------*
* TOP-OF-PAGE.                                                      *
*-------------------------------------------------------------------*
TOP-OF-PAGE.
  PERFORM WRITE_PAGE_HEADING.

*-------------------------------------------------------------------*
* START-OF-SELECTION.                                               *
*-------------------------------------------------------------------*
START-OF-SELECTION.
  PERFORM MAKE_LOC.
  PERFORM MAKE_DEST.
  PERFORM COLLECT_DATA.
  PERFORM FILE_LIST.

*---------------------------------------------------------------------*
* 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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Connect to External system, Unix и Perl All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.