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.
如果要获取打印机详细信息,Windows平台的SAP可以:http://blog.chinaunix.net/u1/40527/showart_1974748.html
阅读(3605) | 评论(1) | 转发(1) |