CLASS cl_bcs Query for sender mail id
Hi,
I am using class cl_bcs.but, i am facing problem for sender mail-id. I want to append mail-id directly to sernder mail-id without using user mail attribute.
Is there ne way from which i can append mail-id as sender mail id??
thanx in advance,
Sameer
you can do that.
check this code sample.
DATA: sender TYPE REF TO if_sender_bcs.
CLEAR sender .
sender = cl_cam_address_bcs=>create_internet_address( '[email protected]' ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
and check this code sample for complete code.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5931ff64-0a01-0010-2bb7-ff2f9a6165a0
Regards
Raja
Similar Messages
-
Class CL_BCS Query for body part of mail
HI,
I want to send the mail with out attachement using Class CL_BCS. Can any body help me on how to send the message body in the mail using CL_BCS class....
Thanx & Regards,
SameerHi Sameer
I've been struggling with this class CL_BCS too for a while and I want to give my experience with that class. Following a code example which will submit a report to memory and send the report as an attachment by mail thru the SMTP interface.
*& Report ZOBR_SEND_TRIP_SIM_BY_MAIL *
*& This program does following:
*& 1. Submit a travel expense report to memory
*& 2. Read the travel expense report from memory
*& 3. Convert the travel expense report to HTML format
*& 4. Copy the travel expense report from format RAW(1000) to RAW(255)
*& 5. Send an email with body text and attachtments
REPORT zobr_send_trip_sim_by_mail .
DATA:
gi_abaplist TYPE TABLE OF abaplist,
gi_html TYPE w3htmltab,
gs_html LIKE LINE OF gi_html,
gw_string TYPE string,
gw_length TYPE i,
gw_length_c TYPE so_obj_len,
gi_solix TYPE solix_tab,
gs_solix LIKE LINE OF gi_solix,
gi_soli TYPE soli_tab,
gs_soli LIKE LINE OF gi_soli,
go_send_request TYPE REF TO cl_bcs,
go_document TYPE REF TO cl_document_bcs,
go_sender TYPE REF TO cl_sapuser_bcs,
go_recipient TYPE REF TO if_recipient_bcs,
go_exception TYPE REF TO cx_bcs.
* Submit report to memory
SUBMIT rprtef00 "USER sy-uname
EXPORTING LIST TO MEMORY AND RETURN
WITH pnppernr EQ '00001000'
WITH pnptimra EQ 'X'
WITH pnpxabkr EQ 'D2'
WITH pnppabrp EQ '11'
WITH pnppabrj EQ '2006'
WITH s_reisen EQ '0002600221'
WITH hinz_dru EQ space
WITH hinz_weg EQ space
WITH hinz_dyn EQ 'X'
WITH allesdru EQ 'X'
WITH reisepro EQ 'X'
WITH reisetxt EQ 'X'
WITH sw_antrg INCL 'X'
WITH addinfo EQ 'X'
WITH extperio EQ '000'
WITH simulate EQ space
WITH einkopf EQ space.
* Read report from memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = gi_abaplist
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Convert report to HTML format
CALL FUNCTION 'WWW_HTML_FROM_LISTOBJECT'
* EXPORTING
* REPORT_NAME =
* TEMPLATE_NAME = 'WEBREPORTING_REPORT'
TABLES
html = gi_html
listobject = gi_abaplist.
LOOP AT gi_html INTO gs_html.
CONCATENATE gw_string
gs_html
INTO gw_string.
ENDLOOP.
gw_length = STRLEN( gw_string ).
gw_length_c = gw_length.
* copy table from format raw(1000) to raw(255)
CALL FUNCTION 'TABLE_COMPRESS'
TABLES
in = gi_abaplist
out = gi_solix.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
TRY.
* Create persistent send request
go_send_request = cl_bcs=>create_persistent( ).
* Create document (body text in text format)
gs_soli = 'Trip is now settled, see attachment.'.
APPEND gs_soli TO gi_soli.
gs_soli = 'Reimbursement is paid out by your next salary.'.
APPEND gs_soli TO gi_soli.
go_document = cl_document_bcs=>create_document( i_type = 'RAW'
i_text = gi_soli
i_subject = 'Trip reimbursement' ).
* Add attachment (ABAP list format)
CALL METHOD go_document->add_attachment
EXPORTING
i_attachment_type = 'ALI'
i_attachment_subject = 'Expense report(ALI)'
i_att_content_hex = gi_solix.
* Add attachment (HTML format)
CALL METHOD go_document->add_attachment
EXPORTING
i_attachment_type = 'HTM'
i_attachment_subject = 'Expense report(HTM)'
i_att_content_text = gi_html.
* Add note (Text format)
CALL METHOD go_send_request->set_note( gi_soli ).
* Add document to send request
CALL METHOD go_send_request->set_document( go_document ).
* Get sender object
go_sender = cl_sapuser_bcs=>create( sy-uname ).
* Add sender
CALL METHOD go_send_request->set_sender
EXPORTING
i_sender = go_sender.
go_recipient = cl_cam_address_bcs=>create_internet_address( '[email protected]' ).
* Add recipient with its respective attributes to send request
CALL METHOD go_send_request->add_recipient
EXPORTING
i_recipient = go_recipient
i_express = ' '
i_copy = ' '
i_blind_copy = ' '
i_no_forward = ' '.
* set send immediately flag
go_send_request->set_send_immediately( 'X' ).
* Send document
CALL METHOD go_send_request->send( ).
COMMIT WORK.
* Exception handling
CATCH cx_bcs INTO go_exception.
EXIT.
ENDTRY.
Notice that the only way to put a body text in the email is to call the method cl_document_bcs=>create_document with input of a type 'RAW'.
Be aware of the settings of the SMTP node in SAPConnect (transaction SCOT) because the seetings could cource an unwanted conversion of the email.
1. Doubbelclick on the TMTP node and a popup screen will show.
2. Click on the 'Set' button next to 'Internet' under 'Supported address type' and a popup screen will show.
3. Set output format for SAP documents as 'SAPscript/Smart forms' = 'PDF', 'ABAP list' = 'PDF', 'RAW text' = 'TXT'.
This setting will convert 'SAPscript/Smartforms', 'ABAP list' to PDF format. If 'RAW text' = 'PDF' the body text wil be converted to 'PDF' format and change to an attachment and the body text will disappear.
Hope this is usefull for you and others.
Best regards
Ove Bryntesson
Applicon A/S -
How to create distribution list in workflow? for sending mail or work-item
Hi,
How to create distribution list in workflow? for sending mail or work-item to multiple users.
Regards,
SurjithHi Surjith,
A.Working with Distribution Lists Creating a Distribution List.
1 Businees Workplace->shared folder - create new subfolder name = WF_distributor
2.Then click on the distribution list in Businees Workplace.
say create Name = WF_Vliste
folder Name = WF_distributor
3.distribution list content tab
Enter Recipient (SAP User ID)
B.Wrkflow Builder
Find out the dialig step in which u want to use distribution list
Use workflow Rule 30000012 (SWX_READ_DLI).
Maintain the binding from workflow container to rule container.
Just pass the name of the distribution list from WF to Rule container.
Regards
Sagar S -
I've checked all through the forum and can't find an answer, so I hope this is not a repeat...
Is there a way to have a different sound (that I choose) play for sending mail versus receiving mail? I can change the incoming sound in preferences and I've checked the box to have sound play for other events...but it always plays the same sound for every event.
Help!!
MacBook Pro Mac OS X (10.4.10)I did further reseach and found if you substitute an AIFF file for the "Mail Sent.aiff" file in Mail's package\contents\resources - you can assign any sound. You have to rename the new file exactly the same as the existing. I backed up the original first for safety.
Why isn't there a preference for this?? -
Hi all;
i am configuring alerts for sending mails . i am on XI 7.0 SP 2.i am not able to find an option like internal processing in ALRTCATDEF settings configurations.
Can this be the reason why mails are not getting send.Hi Mudit,
To send an EMAIL, assign an EMAIL ID to the corresponding user in the transaction SU01 and then set up SCOT and you can send emails when the ALERT is triggered.
Once you have configure Alerts, you will get the Alerts into ALERT INBOX in RWB of the user. To also get the email, the following needs to be done,
1. In SU01 -- Assign the Email ID for the Recipient of the ALERT.
2. In , RWB>ALERT INBOX> PERSONALIZATION--> Time Independent Delivery and Email are selected.
3. Finally, SCOT needs to be set up to send Emails. Check this for the same. You can ask your BASIS team to do this step.
http://help.sap.com/saphelp_nw04/helpdata/en/23/1edf098ea211d2b47300609419ed29/frameset.htm
Also, In ALRTCATDEF, go to SETTINGS--> CONFIGURATION. By default, the option selected is INTERNAL PROCESSING. Select the option SMTP FORWARDING AS XML and give the email id. This will enable you to send an email alert whenever an error occurs in XI.
Also, to test your Alerts, execute the report RSALERTTEST in SE38.
Also go throuh the following links...
/people/michal.krawczyk2/blog/2005/09/09/xi-alerts--troubleshooting-guide
/people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
http://help.sap.com/saphelp_nw04/helpdata/en/3f/81023cfa699508e10000000a11402f/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/80/942f3ffed33d67e10000000a114084/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/2b/d925bf4b8a11d1894c0000e8323c4f/frameset.htm
Regards,
Abhy
Message was edited by: Abhy Thomas -
Maximum retries for sending mail ( java mail api )
Hi,
How can I set the property "maximum retries for sending mail" for my smtp through java mail api ?
Is there any property that I need to set in the Javamail session or any other way out ?
Thanks.That's a server property. You would set that in your server configuration. JavaMail is for sending and receiving mail, not for controlling mail servers.
-
in my ipad email address which I am using for sending mail is appearing differently in the receipents mail box ! how to resolve that
while sending a email in my ipad it is showing the correct email address([email protected]) in the ""from"" field but in receipients inbox ""from"" field it is showing another email id ([email protected])
-
I am holidaying in Auckland using my daughter's Orcon internet account for sending mail but it will not send. I am sure I am putting in the correct information but it still says mail.orcon.net.nz(Offline). I have spent half an hour with Orcon putting in correct info. They do not know how to help me further and neither does telstra clear, my own internet provider.
Any advice appreciated.On the Mail menubar > Mailbox, make sure Take all accounts online is selected.
-
I just upgraded to 10.8.2 and Mail is having a problem. It won't remember my password for getting mail; but it does remember the password for sending mail, i.e., smtp. Does anyone know of a fix?
The solution surprised even me, and we've been using Macs since 1984 (still have an original 128K).
I contacted Apple support, and because we had just upgraded yesterday, clicked on the "exception" button as opposed to paying the $19.99 one-time support fee. An Apple tech called and the problem was solved in two minutes.
Somehow during the installation of OS 10.8.2 (over 10.6.x) the key chain data for my email ISP login password got corrupted. The solution was to delete both the POP mail and SMTP entries in my keychain.
Back to Mail, it asked for the POP password, I entered it and bingo, mail got busy downloading. Interestingly, the password was also entered into the SMTP panel.
So, that's it. Thanks for you response, Mr. Hoffman, and regards. -
Problem assigning an account for sending mail from external mail app
Good morning , i have an IPhone 4s 16gb with IOS 7.0.6 and even in setting-mail and calendar i have setup the default account to use for sending mail outside mail app it use ICloud mail account.
if i select Icloud account and then my gmail account sometimes works but after some days it start again to use the other account...i don't know if it is when i power off the IPhone...if i look into settings-mail and calendar account selected is gmail even the account used is the ICloud.
i think is a IOS bug.
please let me know.
Best regardsJun T. wrote:
But there is a (high) possibility that Gmail's server requires authentication (or certification) to connect to it.
I wonder if they're simply silently dropping emails in certain cases. I forgot earlier that I have a Gmail account. If I send an email from the command line on my home computer, which is on Comcast, the mail log shows that I successfully connect to Gmail, the message is sent and accepted by Gmail, but the email never arrives in my inbox. I've tried several times with the same result.
However, emails from a web server from work get through to Gmail without a problem. So I'd bet it's a case of them not delivering mail from Comcast IP addresses.
For grins, I also tried sending to my Yahoo email account from my home computer and their server at least refuses the connection and I get an error message stating that it's because it's a residential IP address.
In this case you need an SMTP client (=a software which directly sends the mail to the Gmail server) which supports authentication.
I think this might also be possible with Postfix by editing the configuration files. I know I had to set up authentication to send emails to my work address directly from my home computers, but I haven't been able to get the same thing to work with Gmail yet. If I get a chance, I'll look into it again later tonight.
charlie -
Setting Host for sending mails
Hi Xperts
For sending mails to external mail id my internal support team had advised to do the following changes:
"<i>Please configure your host(s) to send to smlolw.lol.com, use default port#90.</i>"
i'm not dure on what he meant by this and where to carry these changes. Can i be guided to have this set properly.
thkx
PrabhuHi,
1. Goto transaction SCOT.
2. Double click the SMTP.
Thanks,
Reward If Helpful. -
How ca i create a stationery for sending mail with my letter head and logo etc.
I want to use a stationery with my letter head and logo for sending mails. Please tell me how can I create my page.
http://kb.mozillazine.org/Thunderbird_:_FAQs_:_Using_Templates
-
Problem in executing report for sending mail with form as attachment
Hi
i created a form in SFP and creted a report for sending it as an attachment via email.When it execute the report an error messgae is displyed saying: Unable to load form for language vector E.
Please suggest.Hi,
Do you use CL_BCS class to send your forms ?
Did you pass the forms as binary file to the mail ?
I can give you sample code where all exception are process and you can see the exact error .
Best regards. -
Script task to convert output from a sql query into send mail task body formatting
SSIS 2008R2 Version
Code from script task
Microsoft SQL Server Integration Services Script Task
Write scripts using Microsoft Visual C# 2008.
The ScriptMain is the entry point class of the script.
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
namespace ST_29dd6843bd6c4aee9b1656c1bbf55ba8.csproj
[System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
#region VSTA generated code
enum ScriptResults
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
#endregion
public void Main()
Variables varCollection = null;
string header = string.Empty;
string message = string.Empty;
Dts.VariableDispenser.LockForWrite("User::gsEmailMessage");
Dts.VariableDispenser.LockForWrite("User::gsWebserviceName");
Dts.VariableDispenser.LockForWrite("User::gsNoOfCallsInADay");
Dts.VariableDispenser.LockForWrite("User::gsCalledBySystem");
Dts.VariableDispenser.GetVariables(ref varCollection);
//Set the header message for the query result
if (varCollection["User::gsEmailMessage"].Value == string.Empty)
header = "Hi, Count is greater then 50 :\n\n";
//header = "Execute SQL task output sent using Send Email Task in SSIS:\n\n\n";
header += "----------------------------------------------------------------------------------------------------------------------" + "\n";
header += string.Format("{0}\t\t\t\t{1}\t\t{2}\n", "WebService Name", "No Of Calls In A Day", "Called By System");
header += "----------------------------------------------------------------------------------------------------------------------" + "\n";
varCollection["User::gsEmailMessage"].Value = header;
//Format the query result with tab delimiters
message = String.Format("<HTML><BODY><P>{0}</P><P>{1}</P><P>{2}</P></BODY></HTML>",
varCollection["User::gsWebserviceName"].Value,
varCollection["User::gsNoOfCallsInADay"].Value,
varCollection["User::gsCalledBySystem"].Value);
varCollection["User::gsEmailMessage"].Value = varCollection["User::gsEmailMessage"].Value + message + "\n";
Dts.TaskResult = (int)ScriptResults.Success;
Above code will return data in below format and then i send this output in aemail using send mail task.
Hi, count is greater then 50 :
WebService Name
No Of Calls In A Day Called By System
WebServiceone 1
Internetbutiken
WebServiceGetdetailstwo 1
Internetbutiken
Servicenamethree 2
MOB
As you can see above code is not in align as if we service name is shorter then 2nd column get disallign and its not look good.I need output should be like below.
Hi, count is greater then 50 :
WebService Name
No Of Calls In A Day Called By System
WebServiceone 1
Internetbutiken
WebServiceGetdetailstwo 1
Internetbutiken
Servicenamethree 2
MOB
Please suggest something...
Thanks
SR_MCTSSee code explained here
http://microsoft-ssis.blogspot.in/2013/08/sending-mail-within-ssis-part-2-script.html
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
This will not help.As I am not creating smtp connectin ,send from ,send to in script task.I am just creating email body from sql output. -
How can I create a schedule in Java for sending mail from SAP?
Hello;
I am coding a programme in Java which reads data from KM. I wish to schedule a job which sends mail to a list of persons selected from KM. I read the article by Prakash Singh and based my programme on his explanations.
/people/prakash.singh4/blog/2005/04/20/did-you-know-you-can-schedule-jobs-in-portal-using-kms-scheduler-task
My first problem is that I don't know how to send mail in SAP, and how to use Java to send this mail. My second problem is how to develop this "schedule job" function - is it enough to use Prakash Singh's method, or does it need to be changed?
Can anyone help me with these questions?
Thank you very much, R.E.Hi,
I dont know about the CATS system. But when ur user selects the varaint, he should remove his own id and execute the query. This should display all the variants existing for that program. Then he can select the required variant.
The user can also save this varaint under his own ID
Hope it helps.
Regards.
Jay Gandhi
Maybe you are looking for
-
This 16gb model number is ME179BT/A if that makes any difference. It still plays apps and games with ease but will not download media from either the computer or iTunes store. We have restored and reset the thing but it will not work. This has been p
-
Batch Convert From Excel Files To Numbers?
Is there any way to batch convert all my excel files into numbers files without individually opening each document and saving it out? Thanks, -Reuben
-
Can any change my code dynamic till to last raw materials of production ord
LOOP AT T_CAUFV. " it contains all production orders of finished product. REFRESH IT_AUFM1. SELECT * FROM AUFM INTO TABLE IT_AUFM1 " ALL MATERIALS FOR PRODUCTION OREDERS. WHERE
-
How to CLOSE directory Utility 10.8.5
Guys have a really stupid problem here. I cant connect my Mac Mini to a Domain controller but I just want to close off the directory utility so I can get to it later but will not close. I cannot even shut down the machine as it holds it up. Can someo
-
Launching Problem - After Effects CS5
Hello, I've a problem when i try to launch After Effects cs5 (Free trial 30 days). When it's loading, it stops and an error message says to me : After Effects (alerte) : Unknown BIB Error. invalid encoding, BRV, 0 (83 § 3) What can i do ? Thanks for