on 09-26-2012 7:44 AM
is there any other solution other than above mentioned ? please reply if any solution with less development efforts
if you spool no with you then u can use: standard program: RSTXPDFT4 to convert spool to pdf.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhupender,
we can create a smartform or adobe form as a email PDF attatchment, we can send email body also.
check this below code
FORM mail_test.
DATA: lv_fm_name TYPE rs38l_fnam.
DATA: ls_control_parameters TYPE ssfctrlop.
DATA: ls_output_options TYPE ssfcompop.
DATA: st_job_output_info TYPE ssfcrescl,
st_document_output_info TYPE ssfcrespd,
st_job_output_options TYPE ssfcresop.
DATA: default_filename TYPE string.
CLEAR: lv_fm_name.
DATA:
I_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
I_TLINE TYPE TABLE OF TLINE WITH HEADER LINE,
I_RECEIVERS TYPE TABLE OF SOMLRECI1 WITH HEADER LINE,
I_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
I_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE.
DATA:
W_OBJHEAD TYPE SOLI_TAB,
W_CTRLOP TYPE SSFCTRLOP,
W_COMPOP TYPE SSFCOMPOP,
W_RETURN TYPE SSFCRESCL,
W_DOC_CHNG TYPE SODOCCHGI1,
W_DATA TYPE SODOCCHGI1,
W_BUFFER TYPE STRING.
DATA:
V_FORM_NAME TYPE RS38L_FNAM,
V_LEN_IN LIKE SOOD-OBJLEN,
V_LEN_OUT LIKE SOOD-OBJLEN,
V_LEN_OUTN TYPE I,
V_LINES_TXT TYPE I,
V_LINES_BIN TYPE I.
DATA: v_bin_filesize TYPE i.
DATA: it_docs TYPE STANDARD TABLE OF docs.
* set control parameters
CLEAR ls_control_parameters.
ls_control_parameters-langu = sy-langu.
ls_control_parameters-no_dialog = 'X'.
ls_control_parameters-getotf = 'X'.
* Determine smartform function module for purchase document
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'mysmartform'
IMPORTING
fm_name = lv_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE: 'error'.
ENDIF.
* print form
CLEAR: st_document_output_info,
st_job_output_info,
st_job_output_options.
CALL FUNCTION lv_fm_name
EXPORTING
control_parameters = ls_control_parameters
output_options = ls_output_options
user_settings = 'X'
IMPORTING
document_output_info = st_document_output_info
job_output_info = st_job_output_info
job_output_options = st_job_output_options
TABLES
t_gvn = gt_table
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
***convert otf
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
bin_filesize = v_bin_filesize
TABLES
otf = st_job_output_info-otfdata
doctab_archive = it_docs
lines = i_tline
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
LOOP AT i_tline.
TRANSLATE i_tline USING '~'.
CONCATENATE w_buffer i_tline INTO w_buffer.
ENDLOOP.
TRANSLATE w_buffer USING '~'.
DO.
i_record = w_buffer.
APPEND i_record.
SHIFT w_buffer LEFT BY 255 PLACES.
IF w_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
REFRESH :
i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR w_objhead.
i_objbin[] = i_record[].
DESCRIBE TABLE i_objbin LINES v_lines_bin.
i_objtxt = 'Smartform output'.
APPEND i_objtxt.
i_objtxt = 'Greets,'.
APPEND i_objtxt.
i_objtxt = 'sm'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
w_doc_chng-obj_name = 'Smartform'.
w_doc_chng-expiry_dat = sy-datum + 10 .
w_doc_chng-obj_descr = 'Smart form output'.
w_doc_chng-sensitivty = 'F'.
w_doc_chng-doc_size = v_lines_txt * 255.
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'Smartform'.
CONCATENATE 'smartform output' 'pdf'
INTO i_objpack-obj_descr.
i_objpack-doc_size = v_lines_bin * 255.
APPEND i_objpack.
CLEAR i_reclist.
i_reclist-receiver = 'myMAIL'.
i_reclist-express = 'X'.
i_reclist-rec_type = 'U'.
APPEND i_reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = i_objpack
contents_bin = i_objbin
object_header = w_objhead
contents_txt = i_objtxt
receivers = i_reclist
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.
IF sy-subrc NE 0.
WRITE:/ 'Error When Sending the File', sy-subrc.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
ENDFORM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for suggestion, can you read my requirement again as i said ......
is there any other solution other than Creating smartform/adobe with same content and send that as email attachment? please reply if any solution with less development efforts....
according to your suggestion--- its using smartform only..
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.