09-25-2006 1:53 PM
Hey Guys,
I have a requirement while creating Billing Document. When the billing document is created automatically the mail should be sent to particular user. Is there any standard option available. Please help.
Regards,
Shankar
09-25-2006 2:00 PM
I guess we can create an output type ( As we do for scripts ), write a Driver program reading the details of the document, created spool, and convert that to pdf , and mail it.
Regards
Srikanth
09-25-2006 7:00 PM
If your SAP system is enabled with an email SXC connection, you can configure your output for billing documents in VV32 with a medium of 5 for External Send and time of 4 for immediate. As long as the bill to party's customer master data contains an email address the output should be sent as pdf. As long as the output type is configured in NACE for external sends.
09-26-2006 5:21 AM
For converting to PDF this particular fm is used,check it out it may help u.
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
Fehlerhandling
if sy-subrc <> 0.
endif.
Regards
09-27-2006 6:25 AM
Hi,
Thanks for your input. I have a SMARTFORMS and Program name. I had assigned the SMARTFORMS and Program name to the message type. When I try to issue the output for a billing document, the SMARTFORMS output should be converted into pdf and sent to email for Sold to party. The email id will be maintained in the customer master (Sold to Party). Please help.
Regards,
Shankar
09-27-2006 6:40 AM
Need to set fields getotf and no_dialog of structure <b>control_parameters</b> to X and tdnoprev of strcuture <b>output_options</b> to X of smartform FM.Then you will get OTF format in the table OTFDATA of the structure job_output_info of Smartform FM. Pass the output to CONVERT_OTF to get PDF format.
Regards,
Arun.
09-27-2006 6:46 AM
I think u have to maintain that once u create the dcoument.For sending the mail check the code it may help u.
FORM send_mail USING p_y16m_rcp_par STRUCTURE y16m_rcp_par.
Have a subject for the mail
g_s_document_data-obj_name = text-t02.
g_s_document_data-obj_descr = text-t03.
Fill receiver information
g_s_receivers-rec_type = p_y16m_rcp_par-rec_type.
g_s_receivers-rec_id = p_y16m_rcp_par-rec_id.
g_s_receivers-express = 'X'.
APPEND g_s_receivers TO g_t_receivers.
Call function to send mail
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = g_s_document_data
document_type = 'RAW'
PUT_IN_OUTBOX = ' '
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
OBJECT_HEADER =
object_content = g_t_object_content
CONTENTS_HEX =
OBJECT_PARA =
OBJECT_PARB =
receivers = g_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
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " SEND_MAIL
Regards
09-27-2006 7:48 AM
Hi,
I had implemented the coding for converting to OTF and then converting from OTF to PDF and then i implemented the function module for downloding the pdf file in hard drive. But I enconter the following error.
<b>OTF end command // missing in OTF data</b>
Please help.
Regards,
Shankar
09-27-2006 7:54 AM
09-27-2006 7:57 AM
Hi,
The following code were used in the program. please help.
call function 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
IMPORTING
BIN_FILESIZE = P_BIN_FILESIZE
BIN_FILE = P_BIN_FILETYPE
TABLES
otf = P_OTF
lines = P_LINE.
Regards,
Shankar