2008 Dec 10 10:04 AM
hello friends,
The mail needs to be sent to an internet user ,this is the code i am using.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = lx_docu_data
document_type = 'RAW'
commit_work = lc_checked
TABLES
object_content = li_docu_content
receivers = li_receiver
Am able to send mail directly from SE37 to Transaction SCOT and here i need to start the send process and mail is sent sucessfully. But from the code its not working.
li_receiver -> lw_receiver-receiver = user[at]domain.com
lw_receiver-rec_type = 'U'.
hello friends,
The mail needs to be sent to an internet user ,this is the code i am using.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = lx_docu_data
document_type = 'RAW'
commit_work = lc_checked
TABLES
object_content = li_docu_content
receivers = li_receiver
Am able to send mail directly from SE37 to Transaction SCOT and here i need to start the send process and mail is sent sucessfully. But from the code its not working.
li_receiver -> lw_receiver-receiver = user[at]domain.com
lw_receiver-rec_type = 'U'.
2008 Dec 10 10:08 AM
below u have 2 option for doing this..
1.bdc program of scot
2.submit standard report
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = objpack
contents_txt = objtxt[]
contents_bin = so_ali[]
*contents_hex = so_ali[]
receivers = 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 = 0.
PERFORM mail.---1 option
MESSAGE 'Mail sent successfully' TYPE 'S'.
or
SUBMIT RSCONN01 WITH MODE = INT.----or 2option
ENDIF.
FORM mail .
PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=PDIA'.
PERFORM bdc_dynpro USING 'SAPLSX10' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'SXJOBDATA-ADDR_TYPE'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ADRTP'.
PERFORM bdc_field USING 'SXJOBDATA-ADDR_TYPE'
'INT'.
PERFORM bdc_field USING 'SXJOBDATA-MAXJOBS'
'1'.
PERFORM bdc_dynpro USING 'SAPLSX10' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'SXJOBDATA-ADDR_TYPE'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=OK12'.
PERFORM bdc_field USING 'SXJOBDATA-ADDR_TYPE'
'INT'.
PERFORM bdc_field USING 'SXJOBDATA-MAXJOBS'
'1'.
PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'02/03'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BACK'.
CALL TRANSACTION 'SCOT' USING bdcdata
MODE 'N'
UPDATE 'S'.
ENDFORM.
2008 Dec 10 10:09 AM
You need to use COMMIT WORK.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_docdata
put_in_outbox = c_x
commit_work = c_x
TABLES
packing_list = t_objpack
object_header = t_objhead
contents_bin = t_objbin
contents_txt = t_objtxt
receivers = t_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 EQ 0.
COMMIT WORK AND WAIT.
ENDIF.
2008 Dec 10 10:10 AM
you can put your mailid SCOT code and try it.
in my case aslo , not working in 100 and itworking in 210
2008 Dec 10 10:14 AM
HI,
Refer to this link...
https://www.sdn.sap.com/irj/scn/forums.
MOVE: l_email TO l_reclist-receiver,
'U' TO l_reclist-rec_type.
APPEND l_reclist TO li_reclist.
DESCRIBE TABLE li_objtxt LINES l_lines.
READ TABLE li_objtxt INTO l_objtxt INDEX l_lines.
l_docdata-doc_size = ( l_lines - 1 ) * 255 + STRLEN( l_objtxt ).
CLEAR l_objpack-transf_bin.
l_objpack-head_start = 1.
l_objpack-head_num = 0.
l_objpack-body_start = 1.
l_objpack-body_num = l_lines.
l_objpack-doc_type = 'RAW'.
APPEND l_objpack TO li_objpack.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = l_docdata
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = li_objpack
contents_txt = li_objtxt
receivers = li_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 EQ 0.
SUBMIT rsconn01
WITH mode = 'INT'
WITH output = ''
AND RETURN.
ELSE.
l_errflag = 'X'.
ENDIF.
ENDIF.
2008 Dec 10 11:00 AM
I have tried the above solutions but none of them seems to be working , the sy-subrc is 0 but mail is not sent not even to SCOT transaction.
2008 Dec 10 12:04 PM
The same code is working for reports and mail is sent but it is not working for BADI.
Can any one help me?
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |