Spool file for Mass printing of smartforms
Hi all..
My requirement is as follows...
Once the selected population is established, the new program would select all those Development Plans and <b>create a spool file</b> of all the printable formats (using the same smartform as the individual form print). This spool file would then print to the printer selected by the user on the selection screen. This would need to be run in the background, as it is expected it would have a long run time.
can any body tel me clearly how to approach this requirement,
any sample code for spool file creation in this case../??
Regards,
Kalam A.
Hi all..
My requirement is as follows...
Once the selected population is established, the new program would select all those Development Plans and <b>create a spool file</b> of all the printable formats (using the same smartform as the individual form print). This spool file would then print to the printer selected by the user on the selection screen. This would need to be run in the background, as it is expected it would have a long run time.
can any body tel me clearly how to approach this requirement,
any sample code for spool file creation in this case../??
Regards,
Kalam A.
Similar Messages
-
Creating spool file for Mass printing of smartforms
Hi all
My requirement is Mass printing of Development Plans,
In this case is i need to select all the smartforms depending upon the selection screen data.& i need to pass all the smartforms to newly created spool file..
how should I use TSP01 & Function Module 'GET_PRINT_PARAMETERS' for this smartform spool.
so can any body explain me in detail..
How to create spool ID, ?
how to create spool file in this case..??
How to pass smartform data to that new spool file../??
Any sample codes for this ./??
Thanx in advance,
Regards,
Kalam A.Check the links -
Re: How to create a spool?
How to create a spool request
Regards,
Amit
Reward all helpful replies. -
How to print multiple form for tag printing in smartforms
Dear Experts,
I am working on tag printing in smartforms .in tag printing i am showing
1.material no.
2.material descrption.
3.material doc no.
4.Quantity
5.supplier.
my requirement is that for example , if the mat. document no. has a material of 10,000.00 quantity , in tag printing it should come 1,000.00 of each tag and total no of tag should be 10. and it should come one after another .
and the page format size 8 x 6 cm. is it possible .if possible how ! how the system will know how many tag is to be printed . please reply its urgent.Hi Kumar,
Let me know. is the quantity 1000.00 is fixed? if so thn you can achieve the requirement.
For example:
There are A-material with 20000.00 quantity thn u can first divide the quantity with 1000.00
v_ex = 20000.00/1000.00=20.
thn you can repeat the print of the smartform for 20 times by passing the parameter to form fm.
Please reward if useful. -
InDesign PS file for booklet printer spreads
The PS file InDesign CS6 generated to use to import into Acrobat for printer spreads has pixelated halftones. Is this a problem with InDesign CS6? Does it contain a post script driver?
Are the links up to date? Are you using the ADPDF9 PPD for the printer description file? You need to install that yourself.
-
Creating InDesign files for both print and mobile output?
I am looking for a way to create files that can be multi-purpose for both print and mobile/online environments. I would like the output to be 2 different PDFs from one set of Indesign files. The problem I am encountering is that currently my files are full of hi-res and vector graphics, effects, and are generally created to be optimized for large-scale printings on offset or digital presses. I am trying to use the same files to generate files that are optimized for mobile and online presentation but finding that the number of vector graphics specifically is slowing page display down.
My initial reaction is that the solution would have to be dual-development. Multiple forms of 'master graphics' would have to be created and placed on multiple layers (one for print and one for mobile/online).
Hi-res files could be made lo-res in Acrobat or Pitstop, but vector imagery would have to be rasterized and I am not aware of a method to do that in either of those programs.
I have found some info on adobe.com leading me to think that maybe CS6 addresses some of this, but the majority of my work is being done in CS4 with only the bleeding edge being done in CS5.
Thanks in advance for any insight.the output to be 2 different PDFs from one set of Indesign files.
You can accomplish this by saving each PDF using a different preset - High Quality Print for the high res, smallest file size for web
but vector imagery would have to be rasterized...
You should be trying to keep all vector work as vectors. This, in most cases, lowers the file size. There are a couple of exceptions to that like if the vectors are very complex (layered etc) and you are using bitmap effects like drop shadows. In general, rasterizing will increase the file size and lower the quality.
Is there any functional difference between the 2 PDFs? I am wondering why exporting using 2 different presets will not do the job efficiently enough. You could always save your linked images with a low res version - same file but make a copy 100dpi instead of 300dpi. This might help but InD normally downsamples the images anyway when exporting as smallest file size.
EDIT:// In Acrobat, you can save as "Reduced Size PDF" which strips out all the meta data etc and makes the PDF lighter and faster for web use. This would be a final, before publishing online step. -
Workflow for creating files for online printing
I recently asked a question about making a copy of a file in Aperture 2 but am still unsure as to the best method to use. The original is cropped for posting to the web, and the duplicate is to be cropped for standard print sizes. I didn't quite get a clear answer, so I wanted to ask what other users' workflow is for preparing images for printing at an online site (I use adorama, which has an aperture plugin). In my case, my "ideal" crop, posted to a mobile me gallery, is not a standard size, but I do want the print to be a standard size. How do you keep the preferred crop for viewing online but change to a standard crop for printing?
Thanks,
Johnsize is mort important than format. I prefer PSD files, but png, tiff, tga, even jpeg if you do not need transparency. Just make them big enough that at some point in your composition they are scaled to 100%. IOW, if you are drawing full frame animation cells for HD they do not need to be any bigger than 1920 X 1080 pixels. If you are going to scale them up or move in on some details then the area you are going to be pushing in on needs to be 1980 X 1920.
-
Getting only one spool number for every print out
hi guys,
when i execute my customize program i suppose to get a form in my screen, showing customer statement, when I exicute customer A out put as expected with 5 pages but after that if i exicute customer B which is supposed to be 3 pages but I am getting 8 pages which is including first out put also, its repeating same spool number for every thing and keep on adding every page , please let me know where to see for this ??
for spool request RS38L_FNAM
and to display 'COM_SE_SPOOL_DISPLAY'Change ur table declaration as shown below, replace the word <b>TYPE</b> with <b>LIKE</b>
DATA: BEGIN OF i_final OCCURS 0,
srno TYPE i, " Serial no
anln1 LIKE anla-anln1, " asset code no
txt50 LIKE anla-txt50, " Brief Description of Assets
txa50 LIKE anla-txa50, " Further Description
ktogr LIKE anla-ktogr, " Asset Class No.
ktgrtx LIKE t095t-ktgrtx, " Asset Class Name
sernr LIKE anla-sernr, " Serial Number
invnr LIKE anla-invnr, " Assets Identification No
menge LIKE anla-menge, " Qty
meins LIKE anla-meins, " UOM
raumn LIKE anlz-raumn, " Location
lifnr LIKE anla-lifnr, " Vendor
liefe LIKE anla-liefe, " Capitalisation Date
aktiv LIKE anla-aktiv, " Date put to use
g_kansw LIKE anlc-kansw, " Opening Gross Block
b_kansw LIKE anlc-kansw, " Additions during the period
b_answl LIKE anlc-answl," Deductions/ Adjustmentsduring d period
g_total LIKE bsis-dmbtr, " Closing Gross Block
d_open LIKE anlb-afabg, " Dep on opening block
d_sold LIKE anlb-afabg, " Dep on assets sold/written off
d_add LIKE anlb-afabg, " dep on additions during the period
afabg LIKE anlb-afabg, " Total dep for the period
cd_sold LIKE bsis-dmbtr, " *** Dep on assets sold
cd_asst LIKE bsis-dmbtr, " *** Dep on assets written off
cd_dep LIKE bsis-dmbtr, " Total *** dep on deductions
ccd_dep LIKE bsis-dmbtr, " Closing Acc Dep
a LIKE bsis-dmbtr, " WDV of assets sold
b LIKE bsis-dmbtr, " Selling Price
c LIKE bsis-dmbtr, " Profit / (Loss) on sale
d LIKE bsis-dmbtr, " Loss on write off
e LIKE bsis-dmbtr, " Opening WDV
f LIKE bsis-dmbtr, " Closing WDV
END OF i_final. -
Hi,
Exepets I have one requirement for smartform i want to print smartform bulk with same layout .Please give me advisedata: copies like ssfcompop-tdcopies.
start-of-selection.
copies = 5.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
FORMNAME = 'ZAPP_FOAM'
IMPORTING
FM_NAME = fm_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 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.
call function fm_name
exporting
OUTPUT_OPTIONS = copies
TABLES
ITAB = ITAB
T_ADRS = T_ADRS
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5 .
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
thanks
saurabh -
New spool file on new window in smartform
Is it possible to create a new spoolfile, with a new spoolid, when a specific page(window) is triggered in a smartform?
For example: every time page FIRST is triggered an new spoolfile is to be created.as far as I know, it is not possible to make separate spools within a single smartform print . A call to smartforms printing will contribute to 1 spool (or appending an existing spool) irregardless of how many pages it is going to print.
-
How to print Spool requests for cheque printing sequentially
Dear All,
I am making vendor payments and printing cheques using F-58. It automatically creates a spool requests at the end of the transaction. When i complete all my payments and go to SP01 for viewing spool requests, the last request appears at the top of the list.
If i select 3 consecutive requests and print them at a time, the last request gets printed first on the first cheque number and the first request gets printed on the last cheque number.
This results in anomaly in the cheque number assigned in the system and the printed cheque as the last payment is printed on the first cheque.
I am using dot matrix printer with page format fixed for cheque specifications. The cheques are printed properly as per the format except the order of printing.
Kindly let me know how to print multiple requests sequentially from the spool requests list such that the spool request number printed matches with the serial cheque numbers.
Regards,
SAP_2009Hi,
I understod your issue.
Whenever you posted multiple payment documents, and after that if you want to take cheque printouts sequentially by using more spool requests.........there is a way to sort out this issue.
1) Select all of your spool requests and click on Sort in ascending Order (CtrlShiftF5) and click on Print directly (CtrlShiftF8). By doing this you will get the cheque printouts sequentially according to your payment document sequence.
Hope this will help you
Assign ********, if it solved your problem.
Thanks,
Srinu -
Deploying the fop.war file for PDF printing
I suppose this should maybe be in the App server thread but im following instructions from here to enable PDF printing in APEX
http://www.oracle.com/technetwork/developer-tools/apex/application-express/configure-printing-093060.html#05
The instructions are a bit out of date but
I navigate to the OC4J home > select applications > Deploy WAR file
browse for the fop.war file on local machine
for Application Name i have ApexFOP
for Map to URL I have /apex/fop
then I click Deploy
it says succesfully loaded but when I click on the ApexFOP in the Deployed applications list it says not loaded
I have re-started the OC4J
any help would be very gratefully recieved , I'm going nuts trying to do this
CheersI copied an existing working structure and this worked for me.
-
Splitting the Spool Request for Form Printing
Hello,
I have a requirement where I need to print data for 1500 employees (1 Page per employee) which makes 1500 pages per spool request. Now, there is a change in the printer due to which the printer only accepts only 300 pages in the buffer. So, after printing 300 pages, it stops. Is there any way I can split the spool request and generate 5 spool requests (1 request for every 300 pages) so that all the pages are printed at once? Please let me know.
Regards,
Venkata Phani Prasad Kondurii have created a program using which you can create multiple pdf from a single spool number
first in the code below i have taken a spool number which has 2 pages in it.
second you must use the FM : RSPO_RETURN_SPOOLJOB in the program to get the content of the spool . while to perform analysis on how to build logic to split the spool otf/pdf user the FM RSPO_DISPLAY_SPOOLJOB, here by passing the spool number you will get the content in display mode and then based on the keyword you will build logic for e.g in my case i have to perform segregation based on material number so it can be used to decide how many pages are reserved by a specific material number.
another important point to kept in mind is that otf begins with "//" and a page ends with "EP" and last page ends with "//" along with "EP". It can be used to remove the number of lines to keep specific pages .
program layout as with proper documentation has been provided.
REPORT zdk_spool_split.
* DATA DECLARATION.
TYPES : tbuf LIKE tline OCCURS 1.
FIELD-SYMBOLS: <buf> TYPE tbuf.
FIELD-SYMBOLS : <lit_otf> TYPE ANY TABLE.
DATA : lit_otf TYPE STANDARD TABLE OF itcoo.
DATA : objcont LIKE soli OCCURS 0 WITH HEADER LINE.
DATA : format(5) TYPE c, dummy TYPE i.
DATA : buffer_pdf TYPE STANDARD TABLE OF tline.
DATA : p_file LIKE rlgrap-filename VALUE 'C:\temp\file1.pdf'. "#EC NOTEXT
DATA : numbytes TYPE i VALUE 255.
DATA : cancel.
DATA : otfcmd LIKE itcoo VALUE '//'.
DATA : pdfcnv_archive_index LIKE toa_dara.
DATA : bin_file TYPE xstring,
pdf_username TYPE c.
* GET THE SPOOL NUMBER FROM THE USER.
PARAMETERS : p_sid TYPE tsp01-rqident OBLIGATORY.
* GET THE CONTENT OF THE SPOOL NUMBER
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = p_sid
TABLES
buffer = objcont
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
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* INCORPORATE YOUR LOGIC TO DELETE LINES WHICH ARE NOT REQUIRED.
* IN MY CASE I HAVE REMOVED LINES FROM 351 TO 715 TO REMOVE THE SECOND PAGE FROM MY SPOOL
* MY OBJCONT AFTER DELTED BEGINS WITH "//" AND ENDS WITH "EP" AND "//"
DELETE objcont[] FROM 351 TO 715.
* IT ONLY CONTAINS ONE PAGE OUT OF 2 PAGES FROM THE SPOOL NUMBER I HAVE PROVIDED.
* CONVERT OTF TO PDF
lit_otf = objcont[]. " GET THE OTF IN CORRECT OTF FORMAT
ASSIGN buffer_pdf TO <buf>.
format = 'PDF'. " CHOOSE THE CORRECT FORMAT IE PDF MUST FOR CONVERSION
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = format
IMPORTING
bin_filesize = dummy
TABLES
otf = lit_otf
lines = <buf>
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc IS NOT INITIAL.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* GET THE NUMBYTES OF THE PDF CONTENT OBTAINED AFTER THE CONVERSION
* CORRECT NUMBYTE IS VERY IMPORTANT OTHERWISE IT WILL NOT GENERATE
* PDF IN CORRECT FORMAT.
PERFORM convert_otf2pdf_end(rstxcpdf) TABLES <buf>
USING otfcmd
numbytes
pdfcnv_archive_index
bin_file
pdf_username.
* NOW DOWNLOAD THE PDF TO VIEW IN ACTUAL PDF AT DESIRED PATH
PERFORM download_w_ext(rstxpdft) TABLES <buf>
USING p_file
'.pdf'
'BIN'
numbytes
cancel. -
TNAPR Entries for a Print Prog & SMARTFORM?
I am thinking NO. Because I have the print program and SMARTFORM linked in NACE/NACT. When I put the SMARTFORM name in TNAPR, it puts it in the Formname (not the SMARTFORMname) in NACT.
So I am assuming that as long as the SAMRTFORM is linked to the Print Program in NACE/NACT this config should work. Nothing in TNAPR is needed.
Can anyone confirm?
Thank-You.Hi,
If you maintain NACE entries correctly, then you can see them in TNAPR.
Do NOT Confuse FORM name with the smartform name.
Here FORM means the subroutine name in which the abap code is written.
Regards,
Ravi -
REQUIRE One spool request for n copies in one print command in smartform
Hii Friends,
I created a smartform..I require 5 copies of that form..There is a text which needs to be changed in evry copies...eg Original in first copy
Duplicate in second copy
Triplicate in third copy....n so on
So i used a loop n i am calling smartform 5 times....The problem is i need one spool request to be created..
Note: By default sometimes it create one spool request and sometimes 3 spool request...
Pls share your inputs ............
Thanks,
Regards,
Sujit.hi,
this is more complicated see below description from help
regards,darek
Printing Several Forms in One Print Request
Use
You want to bundle several forms into one print job.
Print Request vs. Spool Request
SAP Smart Forms allows you to bundle several forms to form one output unit. This output unit is called a print request. A print request is different from a spool request:
Whether a new spool job is created in the spool depends on the settings in the spool dialog.
Whether a new print request starts depends on the standard parameters of the generated function module you set in SAP Smart Forms. For each print request, the spool dialog is called only once. If you suppress the dialog, you can pass parameters for spool processing only at the beginning of the print request.
This means that a print request gathers several forms before submitting them to spool processing. Thus they cannot be spread over several spool requests. Vice versa however, you can include several print requests into one spool request.
Procedure
Use function module SSF_FUNCTION_MODULE_NAME to retrieve the name of the function module generated from the Smart Form (see also: Integrating the Smart Form Into the Application).
Call the Smart Form for the first time and set the NO_CLOSE parameter of the control structure. This prevents the print request from being closed after accepting the output of the Smart Form and allows you to include all other form output into this print request as well. Leave the NO_OPEN parameter empty.
Instead of calling the Smart Form for the first time you can also call function module SSF_OPEN .
If you want to start a new spool request for the print request, set the TDNEWID field of the Output Options in this first call.
For all other form output of the application program that you want to include into the print request, use a loop to set both the NO_OPEN field and the NO_CLOSE field of the control structure.
To close the print request, in the call of the last Smart Form set the NO_OPEN parameter and unmark the NO_CLOSE parameter.
Instead of calling the Smart Form for the last time, you can also call function module SSF_CLOSE .
Result
The forms you called in the steps described above are included into one print request. If in the first step you started a new spool request, you can now view its status in the spool request overview (transaction SP01 ). -
Mass printing of spool requests
Hi,
Is it possible to program the triggering of the printing of a PDF document contained in a spool request ? ( the goal is to have the possibility for mass printing )
thanks,
RolfHi rolf here is the program to convert to PDF and mail it .
*& Report ZSPOOLTOPDFT *
*& Converts spool request into PDF document and emails it to *
*& recipicant. *
*& Execution *
*& This program can be run in background or online and a spool request *
*& will still be created *
report zspooltopdft .
parameter: p_email1 like somlreci1-receiver
default 'sandeep2jinnagmailcom',
p_delspl as checkbox,
p_online no-display.
*DATA DECLARATION
data: gd_recsize type i.
Spool IDs
types: begin of t_tbtcp.
include structure tbtcp.
types: end of t_tbtcp.
data: it_tbtcp type standard table of t_tbtcp initial size 0,
wa_tbtcp type t_tbtcp.
Job Runtime Parameters
data: gd_eventid like tbtcm-eventid,
gd_eventparm like tbtcm-eventparm,
gd_external_program_active like tbtcm-xpgactive,
gd_jobcount like tbtcm-jobcount,
gd_jobname like tbtcm-jobname,
gd_stepcount like tbtcm-stepcount,
gd_error type sy-subrc,
gd_reciever type sy-subrc.
data: w_recsize type i,
w_spool_nr like sy-spono.
%_print LIKE pri_params.
data: gd_subject like sodocchgi1-obj_descr,
it_mess_bod like solisti1 occurs 0 with header line,
it_mess_att like solisti1 occurs 0 with header line,
gd_sender_type like soextreci1-adr_typ,
gd_attachment_desc type so_obj_nam,
gd_attachment_name type so_obj_des.
Spool to PDF conversions
data: gd_spool_nr like tsp01-rqident,
gd_destination like rlgrap-filename,
gd_bytecount like tst01-dsize,
gd_buffer type string.
Binary store for PDF
data: begin of it_pdf_output occurs 0.
include structure tline.
data: end of it_pdf_output.
constants: c_dev like sy-sysid value 'DEV',
c_no(1) type c value ' ',
c_device(4) type c value 'LOCL'.
*START-OF-SELECTION.
start-of-selection.
Write statement to represent report output. Spool request is created
if write statement is executed in background. This could also be an
ALV grid which would be converted to PDF without any extra effort
write 'Hello World'.
new-page.
commit work.
new-page print off.
if p_online = 'X'.
Processing performed when program calls itself when run online
gd_spool_nr = sy-spono.
export gd_spool_nr to memory id 'SPOOLTOPDF'.
exit.
endif.
if sy-batch eq 'X'.
perform get_job_details.
perform obtain_spool_id.
else.
gd_spool_nr = sy-spono.
If executed online, it submits a program to perform the write statements
instructing it to create a spool request, this could be another program
which just performs the write statements and then exports sy-spono
to memory. But in this example it calls itself passing X to parameter
p_online, which takes it down an alternative procesing path.
submit zspooltopdf2
with p_online = 'X'
to sap-spool
spool parameters %_print
archive parameters %_print
without spool dynpro
and return.
endif.
Get spool id from program called above
import gd_spool_nr from memory id 'SPOOLTOPDF'.
perform convert_spool_to_pdf.
perform process_email.
if p_delspl eq 'X'.
perform delete_spool.
endif.
if sy-sysid = c_dev.
wait up to 5 seconds.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
FORM obtain_spool_id *
form obtain_spool_id.
check not ( gd_jobname is initial ).
check not ( gd_jobcount is initial ).
select * from tbtcp
into table it_tbtcp
where jobname = gd_jobname
and jobcount = gd_jobcount
and stepcount = gd_stepcount
and listident <> '0000000000'
order by jobname
jobcount
stepcount.
read table it_tbtcp into wa_tbtcp index 1.
if sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
message s004(zdd) with gd_spool_nr.
else.
message s005(zdd).
endif.
endform.
FORM get_job_details *
form get_job_details.
Get current job details
call function 'GET_JOB_RUNTIME_INFO'
importing
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
exceptions
no_runtime_info = 1
others = 2.
endform.
FORM convert_spool_to_pdf *
form convert_spool_to_pdf.
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
importing
pdf_bytecount = gd_bytecount
tables
pdf = it_pdf_output
exceptions
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
others = 12.
check sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
loop at it_pdf_output.
translate it_pdf_output using ' ~'.
concatenate gd_buffer it_pdf_output into gd_buffer.
endloop.
translate gd_buffer using '~ '.
do.
it_mess_att = gd_buffer.
append it_mess_att.
shift gd_buffer left by 255 places.
if gd_buffer is initial.
exit.
endif.
enddo.
endform.
FORM process_email *
form process_email.
describe table it_mess_att lines gd_recsize.
check gd_recsize > 0.
perform send_email using p_email1.
perform send_email using p_email2.
endform.
FORM send_email *
--> p_email *
form send_email using p_email.
check not ( p_email is initial ).
refresh it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
append it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
append it_mess_bod.
If no sender specified - default blank
if p_sender eq space.
gd_sender_type = space.
else.
gd_sender_type = 'INT'.
endif.
Send file by email as .xls speadsheet
perform send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
endform.
FORM delete_spool *
form delete_spool.
data: ld_spool_nr type tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
check p_delspl <> c_no.
call function 'RSPO_R_RDELETE_SPOOLREQ'
exporting
spoolid = ld_spool_nr.
endform.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
form send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
data: ld_error type sy-subrc,
ld_reciever type sy-subrc,
ld_mtitle like sodocchgi1-obj_descr,
ld_email like somlreci1-receiver,
ld_format type so_obj_tp ,
ld_attdescription type so_obj_nam ,
ld_attfilename type so_obj_des ,
ld_sender_address like soextreci1-receiver,
ld_sender_address_type like soextreci1-adr_typ,
ld_receiver like sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
clear w_doc_data.
read table it_attach index w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + strlen( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
clear t_attachment.
refresh t_attachment.
t_attachment[] = it_attach[].
Describe the body of the message
clear t_packing_list.
refresh t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
describe table it_message lines t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
append t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
describe table t_attachment lines t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
append t_packing_list.
Add the recipients email address
clear t_receivers.
refresh t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
append t_receivers.
call function 'SO_DOCUMENT_SEND_API1'
exporting
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
importing
sent_to_all = w_sent_all
tables
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
loop at t_receivers.
ld_receiver = t_receivers-retrn_code.
endloop.
endform.
Maybe you are looking for
-
Hotsync fails after Microsoft update
I am using a Treo 650 (Sprint) and running WinXP Pro with Outlook 2002. Everything was working just fine until I got a message from Windows indicating that I needed to update Windows for a critical update. After the update I can no longer get my Tr
-
CProjects - How to show purchase order dates in the Gantt chart
We link several types of procurement objects like a purchase order or a production order out of our ERP system to several cProjects tasks. As described in the SAP help we specify the date type in the user settings, e.g. to Basic Dates. With the produ
-
When I try to run the J2EE server, I get an error saying "ERROR executing J2EE server" with the following system.err file: Does anyone know what I need to do ? Thanks. Logging for J2EE Server Version: 1.3.1-b17 started at: Sat Nov 01 11:12:21 EST 200
-
Serious video/audio/screen sharing problems
Ok, I have been researching this forum and all over google for about a week, and I can't figure this out! I can't connect for AV chat or screen sharing. My friend is in Ohio, I am in NJ. We can both connect to the apple tester screen names. She can c
-
How do I get to private mail from the forum?
This forum is really lame. I don't see a way to read my private forum messages. It ought to be on the main forum page. I'm not about to go exploring the entire site to see me messages. This forum sucks as does the entire verizon web site!