Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Spool request

Former Member
0 Kudos

Hi all,

once we developing report.how to set the spool request.actually i don't no how to write code to spool request for report.as well as in this spool request where it report o/p will store how to see the o/p of report.

Regards.

Krishna

3 REPLIES 3

Former Member
0 Kudos

When

Former Member
0 Kudos

Whenever u give any print command for ur report output (alv or classical), or print sap script/ smartforms OR issue a print output for a document using its output types, a spool request is created..

U can also create a spool using some FM.. Check out spool in SE37.

U can view the data in transaction SP01.. U can also trigger a print out if the printer is properly configured in ur system..

Former Member
0 Kudos

Hi

The function module RSPO_DOWNLOAD_SPOOLJOB can be used for downloading the spool to the local file. You need to pass the spool request number to the function module. Please note that this function module fits only for the ABAP lists, and not for the spool with images.

Exporting the Contents of a Spool Request

You want to export the content of a spool request in one of the following ways:

· As a text file to the SAP GUI working directory

· Unconverted or as a table, RTF, or HTML to a directory of your choice

· As a PDF file to a directory of your choice



Follow the procedure below:

<b>Exporting to the SAP GUI Working Directory</b>

If you are exporting large quantities of data, downloading the spool request as a text file to the SAP GUI working directory is a good solution.

Choose Spool Request >Forward>Export as Text.

The entire text is stored in your SAP GUI working directory in ASCII format.

A file of this type is named using the following pattern:

·

The PDF conversion only supports true bar codes for Smart Forms, which were generated with the new bar code technology as of SAP NetWeaver 04. In all other cases, the bar code is only simulated.

· PDF conversion, especially of ABAP lists, is slower and is therefore not suitable for mass printing. However, you can speed up the conversion to PDF using the FASTLISTCONV option in report RSTXPDF3.

· The font selection for ABAP lists is predefined in the PDF converter and cannot be changed.

For more information about constraints, see SAP Note 323736 in the SAP Service Marketplace.

 ************************************************************************
**---------------------------------------------------------------------*
* Tables : *
**---------------------------------------------------------------------*
*
TABLES : MAST , "Material to BOM Link
STKO , "BOM Header
MARA . "General Material Data
*
**---------------------------------------------------------------------*
* Types Begin with TY_ *
**---------------------------------------------------------------------*
*
TYPES : BEGIN OF TY_MASTER ,
MATNR TYPE MAST-MATNR , "Material Number
WERKS TYPE MAST-WERKS , "Plant
STLAN TYPE MAST-STLAN , "BOM Usage
STLNR TYPE MAST-STLNR , "Bill of material
STLAL TYPE MAST-STLAL , "Alternative BOM
ANDAT TYPE MAST-ANDAT , "Date record created on
AEDAT TYPE MAST-AEDAT , "Date of Last Change
AENAM TYPE MAST-AENAM , "Name of Person Who Changed Object
STLST TYPE STKO-STLST , "BOM status
ZPLP1 TYPE MBEW-ZPLP1 , "Future Planned Price 1
DWERK TYPE MVKE-DWERK , "Delivering Plant (Own or External)
END OF TY_MASTER .
*
TYPES : MY_TYPE(20) TYPE C.
*
**---------------------------------------------------------------------*
* Constants Begin with C_ *
**---------------------------------------------------------------------*
*
**---------------------------------------------------------------------*
* Internal tables Begin with IT_ *
**---------------------------------------------------------------------*
* *
DATA : IT_MASTER TYPE STANDARD TABLE OF TY_MASTER,
WA_MASTER TYPE TY_MASTER .
*
DATA : IT_HEADER TYPE TABLE OF MY_TYPE.
*
*
**---------------------------------------------------------------------*
* Data Begin with W_ *
**---------------------------------------------------------------------*
* *
DATA : W_PTH TYPE RLGRAP-FILENAME.
DATA : W_FILE TYPE RLGRAP-FILENAME.
* *
**---------------------------------------------------------------------*
* Field Symbols Begin with FS_ *
**---------------------------------------------------------------------*
* *
* *
**---------------------------------------------------------------------*
* Select Options Begin with SO_ *
**---------------------------------------------------------------------*
*
*
**---------------------------------------------------------------------*
* Parameter Begin with PR_ *
**---------------------------------------------------------------------*
* *
**---------------------------------------------------------------------*
* I N I T I A L I Z A T I O N *
**---------------------------------------------------------------------*
*
*--- Add Header Fields to Header Table ---
*
APPEND 'Material Number' TO IT_HEADER .
APPEND 'Plant' TO IT_HEADER .
APPEND 'BOM Usage' TO IT_HEADER .
APPEND 'Bill Code' TO IT_HEADER .
APPEND 'Alternative BOM' TO IT_HEADER .
APPEND 'Created On' TO IT_HEADER .
APPEND 'Changed On' TO IT_HEADER .
APPEND 'Changed By' TO IT_HEADER .
APPEND 'BOM Status' TO IT_HEADER .
APPEND 'Planned Price' TO IT_HEADER .
APPEND 'Delivery Plant' TO IT_HEADER .
*
IF SY-MANDT = '700'.
W_PTH = 'lkdb01ISDISSoftware DevelopmentsDevelopmentsData FilesSAP DumpsBOM_Available'.
ELSE.
W_PTH = 'C:'.
ENDIF.
*
**---------------------------------------------------------------------*
* A T S E L E C T I O N S C R E E N *
**---------------------------------------------------------------------*
*
*
************************************************************************
* s t a r t o f s e l e c t i o n
************************************************************************
* *
START-OF-SELECTION.
*
*--- Load Data to Internal Table ---
*
* SELECT MAST~MATNR MAST~WERKS MAST~STLAN MAST~STLNR MAST~STLAL MAST~ANDAT MAST~AEDAT MAST~AENAM STKO~STLST
* INTO TABLE IT_MASTER
* FROM MAST
* INNER JOIN STKO ON STKO~STLNR EQ MAST~STLNR
* AND STKO~STLAL EQ MAST~STLAL
* INNER JOIN MARA ON MARA~MATNR EQ MAST~MATNR
* WHERE MARA~MTART LIKE 'ZFG%'
* AND STKO~LKENZ NE 'X'
* AND STKO~LOEKZ NE 'X'
* AND STKO~STLST EQ '1'.
*
**************************************************************************************************************
*
SELECT MAST~MATNR MAST~WERKS MAST~STLAN MAST~STLNR MAST~STLAL MAST~ANDAT MAST~AEDAT MAST~AENAM STKO~STLST MBEW~ZPLP1 MVKE~DWERK
INTO TABLE IT_MASTER
FROM MAST
INNER JOIN STKO ON STKO~STLNR EQ MAST~STLNR
AND STKO~STLAL EQ MAST~STLAL
INNER JOIN MARA ON MARA~MATNR EQ MAST~MATNR
INNER JOIN MBEW ON MBEW~MATNR EQ MAST~MATNR
AND MBEW~BWKEY EQ MAST~WERKS
INNER JOIN MVKE ON MVKE~MATNR EQ MAST~MATNR
WHERE MARA~MTART LIKE 'ZFG%'
AND STKO~LKENZ NE 'X'
AND STKO~LOEKZ NE 'X'
AND STKO~STLST EQ '1'.
*
**************************************************************************************************************
IF SY-SUBRC <> 0.
MESSAGE I014(ZLOAD).
ENDIF.
*
*--- Set Path to Function Module ---
*
CONCATENATE W_PTH SY-DATUM ' - ' 'BOM_AVAILABLE_PLANT.XLS' INTO W_FILE.
*
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = W_FILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = IT_MASTER
FIELDNAMES = IT_HEADER
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_EIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
*
IF SY-SUBRC = 0.
SUBMIT ZI005_MARA_DUMP_SOLIDEAL_N.
MESSAGE I023(ZLOAD) WITH text-001.
ELSE.
MESSAGE I022(ZLOAD) WITH W_FILE. "Errors while downloading.
ENDIF.
*
END-OF-SELECTION.
*
SUBMIT ZI005_MARA_DUMP_SOLIDEAL_N.
* *
***********************************************************************
* E N D O F S E L E C T I O N
************************************************************************
*---------------------------------------------------------------------**
* end of page
**---------------------------------------------------------------------*
 
***********************---------------------****************************
* E N D O F A B A P
***********************---------------------****************************




Reward all helpfull answers

Regards
Pavan 

Reward all helpfull answers

Regards

Pavan

Message was edited by:

Pavan praveen