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

Spools



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Function Modules | Функциональные модули
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Mon Sep 17, 2007 6:42 pm    Post subject: Spools Reply with quote

RSPO_RID_SPOOLREQ_DISP - Displays spool(s) contents on screen Input: Spool ID list.

RSPO_ISELECT_TSP01 - Spool Information Input: Spool ID
Output: Spool Info (Structure TSP01SYS)

RSPO_IRETURN_RAW_DATA - Input: Spool Info (Structure TSP01SYS)
Output: Raw data table (text with some format codes) The raw data contains format codes and therefore cannot be used in WRITE statement (in some cases). To display ABAP spool can be used two function modules below. How to write SAPscript spool - example can be found in SAP utility FM RSPO_ROUTPUT_JOB, which prints spool(s).

RSPO_SPOOLDATA_WRITE_INIT - Should be called before using next function module

RSPO_SPOOLDATA_WRITE - Just write line. Input: Raw data table line

RSPO_RETURN_SPOOLJOB - Return spool data in text [or PDF format]:
Input: Spool #; Desired Type for output (RAW - text data ready to be printed, PDF - can be used only for OTF spools)
Output: text table (line length = 255), [table for PDF data]

RSPO_DISPLAY_SPOOLJOB - Input: Spool #

RSPO_RETURN_ABAP_SPOOLJOB - Output: text table ready to be printed

RSPO_DISPLAY_ABAP_SPOOLJOB

RSPO_GET_TYPE_SPOOLJOB - Output: IS_OTF='X'|' '

RSPO_DOWNLOAD_SPOOLJOB - Input: Spool # and File name.
Just calls consecutively RSPO_RETURN_SPOOLJOB and WS_DOWNLOAD

FORMAT_MESSAGE - Takes a message id and number, and puts it into a variable. Works better than WRITE_MESSAGE, since some messages use $ as a place holder, and WRITE_MESSAGE does not accommadate that, it only replaces the ampersands (&) in the message.

RS_SEND_MAIL_FOR_SPOOLLIST - Send message from ABAP/4 program to SAPoffice.

SO_SPOOL_READ - Fetch printer spool according to the spool number informed. See also RSPO_RETURN_ABAP_SPOOLJOB

SO_WIND_SPOOL_LIST - Browse printer spool numbers according to user informed.

RSPO_WRITE_SPOOLREQUEST
Code:
DATA: BEGIN OF i_mara OCCURS 0,
        matnr LIKE mara-matnr,
      END OF i_mara.

DATA: v_dest LIKE tsp01-rqdest,
v_handle LIKE sy-tabix,
v_spool_id LIKE tsp01-rqident,
v_rc TYPE c,
v_errmessage(100) TYPE c,
v_text(70) TYPE c.

START-OF-SELECTION.

  SELECT matnr FROM mara INTO TABLE i_mara.

  CALL FUNCTION 'RSPO_OPEN_SPOOLREQUEST'
  EXPORTING
  dest = 'LOCL'
*LAYOUT =
*NAME =
*SUFFIX1 =
*SUFFIX2 =
*COPIES =
*PRIO =
*IMMEDIATE_PRINT =
*AUTO_DELETE =
*TITLELINE =
*RECEIVER =
*DIVISION =
*AUTHORITY =
*POSNAME =
*ACTTIME =
  lifetime = '8'
*APPEND =
*COVERPAGE =
*CODEPAGE =
*DOCTYPE =
  IMPORTING
  handle = v_handle
  spoolid = gd_spool_nr
  rc = v_rc
  errmessage = v_errmessage.

  LOOP AT i_mara.
    v_text = i_mara-matnr.
    CALL FUNCTION 'RSPO_WRITE_SPOOLREQUEST'
    EXPORTING
    handle = v_handle
    text = v_text
*LENGTH =
*CODEPAGE =
*TRUNCATE =
    IMPORTING
    rc = v_rc
    errmessage = v_errmessage
    EXCEPTIONS
    handle_not_valid = 1
    OTHERS = 2.
    IF sy-subrc 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

  ENDLOOP.

  CALL FUNCTION 'RSPO_CLOSE_SPOOLREQUEST'
       EXPORTING
            handle           = v_handle
       IMPORTING
            rc               = v_rc
            errmessage       = v_errmessage
       EXCEPTIONS
            handle_not_valid = 1
            OTHERS           = 2.
  IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
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 -> Function Modules | Функциональные модули 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.