Send SMTP-Mail from SAP with URL to the Workplace Inbox
Does anybody knows how I can create an URL adress within an E-Mail (which is generated in a step in workflow) to provide the receiver an direct access to his SAP-Inbox.
Logon-data must not be included.
thanks to everybody
Hi,
What is the nature of the URL you wish to include in the e-mail ?
Is it fixed or dynamic ?
Cheers
Colin.
Similar Messages
-
How will we send smtp mail from SAP via Exchange
Hi;
We changed SAP OS between Windows and Linux and still 4.6c . Now we use linux OS.
We used smtp mail at SAP via Exchange with 3.party (sendmail,indigomail etc.) But Now I dont know how will we send smtp mail from SAP.
Please help me,
Thanks for answers.
Moderator message: not directly related to ABAP development, please have look in the Netweaver forums, also search for available information on sending emails.
Edited by: Thomas Zloch on Nov 22, 2010 2:39 PMHi,
What is the nature of the URL you wish to include in the e-mail ?
Is it fixed or dynamic ?
Cheers
Colin. -
Sample code to send a mail from SAP
Hi guys
could any one provide me with the
sample code to send a mail from SAP with text as the main body of that mail via bcs classesHi,
Please go through this code: U can send mail;
Tables : zchp_cust-info.
DATA: OBJCONT LIKE SOLISTI1 OCCURS 5 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: ENTRIES LIKE SY-TABIX.
DATA: NAME(15).
DATA: CON_NAME(20).
DATA: req_num like zchp_cust_info.
DATA: I_TAB_CHP LIKE ZCHP_CUST_INFO OCCURS 0 WITH HEADER LINE.
*data: reno like ZCHP_CUST_INFO-req_num value .
data input for the mail
select * from zchp_cust_info
appending table i_tab_chp where req_num = c_knumv.
LOOP AT I_TAB_CHP.
concatenate i_tab_chp-created_by i_tab_chp-req_num into CON_NAME.
*WRITE: / con_name.
ENDLOOP.
Fill the document
DOC_CHNG-OBJ_NAME = 'Refe'.
DOC_CHNG-OBJ_DESCR = 'TESCRA Ref Number !'.
DOC_CHNG-SENSITIVTY = 'P'.
*OBJCONT = 'Tescra'.
OBJCONT = CON_NAME.
APPEND OBJCONT.
OBJCONT = con_name.
APPEND OBJCONT.
DESCRIBE TABLE OBJCONT LINES ENTRIES.
READ TABLE OBJCONT INDEX ENTRIES.
DOC_CHNG-DOC_SIZE = ( ENTRIES - 1 ) * 255 + STRLEN( OBJCONT ).
Fill the receiver list
CLEAR RECLIST.
RECLIST-RECEIVER = SY-UNAME. " replace with <login name>
RECLIST-REC_TYPE = 'B'.
RECLIST-EXPRESS = 'X'.
APPEND RECLIST.
CLEAR RECLIST.
RECLIST-RECEIVER = 'sapuser'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
Send the document
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_TYPE = 'RAW'
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
TABLES
OBJECT_CONTENT = OBJCONT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
CASE SY-SUBRC.
WHEN 0.
LOOP AT RECLIST.
IF RECLIST-RECEIVER = SPACE.
NAME = RECLIST-REC_ID.
ELSE.
NAME = RECLIST-RECEIVER.
ENDIF.
IF RECLIST-RETRN_CODE = 0.
WRITE: / NAME, ': succesfully sent'.
ELSE.
WRITE: / NAME, ': error occured'.
ENDIF.
ENDLOOP.
WHEN 1.
WRITE: / 'Too many receivers specified !'.
WHEN 2.
WRITE: / 'No receiver got the document !'.
WHEN 4.
WRITE: / 'Missing send authority !'.
WHEN OTHERS.
WRITE: / 'Unexpected error occurred !'.
ENDCASE.
<b>Please provide points if the issue is solved.</b>
Regards,
Sunil -
Problem sending externail mail from SAP
I am facing problem in sending external mail from SAP. for ex: yahoo, hotmail like that. But, i can able to send the mails to my domain ids. I have configured both the SMTP and SAP internet gateway to send mails.
But, i dont know what could be the problem in sending external mails.
Is there any body to help me in this regard
Regards,
B.SudharsanHi Sudarsan,
How are you trying to send an e-mail using ABAP or using actions or ?
Enclosed link gives you a complete overview of the settings and the way to send an e-mail using ABAP ( if necessary).
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
Reward points if it helps.
Regards,
Vamsi Krishna P. -
To send outbound mails from SAP
Hi team,
Here i need to configure email setting from SAP to any other email ID ( yahoo,gmail etc).For this configuration do i need to confgure any program or to genrate some RFC settings.
Can some one guide me the process step by step what to be done to send outbound mails from SAP. Immediate help will be really appreciated.
thanks in advance.Check note 455140 - Configuration of e-mail, fax, paging or SMS using SMTP
Markus -
When I send a mail from my iPhone, it displays the mail server name to the receiver if the mail and does not display my name or e mail address. This only since upgrading my iPhone5 to iOS7. I've checked all settings etc. anyone have a solution please?
Rectory wrote:
Please can someone tell me how I can change this so when I send a mail from my phone and from the IPad that it reads from me.
You need a separate email address but you've already ruled out that solution. -
How to apply Password Protection On attachment send through mail from SAP
Hi All,
I want to apply Password Protection on file send as an attachment from SAP on Email.
I know how to send email from sap with attachment in it. A smartform is coverted to a attachment and send on email.
But how can i apply password protection on it.
Any type of file format will be fine. I just need to know how can i make that file as password protected.
Thanks in advance.
Sonal Jain.>
Sonal Jain wrote:
But how can i convert the PDF to folder and than how can i zip that folder with password protection.
Not folder but file (I do hope you understand the difference). Have you tried to search SDN at all? I don't have much time, but before replying initially I did just a quick search and it brought several posts mentioning the archiving functionality. And I'm sure 'Smartform to PDF' will bring up gozillion posts. Also I find the Google search with addition 'site:sap.com' to be quite helpful.
However, I would still recommend to review the requirements. Why exactly do you need this password protection? If there is a fear that someone other than a recipient might get access to the email account then there is really a bigger security issue in the organization and it should be resolved by some other means. As I have mentioned, password does not really add much protection.
Out of curiosity I briefly looked at the IRM description on the Microsoft's web site and it doesn't seem to be very helpful. First of all, it's the MS software and has to be installed on the user's PC and configured (how do we know the emai recipients are even on Windows?). Also it does say "Prevent an unauthorized recipient from accessing e-mail content", but I didn't quite get how exactly. Is there a retinal scan that comes with it? And the list of things it does not do gives you the whole another perspective on the email security. -
Sending external email from SAP with following requirements...
Hi All,
I need to send external emails from SAP by meeting following requirements.
1) With subject line more than 100 characters.
2) No attachments, only body which has specific format (blueprint/layout) and would be amended often, hence code shouldn't be touched during amendments.
3) Should be able to know the success/failure of mail sending at program level.Hi,
The code below demonstrates how to send an email to an external email address
*& Report ZSENDEMAIL *
*& Example of sending external email via SAPCONNECT *
REPORT zsendemail .
PARAMETERS: psubject(40) type c default 'Hello',
p_email(40) type c default '[email protected]' .
data: it_packing_list like sopcklsti1 occurs 0 with header line,
it_contents like solisti1 occurs 0 with header line,
it_receivers like somlreci1 occurs 0 with header line,
it_attachment like solisti1 occurs 0 with header line,
gd_cnt type i,
gd_sent_all(1) type c,
gd_doc_data like sodocchgi1,
gd_error type sy-subrc.
data: it_message type standard table of SOLISTI1 initial size 0
with header line.
*START-OF-SELECTION.
START-OF-SELECTION.
Perform populate_message_table.
*Send email message, although is not sent from SAP until mail send
*program has been executed(rsconn01)
PERFORM send_email_message.
*Instructs mail send program for SAPCONNECT to send email(rsconn01)
perform initiate_mail_execute_program.
*& Form POPULATE_MESSAGE_TABLE
Adds text to email text table
form populate_message_table.
Append 'Email line 1' to it_message.
Append 'Email line 2' to it_message.
Append 'Email line 3' to it_message.
Append 'Email line 4' to it_message.
endform. " POPULATE_MESSAGE_TABLE
*& Form SEND_EMAIL_MESSAGE
Send email message
form send_email_message.
Fill the document data.
gd_doc_data-doc_size = 1.
Populate the subject/generic message attributes
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
gd_doc_data-obj_descr = psubject.
gd_doc_data-sensitivty = 'F'.
Describe the body of the message
clear it_packing_list.
refresh it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
describe table it_message lines it_packing_list-body_num.
it_packing_list-doc_type = 'RAW'.
append it_packing_list.
Add the recipients email address
clear it_receivers.
refresh it_receivers.
it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = 'X'.
it_receivers-notif_ndel = 'X'.
append it_receivers.
Call the FM to post the message to SAPMAIL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_txt = it_message
receivers = it_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.
Store function module return code
gd_error = sy-subrc.
Get it_receivers return code
loop at it_receivers.
endloop.
endform. " SEND_EMAIL_MESSAGE
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
form initiate_mail_execute_program.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
endform. " INITIATE_MAIL_EXECUTE_PROGRAM
Hope this helps.
Reward if helpful.
Regards,
Sipra -
Any idea how I get fix my iphone so it will send e-mails from yahoo? It keeps saying username or password invalid. I can receive e-mails without any problem. I have tried deleting the account and reinstalling it, chek the username and password and they are correct. Went under outgoing server but it is grayed out and won't allow me to edit and add the optional username or password or anything in that section. Please help.
First, try a system reset. It cures many ills and it's quick, easy and harmless...
Hold down the on/off switch and the Home button simultaneously until the screen blacks out or you see the Apple logo. Ignore the "Slide to power off" text if it appears. You will not lose any apps, data, music, movies, settings, etc.
If the Reset doesn't work, try a Restore. Note that it's nowhere near as quick as a Reset. Connect via cable to the computer that you use for sync. From iTunes, select the iPad/iPod and then select the Summary tab. Follow directions for Restore and be sure to say "yes" to the backup. You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod. Again, say "yes."
Finally, if the Restore doesn't work, let the battery drain completely. Then recharge for at least an hour and Restore again. -
How to send a mail from SAP 3.1H Ver.
Hi,
I am working on SAP 3.1H Version. I need to send mail from one of my ABAP program. Since SAP 3.1H version does not have Standard function modules which send mails from any ABAP program so how can I achive this task in this version of SAP.
The Operating system of my application server is Sun solaris.
Waiting for an early and postive reply.
Thanks & Regards,
Maqsood KhanREPORT ZSAPMAIL NO STANDARD PAGE HEADING.
TABLES: DRAD,
QINF,
DRAW,
SOUC,
SOFD,
DRAP.
DATA: P_RETURN_CODE LIKE SY-SUBRC.
data: d_username LIKE DRAP-PRNAM.
mail declarations
DATA : BEGIN OF NEW_OBJECT_ID. " the newly created email object
INCLUDE STRUCTURE SOODK.
DATA : END OF NEW_OBJECT_ID.
DATA : BEGIN OF FOLDER_ID. " the folder id of the outbox
INCLUDE STRUCTURE SOODK.
DATA : END OF FOLDER_ID.
DATA : BEGIN OF REC_TAB OCCURS 5. " the table which will contain the
INCLUDE STRUCTURE SOOS1. " information on the destination
DATA : END OF REC_TAB.
DATA : BEGIN OF OBJECT_HD_CHANGE. " the table which contains the
INCLUDE STRUCTURE SOOD1. " info for the object we will be
DATA : END OF OBJECT_HD_CHANGE. " creating
DATA : OBJECT_TYPE LIKE SOOD-OBJTP. " the type of object
DATA : BEGIN OF OBJHEAD OCCURS 5. " the header of the object
INCLUDE STRUCTURE SOLI.
DATA : END OF OBJHEAD.
DATA : BEGIN OF OBJCONT OCCURS 0. " the contents of the object
INCLUDE STRUCTURE SOLI. " i.e. the text etc
DATA : END OF OBJCONT.
DATA : BEGIN OF OBJPARA OCCURS 5. " formatting options
INCLUDE STRUCTURE SELC.
DATA : END OF OBJPARA.
DATA : BEGIN OF OBJPARB OCCURS 5. " formatting options
INCLUDE STRUCTURE SOOP1.
DATA : END OF OBJPARB.
DATA : BEGIN OF T_MAIL_TEXT OCCURS 0, "Message table for messages to
STRING(255), "user via mailbox
END OF T_MAIL_TEXT.
Parameter: p_uname like sy-uname.
**START-OF-SELECTION
START-OF-SELECTION.
d_username = p_uname.
PERFORM POPULATE_EMAIL_TEXT.
PERFORM SETUP_TRX_AND_RTX_MAILBOXES USING P_RETURN_CODE.
PERFORM CREATE_AND_SEND_MAIL_OBJECT.
FORM POPULATE_EMAIL_TEXT *
Inserts text for email message *
FORM POPULATE_EMAIL_TEXT.
CLEAR T_MAIL_TEXT-STRING. "puts a blank line in
APPEND T_MAIL_TEXT.
APPEND T_MAIL_TEXT.
adds failed list on to end of success list.
T_MAIL_TEXT-STRING = 'Test email message line 1'.
APPEND T_MAIL_TEXT.
T_MAIL_TEXT-STRING = 'Test email message line 1'.
APPEND T_MAIL_TEXT.
CLEAR T_MAIL_TEXT-STRING. "puts a blank line in
APPEND T_MAIL_TEXT.
T_MAIL_TEXT-STRING = 'Header1 Header2 Header3'.
APPEND T_MAIL_TEXT.
T_MAIL_TEXT-STRING = '----
APPEND T_MAIL_TEXT.
ENDFORM.
*& Form SETUP_TRX_&_RTX_MAILBOXES
Ensure that the mailboxes of the sender (INTMGR) are set up OK
FORM SETUP_TRX_AND_RTX_MAILBOXES USING P_RETURN_CODE.
get the user no of the sender in order to add the mail to the
user name's outbox for future reference
SELECT SINGLE * FROM SOUC
WHERE SAPNAM = SY-UNAME. "SAP name of a SAPoffice user
IF SY-SUBRC NE 0.
"Error finding the SAPoffice user info for the user
MESSAGE E064(ZR53) WITH SY-UNAME.
P_RETURN_CODE = 1.
EXIT.
ENDIF.
*Get the outbox No for the sender from the user No where the folder
" type is an outbox
SELECT * FROM SOFD WHERE OWNTP = SOUC-USRTP "Owner type from ID
AND OWNYR = SOUC-USRYR "Owner year from the ID
AND OWNNO = SOUC-USRNO "Owner number from the I
AND FOLRG = 'O'."Output box
ENDSELECT.
IF SY-SUBRC NE 0.
" Error getting folder information for the user
MESSAGE E065(ZR53) WITH SY-UNAME.
P_RETURN_CODE = 1.
EXIT.
ENDIF.
ENDFORM. " SETUP_TRX_&_RTX_MAILBOXES
*& Form CREATE_AND_SEND_MAIL_OBJECT
FORM CREATE_AND_SEND_MAIL_OBJECT.
FOLDER_ID-OBJTP = SOFD-FOLTP. " the folder type ( usually FOL )
FOLDER_ID-OBJYR = SOFD-FOLYR. " the folder year ( usually 22 )
FOLDER_ID-OBJNO = SOFD-FOLNO. " the folder no.
OBJECT_TYPE = 'RAW'. " the type of object being added
build up the object information for creating the object
OBJECT_HD_CHANGE-OBJLA = SY-LANGU. " the language of the email
OBJECT_HD_CHANGE-OBJNAM = 'PS to DM Interface'. " the object name
mail subject 'Mass Linking of QA, pass/fail'
MOVE TEXT-002 TO OBJECT_HD_CHANGE-OBJDES.
OBJECT_HD_CHANGE-DLDAT = SY-DATUM. " the date of the email
OBJECT_HD_CHANGE-DLTIM = SY-UZEIT. " the time of the email
OBJECT_HD_CHANGE-OBJPRI = '1'. " the priority ( highest )
OBJECT_HD_CHANGE-OBJSNS = 'F'. " the object sensitivity
F is functional, C - company sensitive
object_hd_change-skips = ' '. " Skip first screen
object_hd_change-acnam = 'SM35'. " Batch imput transaction
object_hd_change-vmtyp = 'T'. " Transaction type
add the text lines into the contents of the email
CLEAR OBJCONT.
REFRESH OBJCONT.
free objcont. " added this to delete the mail contents records
LOOP AT T_MAIL_TEXT.
OBJCONT-LINE = T_MAIL_TEXT-STRING.
APPEND OBJCONT.
ENDLOOP.
CLEAR OBJCONT.
build up the table of receivers for the email
REC_TAB-RCDAT = SY-DATUM. " the date to send the email
REC_TAB-RCTIM = SY-UZEIT. " the time to send the email
the SAP username of the person who will receive the email
REC_TAB-RECNAM = D_USERNAME.
the user type of the person who will send the email ( USR )
REC_TAB-SNDTP = SOUC-USRTP.
the user year of the person who will send the email ( 22 )
REC_TAB-SNDYR = SOUC-USRYR.
the user number of the person who will send the email
REC_TAB-SNDNO = SOUC-USRNO.
the sap username of the person who will send the email
REC_TAB-SNDNAM = SY-UNAME.
get the user info for the receiver of the document
SELECT SINGLE * FROM SOUC WHERE SAPNAM = D_USERNAME.
IF SY-SUBRC NE 0.
WRITE : / TEXT-001, D_USERNAME. "usnam.
EXIT.
ENDIF.
the user number of the person who will receive the email ( USR )
REC_TAB-RECNO = SOUC-USRNO.
the user type of the person who will receive the email ( USR )
REC_TAB-RECTP = SOUC-USRTP.
the user year of the person who will receive the email ( USR )
REC_TAB-RECYR = SOUC-USRYR.
the priority of the email ( highest )
REC_TAB-SNDPRI = '1'.
check for delivery on the email
REC_TAB-DELIVER = 'X'.
send express so recipient knows there is a problem
REC_TAB-SNDEX = 'X'.
check for a return receipt
REC_TAB-READ = 'X'.
the sap username of the person receiving the email
REC_TAB-ADR_NAME = D_USERNAME. "usnam.
add this receiver to the internal table
APPEND REC_TAB.
CLEAR REC_TAB.
call the function to create the object in the outbox of the sender
CALL FUNCTION 'SO_OBJECT_INSERT'
EXPORTING
FOLDER_ID = FOLDER_ID
OBJECT_HD_CHANGE = OBJECT_HD_CHANGE
OBJECT_TYPE = OBJECT_TYPE
OWNER = SY-UNAME
IMPORTING
OBJECT_ID = NEW_OBJECT_ID
TABLES
OBJCONT = OBJCONT
OBJHEAD = OBJHEAD
OBJPARA = OBJPARA
OBJPARB = OBJPARB
EXCEPTIONS
ACTIVE_USER_NOT_EXIST = 1
COMMUNICATION_FAILURE = 2
COMPONENT_NOT_AVAILABLE = 3
DL_NAME_EXIST = 4
FOLDER_NOT_EXIST = 5
FOLDER_NO_AUTHORIZATION = 6
OBJECT_TYPE_NOT_EXIST = 7
OPERATION_NO_AUTHORIZATION = 8
OWNER_NOT_EXIST = 9
PARAMETER_ERROR = 10
SUBSTITUTE_NOT_ACTIVE = 11
SUBSTITUTE_NOT_DEFINED = 12
SYSTEM_FAILURE = 13
X_ERROR = 14
OTHERS = 15.
IF SY-SUBRC NE 0.
MESSAGE A063(ZR53) WITH SY-SUBRC.
EXIT.
ENDIF.
call the function to send the already created email to the receivers
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
FOLDER_ID = FOLDER_ID
OBJECT_ID = NEW_OBJECT_ID
OUTBOX_FLAG = 'X'
OWNER = SY-UNAME
TABLES
RECEIVERS = REC_TAB
EXCEPTIONS
ACTIVE_USER_NOT_EXIST = 1
COMMUNICATION_FAILURE = 2
COMPONENT_NOT_AVAILABLE = 3
FOLDER_NOT_EXIST = 4
FOLDER_NO_AUTHORIZATION = 5
FORWARDER_NOT_EXIST = 6
NOTE_NOT_EXIST = 7
OBJECT_NOT_EXIST = 8
OBJECT_NOT_SENT = 9
OBJECT_NO_AUTHORIZATION = 10
OBJECT_TYPE_NOT_EXIST = 11
OPERATION_NO_AUTHORIZATION = 12
OWNER_NOT_EXIST = 13
PARAMETER_ERROR = 14
SUBSTITUTE_NOT_ACTIVE = 15
SUBSTITUTE_NOT_DEFINED = 16
SYSTEM_FAILURE = 17
TOO_MUCH_RECEIVERS = 18
USER_NOT_EXIST = 19
X_ERROR = 20
OTHERS = 21.
IF SY-SUBRC EQ 0.
MESSAGE I035(ZR53) WITH NEW_OBJECT_ID D_USERNAME. "usnam.
ELSE.
MESSAGE I036(ZR53) WITH D_USERNAME." sy-subrc.
ENDIF.
ENDFORM. " CREATE_AND_SEND_MAIL_OBJECT
award points if useful,
Aleem. -
Problem while sending e-mail from SAP
Hi,
I need to modify customized report, my problem is i need to download as .XLS file as well i need to send as an attachment to e-mail. If i select with NO-Delimeter the attachment comming as .TXT file and if i select any delimeter that occupying one cell in .XLS file.
Can anyone help me out in this.
Thanks,
YogeshHi Yogesh,
Refer the following code as pointer to sending email with attachment.
REPORT ZSAMPL_001 .
INCLUDE ZINCLUDE_01.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
*file_open_error = 1
*file_read_error = 2
*no_batch = 3
*gui_refuse_filetransfer = 4
*invalid_type = 5
*no_authority = 6
*unknown_error = 7
*bad_data_format = 8
*header_not_allowed = 9
*separator_not_allowed = 10
*header_too_long = 11
*unknown_dp_error = 12
*access_denied = 13
*dp_out_of_memory = 14
*disk_full = 15
*dp_timeout = 16
*OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
***INCLUDE ZINCLUDE_01 .
Data
tables crmrfcpar.
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
data v_rfcdest LIKE crmrfcpar-rfcdest.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
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.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
FORM
FORM ml_saveforbp USING jobname jobcount.
Data
*data : yhead like yhrt_bp_head.
*DATA : ydocdata LIKE yhrt_bp_docdata,
*yobjtxt LIKE yhrt_bp_objtxt OCCURS 0 WITH HEADER LINE,
*yreclist LIKE yhrt_bp_reclist OCCURS 0 WITH HEADER LINE.
*DATA : seqnr TYPE i.
Head
*yhead-jobname = jobname.
*yhead-jobcount = jobcount..
*MODIFY yhrt_bp_head FROM yhead.
Doc Data
*ydocdata-jobname = jobname.
*ydocdata-jobcount = jobcount.
*MOVE-CORRESPONDING docdata TO ydocdata.
*MODIFY yhrt_bp_docdata FROM ydocdata.
Objtxt
*seqnr = 0.
*LOOP AT objtxt.
*seqnr = seqnr + 1.
*yobjtxt-jobname = jobname.
*yobjtxt-jobcount = jobcount.
*yobjtxt-seqnr = seqnr.
*MOVE-CORRESPONDING objtxt TO yobjtxt.
*MODIFY yhrt_bp_objtxt FROM yobjtxt.
*ENDLOOP.
RecList
*seqnr = 0.
*LOOP AT reclist.
*seqnr = seqnr + 1.
*yreclist-jobname = jobname.
*yreclist-jobcount = jobcount.
*yreclist-seqnr = seqnr.
*MOVE-CORRESPONDING reclist TO yreclist.
*MODIFY yhrt_bp_reclist FROM yreclist.
*ENDLOOP.
ENDFORM. "ml_saveforbp
FORM
FORM ml_fetchfrombp USING jobname jobcount.
*CLEAR docdata.
*REFRESH objtxt.
*REFRESH reclist.
*SELECT SINGLE * FROM yhrt_bp_docdata
*INTO corresponding fields of docdata
*WHERE jobname = jobname
*AND jobcount = jobcount.
*SELECT * FROM yhrt_bp_objtxt
*INTO corresponding fields of TABLE objtxt
*WHERE jobname = jobname
*AND jobcount = jobcount
*ORDER BY seqnr.
*SELECT * FROM yhrt_bp_reclist
*INTO corresponding fields of TABLE reclist
*WHERE jobname = jobname
*AND jobcount = jobcount
*ORDER BY seqnr.
ENDFORM. "ml_fetchfrombp
<b>Please reward points if it helps.</b>
Regards,
Amit Mishra -
I can't open delete or send e-mails from hotmail with firefox 11
my problem starts 3 days before i performe the update to FF11 so i can't open edit send or delete any e-mail from hotmail and still continues after the update to version 11 of FF. That issue happens only with FF on IE they work perfect. Any idea how to fix that problem on FF??
Before creating a new empty profile, you can follow the [[Basic Troubleshooting]] steps and maybe start by running in Firefox [[Safe Mode]]. This is the Firefox "debug" mode which uses the default theme and toolbars/controls, disables hardware acceleration and disables all extensions. See [[Troubleshooting extensions and themes]] for detailed instructions.
-
Send outlook mail from SAP- urgent help me
Hi
I am using FM SO_NEW_DOCUMENT_SEND_API1 to send mail. Following code sy-subrc is 0. but i din nt receive mail. pls help me.
REPORT Z_MAIL.
data: maildata type sodocchgi1.
data: mailtxt type table of solisti1 with header line.
data: mailrec type table of somlrec90 with header line.
start-of-selection.
clear: maildata, mailtxt, mailrec.
refresh: mailtxt, mailrec.
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test'.
maildata-obj_langu = sy-langu.
mailtxt-line = 'This is a test'.
append mailtxt.
mailrec-receiver = 'name.company.com'.
mailrec-rec_type = 'U'.
append mailrec.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'RAW'
put_in_outbox = 'X'
tables
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
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. "( did not receive any mail) *
write : 'mail sent'.
endif.REPORT z_email_test1.
TABLES:
spfli.
DATA:
t_spfli LIKE TABLE OF spfli.
DATA:
objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 0 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
objhex LIKE solix OCCURS 0 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
DATA:
doc_chng LIKE sodocchgi1.
CONSTANTS:
This is constant for Horizontal Tab.
con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
This is for Line feed and Carreige return.
con_cret(2) TYPE c VALUE cl_abap_char_utilities=>cr_lf.
DATA:
w_string TYPE string,
w_tempstring TYPE string,
w_tablines LIKE sy-tabix.
Here Document details will be filled
doc_chng-obj_name = 'SPFLI'.
doc_chng-obj_descr = 'Spfli table contents'.
If the Priority is '1' then the mail will go with High priority
If it is '9' then the mail will go with Low priority
If nothing is given then there will be no priority.
doc_chng-priority = '1'.
Getting Flight data
SELECT * FROM spfli INTO TABLE t_spfli.
This is the Boby of the mail
objtxt = 'Hi,'.
APPEND objtxt.
objtxt = 'These are the contents of Flight data'.
APPEND objtxt.
objtxt = 'Have fun and Enjoy'.
APPEND objtxt.
DESCRIBE TABLE objtxt LINES w_tablines.
READ TABLE objtxt INDEX w_tablines.
doc_chng-doc_size = ( w_tablines - 1 ) * 255 + STRLEN( objtxt ).
Creating the entry for the compressed document
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = w_tablines.
objpack-doc_type = 'RAW'.
APPEND objpack.
DATA:
w_fltime(10) TYPE c,
w_period(3) TYPE c,
w_distance(11) TYPE c,
data_tab LIKE TABLE OF solisti1,
sent_to_all TYPE sonv-flag,
new_object_id TYPE sofolenti1-object_id.
Here the data needs to be converted to respective format.
First the entire table data will be converted into a string
After that string will be converted to ITAB with
line type of 255 characters
CLEAR w_string.
LOOP AT t_spfli INTO spfli.
MOVE: spfli-fltime TO w_fltime,
spfli-distance TO w_distance,
spfli-period TO w_period.
CLEAR w_tempstring.
Here each field will be seerated by 'Tab' and for every row
'Carriage Return and Line Feed' will be used
CONCATENATE spfli-carrid
spfli-connid
spfli-countryfr
spfli-cityfrom
spfli-airpfrom
spfli-countryto
spfli-cityto
spfli-airpto
w_fltime
spfli-deptime
spfli-arrtime
w_distance
spfli-distid
spfli-fltype
w_period
INTO w_tempstring SEPARATED BY con_tab.
CONCATENATE w_string w_tempstring con_cret INTO w_string.
AT LAST.
DATA: lw_string LIKE w_tempstring.
CONCATENATE 'saibaba kondani' 'temp'
INTO lw_string SEPARATED BY con_tab.
CONCATENATE w_string w_tempstring con_cret INTO w_string.
ENDAT.
ENDLOOP.
Converting the above String to the Internal table of FM
CALL FUNCTION 'SCMS_STRING_TO_FTEXT'
EXPORTING
text = w_string
IMPORTING
LENGTH = LENGTH
TABLES
ftext_tab = data_tab.
This is the Data of Attachment
objbin[] = data_tab.
DESCRIBE TABLE objbin LINES w_tablines.
This is the name of Attachment
If the Attachment type is text then name should be given with
'.TXT' extension and for Excel attachment '.XLS' extension
should be given.
objhead = 'SPFLI.XLS'.
APPEND objhead.
Creating the entry for the compressed attachment
These are the details for the Attachemnt
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = w_tablines.
This is the Attachment type(For excel 'XLS' and fot text 'TXT' should
objpack-doc_type = 'XLS'.
objpack-obj_name = 'DATA_ATTACHMENT'.
objpack-obj_descr = 'Spfli attachment table'.
objpack-doc_size = w_tablines * 255.
APPEND objpack.
Entering names in the distribution list( These are the receivers )
reclist-receiver = mailid.
reclist-rec_type = 'U'.
RECLIST-NOTIF_READ = 'X'.
APPEND reclist.
REFRESH data_tab.
CLEAR data_tab.
CALL FUNCTION 'SCMS_STRING_TO_FTEXT'
EXPORTING
text = lw_string
IMPORTING
LENGTH = LENGTH
TABLES
ftext_tab = data_tab.
DESCRIBE TABLE objbin LINES w_tablines.
Creating the entry for the compressed attachment
These are the details for the Attachemnt
objpack-transf_bin = 'X'.
objpack-head_start = w_tablines + 1.
objpack-head_num = 0.
objpack-body_start = w_tablines + 1.
objpack-body_num = w_tablines.
This is the Attachment type(For excel 'XLS' and fot text 'TXT' should
objpack-doc_type = 'XLS'.
objpack-obj_name = 'DATA_ATTACHMENT'.
objpack-obj_descr = 'Spfli attachment table'.
objpack-doc_size = w_tablines * 255.
APPEND objpack.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = sent_to_all
new_object_id = new_object_id
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
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.
IF sy-subrc EQ 0.
WRITE : / sent_to_all,new_object_id.
ENDIF.
This Program is used to Trigger the send process Explicitely
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN. -
How to send a mail from SAP to Users more than 200
Hi
some one can help i have one scenario in my company we have to send a mail to our user more than 200 to inform price changes once in a month or two month
Thanks in advance
Best Regards,
MHHi Mohammed
As you want to send to around 200 customers then maintain a condition record with the combination of Output medium 7 in the Output medium field
Second Option is Go to VA02 -> Edit -> Editor to reach the SAPscript Editor and then come back to the header output data and then The system sends the electronic mail at the time you have specified in the timing data..
Regards
Srinath -
Hi all,
I have one ALV-report which has 64 columns.
Now i want to send this report to external mail.
I have already created a program for this but the problem is that my report contains 64 columns but only 30 columns is sending to external mail remaining data is not generating in excel sheet.first check o/p in spool t.code sp02
o/p is having 64 columns or 30.
Maybe you are looking for
-
Photoshop cs2 bridgeでバッチを実行するとエラー表示される
photoshop cs2 でスクリプトを作り. アクション登録しました.これをCS2上でバッチ処理をするとOKなのですが. bridge上からツール→バッチを呼び出して 実行すると.スクリプトは使えない旨の エラーダイアログがでます. 解決法を教えて下さい.
-
How to best manage a large photo library
When our family became Mac users in 2008, it was suggested by apple support to create separate iPhoto libaries for each year due to the size of our photo library. So we did this and also purchased the iPhoto Library Manager application to keep everyt
-
Playing music in iTunes, clamor, distorts the song
Playing a song in iTunes clamor is heard, a very distorted. When I play it in another probgramie everything works fine. Already tried to uninstall and install again.Someone had this problem? Please help. I am using windows xp.
-
My mac book pro is working, but my power light is off, the battery power light is not on and my battery power symbol is a black x. My computer is making a whirring sound sort of like it does when loading a CD. I had a hard time getting the computer
-
Indesign Crashing when saving as PDF or Printing - CS6 - Mac OS X
Brand new install of indesign. It seems to be crashing whenever we print or save as a PDF. Here is the crash report. THis is a brand new isntall on a powerful mac with 32GB of ram and a 2.4 i7. The file we are working with is only 4MB. ha Proces