‎2016 Jul 15 6:26 AM
Hi all
I have an requirement from client for sending mail through smartform, and pdf should be sent to desired person ,
i made use of below FM and OTF FM also for PDF creation.But my problem is when i un the program mail is not sent
directly. I need to go to scot transaction then after press execute button mail is sended .i want this process as direct.
Please help me in this regard,if anyone has solution.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
contents_bin = i_objbin
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 <> 0.
WRITE:/ 'Error When Sending the File', sy-subrc.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
‎2016 Jul 15 6:37 AM
You have to Ask basis person, Some configuration may be there, i faced this one.
Ask basis person, I hope there is no Default Settings in Fm.
‎2016 Jul 15 6:30 AM
Di you check this https://wiki.scn.sap.com/wiki/display/Snippets/Send+mail+via+SAP+ABAP+Code
This should be added i think.
IF SY-SUBRC EQ 0.
COMMIT WORK.
* Push mail out from SAP outbox
SUBMIT RSCONN01 WITH MODE = 'INT' AND RETURN.
ENDIF.
‎2016 Jul 15 6:35 AM
Hi Abhijeet
The problem is not your code.
You need to set-up the email schedule job
SE36 - Create job: SAPCONNECT_INT_SEND
STEP: USER = BATCH
PROGRAM NAME: RSCONN1
VARIANT: (Create variant as per SE38 for this program)
SCHEDULE JOB to run every 5 minutes
Release the job.
Regards
Arden
‎2016 Jul 15 6:37 AM
You have to Ask basis person, Some configuration may be there, i faced this one.
Ask basis person, I hope there is no Default Settings in Fm.