01-30-2008 10:51 AM
Hi ABAPers,
I want to create multiple spool outputs programatically, How do i do that??
Requirement: I am looping at an internal table to display its contents. Everytime the material number field changes there should be a separate spool output created.....
As far as i have searched the NEW-PAGE PRINT ON statement creates a separate spool but i dont want to print the contents of the spool but want to email that contents as an attachment... I need ideas as to how i can create separate spools
Any advice....
Thanks & Regards,
Prakash
01-30-2008 10:56 AM
1st create the spool, convert it to pdf and then u can send it as a mail attachment
use that spool to convert it to PDF and then download it
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
RQIDENT = GS_OTF_SPOOLS-RQIDENT
TABLES
BUFFER = GT_TEMP_TABLE
EXCEPTIONS
NO_SUCH_JOB = 1
JOB_CONTAINS_NO_DATA = 2
SELECTION_EMPTY = 3
NO_PERMISSION = 4
CAN_NOT_ACCESS = 5
READ_ERROR = 6
TYPE_NO_MATCH = 7.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
USE_OTF_MC_CMD = 'X'
IMPORTING
BIN_FILESIZE = SIZE
TABLES
OTF = GT_OTF_TABLE
DOCTAB_ARCHIVE = DOC
LINES = GT_PDF
EXCEPTIONS
ERR_CONV_NOT_POSSIBLE = 1
ERR_OTF_MC_NOENDMARKER = 2
OTHERS = 3.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
U can also use the standard pgm RSTXPDFT4
Award points
Narendra
01-30-2008 11:05 AM
Hi narendra,
I think u didnt get my doubt... My doubt was how to create the spool..
For example: Lets say i have the following set of write statements
LOOP AT i_tab into wa_tab.
AT NEW matnr.
WRITE:/ wa_tab-matnr.
WRITE:/ wa_tab-maktx.
.
.
.
.
ENDAT.
ENDLOOP.
My doubt is how do i program such that each time it loops there is a separate spool created??
Is there a statement for that??
01-30-2008 10:59 AM
at change of material no
u need to close the form using close_form FM
and need to open the form using open_form FM
Madhavi
01-30-2008 11:10 AM
Hi madhavi,
Does the 2 function modules just create a spool output without doing any kind of printing or asking for any sort of printing parameters???
Also can you throw light on wat JOB_OPEN & JOB_CLOSE does??? Is it anything similar??
Thanks & Regards,
Prakash
Edited by: Prakash K on Jan 30, 2008 12:23 PM