October 23rd, 2009

ABAP Tips: Get local printer information

ABAP Program, by Jack.

How to get local print machine information? Pls check below program.

DATA: PRDEFAULT LIKE  FRPRLIST-PRNAME ,
      IS_FRONTEND LIKE  RSPOTYPE-MODE .
DATA: LIST LIKE FRPRLIST OCCURS 0 WITH HEADER LINE.
 
CALL FUNCTION 'RSPO_FRONTEND_PRINTERS_FOR_DEV'
  EXPORTING
    DEVICE               = 'LP01'
 IMPORTING
   PRDEFAULT            = PRDEFAULT
   IS_FRONTEND          = IS_FRONTEND
*   IS_MAIL              =
*   NO_CHOICE            =
 TABLES
   LIST                 = LIST[]
 EXCEPTIONS
   NO_LIST              = 1
   LIST_TRUNCATED       = 2
   NAME_NOT_FOUND       = 3
   OTHERS               = 4 .
 
WRITE: / 'DEFAULT PRINTER:' , PRDEFAULT.
SKIP.
WRITE: / 'Printer List:'.
LOOP AT LIST.
  WRITE AT /4 LIST .
ENDLOOP.

via http://blog.chinaunix.net/u1/40527/showart_1989847.html

Back Top

Responses to “ABAP Tips: Get local printer information”

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

*