Email attachment filenames appear as "mail attachment".doc or "mail attachment."pdf
Hi,
I have Mac OS 10.7.5, I've synchronised my hotmail/outlook address to Mail application.
I have no issues with sending or receiving emails with attachments.
The problem I'm having is that the filename of all attachments appear as "mail attachment.doc" for Word files or as "mail.attachment.pdf" for PDF files.
1) If I log on to my hotmail account through the browser the attachments appear with the correct file name.
2) The attachment file names happen to also appear correctly on my iPhone.
3) I have other mailboxes set up in Mail application and attachment file names appear correct.
It seems to be an issue with Mail application and the hotmail/outlook account.
I would appreciate if anyone can give me some feedback on this issue.
Kind regards,
Doble Korona
Peter
Some things to try - after each step, see if it works...
Ensure that you have the latest version of the OS and Quicktime and iPhoto.
1. Repair Permissions using Disk Utility
2. Delete the com.apple.iPhoto.plist file from the home / library / preferences folder. You'll need to reset your User options afterwards.
3. Download BatchMod from
http://macchampion.com/arbysoft/
And apply it to the iPhoto Library Folder using the settings found here:
http://homepage.mac.com/toad.hall/.Pictures/Forum/BatChmod.png
(Credit to Old Toad for this one).
4. Create a new account (systempreferences -> accounts) and see if the problem is repeated there. If it is, then a re-install of the app might be indicated. If it's not, then it's likely the app is okay and the problem is something in the main account.
Regards
TD
Similar Messages
-
I want to email a Pages document as a Word doc. I used to be able to do this by clicking on 'share' then 'send via mail' then on 'Word' and an email would appear with my word doc attached. Now the email does not come up. Why?
It's difficult to do more than guess when you don't say what version of OS X or Pages you're running, but if you're on the latest, have you tried the Share menu -> Send via Mail command?
If that doesn't help, you may have better luck if you ask in the Pages forum:
Pages
When you repost, be sure to include full details about your versions so that people know what it is you're working with.
Regards. -
Can the text that says "See Attachment" that appears in the body of an e-mail be edited?
When I attach to an e-mail, text that says "See Attachment" appears in the body of the e-mail. I would like to edit this text to say something else. I cannot find where this text is stored in the settings, and I am not even sure if it is generated by thunderbird or by the software that I am using that invokes thunderbird.
Does anyone know where this text is stored, or if it can be edited?There is nothing like what you talk about, so I am unsure what the question is really.
When you click on write a mail and then add an attachment I see nothing, but an attachment name in the top right corner of the email. -
Lost mail, forwarded doc with attachment. No record and not received
Using a message and attachment from an email in my files, created new message with updated info to send to CEO. Hit 'send' and heard normal rush sound. Later checked my sent file and no record. Called CEO exec asst not received. Tried again with a shorter message same result. Sent another message with an attachment to another exec, no problems. iPad problem or system?
Not recipient.
I have both a Me and a Yahoo account.
When I forward a mail with an attachment using Yahoo account, it shows the sending bar, makes the sound that a mail was sent and even put the arrow icon on the left side of the original mail. But no mail is sent (recipient doesn't receive it and I don't get my blind copy).
This also happens when I send a mail from an app (notes, noterize, numbers, pages, etc.).
If in both cases I use my Me account, it works fine.
Using Yahoo account, forward without attachments, and reply works fine.
Don't know what to do.
iPad iPhone OS 3.1.3 -
Mail Adapter: original Attachment filename retrieval in Proxy
Hi,
I have a Sender Mail Adapter, and the receiver is a proxy, where I need to get the attachment and its details.
When I execute
attachment_filename = l_attachment->GET_DOCUMENT_NAME( ).
it simply returns Attachment-1 etc.
How do I get the original attachment filename?
I am on SP16.
Regards,
Puloma.HI
Please refer tihs thread for mail attchments
Re: Handling attachments of mail
Scenario to pick the mail with its attachments into XI\Re: Infrastructure required for Mail Adapter -
Retrieval of attachment filename - receiver mail adapter
Hi,
I am using the mail adapter to receive an e-mail into PI. This e-mail has an attached CSV file.
First, I am using the PayloadSwapBean to swap the application playload to the attachment payload
Second, I am using the MessageTransformBean to transform the CSV file into an XML document
These are both working fine and the message is then passing into the relevant message mapping.
However, I would like to be able to use the attachment filename in the message mapping.
Can anyone advise how to do this for the mail adapter ?
I've done it loads of times for the file adapter but never the mail adapter (when using attachments) so I am a bit stumped.
Any advice greatly received.
Cheers
Colin.Hi Progirl,
I want to dynamically set the name of attachment in receiver mail Communication Channel.
Example: IN__9907211000004_4048454000005_20081211_01000000002643
The first two numbers 9907211000004 & 4048454000005 I want to read it from the message
20081211 this is the date and
And againg this number 01000000002643 is read from message.
I read from your response. You had created adapter module for the similar purpose. Can you share it. Since I am new to writing Adapter Module.
Thank You in Advance.
Mukhtar -
I have a jpeg I have added for a profeesional look to my signature in my Mail acount. When I attach other files to the message and send the message to a Widows-user recipient, the signature is no no seen as a signature and simply becomes an attachment with the email.
What can I do to stop this happening. ThanksFile menu "Attach Files..." then Tick off "Windows-friendly Attachment".
-
How do I attach a file to mac mail without it going into the body of the email?
To add to what Kappy said, note that you really can't control how some other mail client might display an attachment. Some may display them inline, while others may require them to be opened separately. And different people have different desires in this area... some want a PDF file, for example, displayed inline, while others prefer for it not to be. Just attach the file(s) and don't worry about this so much.
Also, I do have to disagree with Kappy on one point... I would not say that you "should" compress files and attach the compressed archive file. That will force all mail clients not to display the attachment inline, but not everyone will want that (you'd be forcing your tastes on all recipients of your e-mail), and some people have difficulty figuring out how to open and view the contents of compressed files. It's an extra step for you and an extra step for the recipient, and is not needed for most popular file types. (Of course, we could advise you more specifically if we knew what file types you're dealing with.) -
SharePoint mail handler could not extract attachment from a certain type of eml emails
I found out why SharePoint mail handler could not extract attachment from a certain type of eml emails. The eml emails not working me were constructed with this structure, using one attachment as example:
If I removed the highlighted red part, it just worked.
----boundary_2_6a659de7-74df-40e1-ab98-225ccc22717a
Content-Type: multipart/alternative;
boundary=--boundary_1_9786ce6d-49bd-4ef9-9300-4ed4797bd8ad
----boundary_1_9786ce6d-49bd-4ef9-9300-4ed4797bd8ad
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64
{body
text/plain in base64 string}
----boundary_1_9786ce6d-49bd-4ef9-9300-4ed4797bd8ad
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
{body
text/html in base64 string}
----boundary_1_9786ce6d-49bd-4ef9-9300-4ed4797bd8ad--
----boundary_2_6a659de7-74df-40e1-ab98-225ccc22717a
Content-Type: multipart/mixed; boundary=--boundary_3_e5f4edb0-f72c-44d3-9cea-f01b51affe53
----boundary_3_e5f4edb0-f72c-44d3-9cea-f01b51affe53
Content-Type: application/octet-stream;
name=attachment.pdf
Content-Transfer-Encoding: base64
{attachment
in base64 string here}
----boundary_3_e5f4edb0-f72c-44d3-9cea-f01b51affe53
----boundary_2_6a659de7-74df-40e1-ab98-225ccc22717a--
I know little about eml file structure. Either the structure is wrong or the sharepoint has a bug!Also, here's the list of classes imported in my java code:
import oracle.apps.xdo.delivery.DeliveryManager;
import oracle.apps.xdo.delivery.DeliveryRequest;
import oracle.apps.xdo.delivery.DeliveryPropertyDefinitions;
import oracle.apps.fnd.common.AppsContext;
Not sure where to refer the "Attachment" class. Thanks. -
XI Mail Adapter TXT file as attachment
Hi, I am using Mail Receiver adapter to receive data from Sender ABAP Proxy.The attachment file contains data with all Labels, i used in the Target Message Type.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:XogisticsOB_MT1 xmlns:ns0="http://selectcomfort.com/sapcrm/xogistics/outbound"><HEADER1000><EDI_HEADER_STR></EDI_HEADER_STR><TASK_ID>8000001959</TASK_ID><TOT_BOXES> 1</TOT_BOXES><NAME_LAST>Di Capri</NAME_LAST><NAME_FIRST>Sheela</NAME_FIRST>
Please let me know how can i exclude these labels such as
<HEADER1000> </HEADER1000> , <TASK_ID></TASK_ID>,
<NAME_LAST></NAME_LAST> etc...
from appearing in the File Content.
The ModuleKey contains
Transform.ContentDisposition attachment;filename="Outbound1.txt"
Transform.ContentDescription Outbound1
Transform.ContentType text/txt;name="Outbdound1.txt"
Thanks.
RushikeshHi,
If ur using the mail adapter as receiver then if u dont use mail package then the attachment will come as it is file.
If u use mail package then it will come in XML format
for reference please check some links.
Receiver Mail Adapter.
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
eMail Reporting
eMail Report as Attachment (Excel/Word)
The specified item was not found.
The specified item was not found.
The specified item was not found.
Regards,
Phani -
Receiver Mail Adapter, Mail Package with Payload as Attachment
Hi Everyone,
I have spent the better part of the day today searching and testing all of the different combinations that I could think of to solve this problem, so please don't just do an SDN search for me and cut/paste in the links as there are too many contradictive answers piling up over the last year.
I am trying to use a Receiver mail adapter to send some data using the mail package, and I want to have the <content> tag be in an attachment. I am using mail package to dynamically set the mail address, but to also try and turn my data into a csv file that the recipient can open in Excel.
My mail package sets the following values:
<Content_Type>text/plain</Content_Type>
<Content_Disposition>attachment</Content_Disposition>
<Content>Sample Text</Content>
This blog is basically what I am trying to do:
<a href="/people/community.user/blog/2006/09/08/email-report-as-attachment-excelword:///people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
But no where in here is he setting ContentDisposition, and he is (potentially) not using the MessageTransformBean module.
It is unclear if I need to use the MessageTransformBean to make this work?
Questions:
1) Do I need to use the MessageTransformBean?
2) Do I need to set the ContentDisposition in the mail package?
3) Does Service Pack matter with these settings? We are on SP15 upgrading to SP18 very soon.
Thanks
PeterHi Peter,
try:
<Content_Type>text/plain;name="file.csv"</Content_Type>
<Content_Disposition>attachment;filename="file.csv"</Content_Disposition>
<Content>Sample Text</Content>
Regards
Stefan -
Mail sending with subject and attachment
hai all,
my requiremnet is i want to send a mail with a body and pdf attachemnt , but with the below code iam able to send both as attachment , but how to send along with body.
*& Report ZV_TEST *
Report ZV_TEST no standard Page heading line-size 200.
Tables: Pa0105,
pernr,
QPPNP,
HRPY_RGDIR,
SSCRFIELDS,
pa0002.
Constants
constants:
begin of F__LTYPE, "type of line
CMD like PC408-LTYPE value '/:', "command
TXT like PC408-LTYPE value 's', "textline
end of F__LTYPE.
constants:
begin of F__CMD, "commands
NEWPAGE like PC408-LINDA value '<NEW-PAGE>',
end of F__CMD.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
Data Declaration
DATA:Begin of Itab occurs 0,
pernr like HRPY_RGDIR-PERNR,
SEQNR like HRPY_RGDIR-SEQNR,
PAYSLIP_VARIANT like BAPI7004-PAYSLIP_VARIANT,
end of itab.
data: P_INFO like PC407,
P_INFO1 like PC407,
P_FORM like PC408 occurs 0 with header line,
P_P_FORM like PC408 occurs 0 with header line,
RETURN like BAPIRETURN1 occurs 0 with header line,
PAY_VAR like BAPI7004-PAYSLIP_VARIANT value 'ESS_PAYSLIPS' ,
P_LIST like ABAPLIST occurs 1 with header line,
P_IDX type I.
data: begin of P_INDEX occurs 0,
INDEX type I,
end of P_INDEX.
data: OBJBIN like SOLISTI1 occurs 10 with header line,
DOCDATA like SODOCCHGI1,
OBJTXT like SOLISTI1 occurs 10 with header line,
OBJPACK like SOPCKLSTI1 occurs 1 with header line,
RECLIST like SOMLRECI1 occurs 1 with header line,
OBJHEAD like SOLISTI1 occurs 1 with header line,
TAB_LINES type I,
ATT_TYPE like SOODK-OBJTP.
data: PDF_TAB like TBL1024 occurs 0 with header line,
OTF_TAB like TBL1024 occurs 0 with header line.
Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
data: PDF_CONTENT TYPE XSTRING,
PDF_FSIZE TYPE I.
data: error TYPE sysubrc.
DATA: v_dest LIKE tsp01-rqdest,
v_handle LIKE sy-tabix,
v_spool_id LIKE tsp01-rqident,
v_rc TYPE c,
v_errmessage(100) TYPE c,
v_text(70) TYPE c.
data: PAYSLIP LIKE BAPI7004_PAYSLIP occurs 0 with header line.
Data: v_index like sy-index value 1.
Data: Begin of I_Sent occurs 0,
pernr like pernr-pernr,
name(20),
usrid_long like pa0105-usrid_long,
Status(3),
End of I_sent.
Data: Begin of I_NSent occurs 0,
pernr like pernr-pernr,
usrid_long like pa0105-usrid_long,
End of I_Nsent.
DATA: I_FCODE TYPE TABLE OF sy-ucomm.
data: v_text1(255),
v_text2(255),
v_text3(255).
data: month_names like T247 occurs 0 with header line,
v_month(2) type c.
***********************Selection Screen********************
selection-screen Begin of Block b2 WITH FRAME TITLE TEXT-BL1 .
Parameters: P_Print type c default 'X' radiobutton group g1
user-command CMD,
P_DISP Type C Radiobutton Group g1.
Selection-screen end of Block b2.
selection-screen Begin of Block b1 WITH FRAME TITLE TEXT-BL2 .
Recipient address and Period
SELECT-OPTIONS : s_name FOR PERNR-PERNR Modif id M1,
s_period for HRPY_RGDIR-FPPER Modif id M1.
s_year for QPPNP-PABRJ Modif id M1.
SELECT-OPTIONS: p_num FOR PERNR-PERNR Modif id M2 .
Selection-screen end of Block b1.
*SELECTION-SCREEN FUNCTION KEY 1.
*SELECTION-SCREEN PUSHBUTTON /10(20) CHARLY USER-COMMAND ABCD.
***********************At Selection Screen Output**************
at selection-screen output.
Loop at screen.
if P_Print = 'X'.
if screen-group1 = 'M2'.
screen-active = 0.
endif.
else.
if screen-group1 = 'M1'.
if screen-name = 'S_NAME-LOW' Or screen-name = 'S_PERIOD'.
screen-active = 1.
endif.
Endif.
Modify Screen.
Endloop.
***********************INITIALIZATION********************
INITIALIZATION.
MOVE 'Preview' TO SSCRFIELDS-FUNCTXT_01.
MOVE 'Preview' TO CHARLY.
p_print = 'X'.
v_text1 =
'Please find enclosed your salary slip for the month of Apr 2006 as
*attachment. This is confidential '.
***********************AT SELECTION-SCREEN******************
AT SELECTION-SCREEN.
if p_print = 'X'.
if s_name[] is initial.
message e000(8i) with 'Make Entry into Personal Number Field'.
endif.
else.
if p_num[] is initial.
message e000(8i) with 'Make Entry into Personal Number Field'.
endif.
endif.
***********************Start-of-Selection********************
Start-of-Selection.
if p_print = 'X'.
APPEND 'NEXT' TO i_fcode.
APPEND 'PREV' TO i_fcode.
set pf-status 'ZHRF' excluding I_FCODE.
Perform Get_values.
Perform Print using v_index.
perform Write_Values.
else.
set pf-status 'ZHRF'.
Perform Get_values.
Perform Print using v_index.
endif.
***********************Top-of-page***************************
Top-of-page.
skip 2.
if p_print = 'X'.
write:50 'The Pay Slip Sent details'.
skip 1.
uline at 1(70).
write :/ sy-vline,2 'Personal Number',18 sy-vline,
19 'Name',40 sy-vline,
41 'User Mail-Ids',63 sy-vline,
64 'Status',70 sy-vline.
ULINE /1(70).
endif.
set left scroll-boundary Column 0.
*& Form Get_values
text
--> p1 text
<-- p2 text
FORM Get_values .
select *
from HRPY_RGDIR
into corresponding fields of table itab
where PERNR in s_name
AND
FPPER IN S_PERIOD.
if sy-subrc eq 0.
loop at itab.
Create receiver list
refresh RECLIST.
clear RECLIST.
select single *
from PA0105
where PERNR eq ITAB-PERNR
and USRTY eq '0010'.
if SY-SUBRC <> 0.
I_sent-PERNR = ITAB-PERNR.
i_sent-status = 'NO'.
select single *
from pa0002
where pernr eq itab-pernr.
concatenate pa0002-VORNA pa0002-NACHN into i_sent-name
separated by space.
append i_Nsent.
continue.
else.
refresh reclist.
RECLIST-RECEIVER = pa0105-usrid_long.
translate RECLIST-RECEIVER to lower case.
RECLIST-REC_TYPE = 'U'.
append RECLIST.
endif.
call function 'GET_PAYSLIP'
EXPORTING
EMPLOYEE_NUMBER = itab-PERNR
SEQUENCE_NUMBER = itab-SEQNR
PAYSLIP_VARIANT = PAY_VAR
IMPORTING
RETURN = RETURN
P_INFO = P_INFO
TABLES
P_FORM = P_FORM.
loop at P_FORM
where LINDA eq F__CMD-NEWPAGE
and LTYPE eq F__LTYPE-CMD.
P_INDEX-INDEX = SY-TABIX.
append P_INDEX.
endloop.
P_IDX = 1.
refresh P_P_FORM.
append lines of P_FORM from P_IDX to P_INDEX-INDEX
to P_P_FORM.
P_IDX = P_INDEX-INDEX.
export P_P_FORM to memory id '%%_P_FORM_%%'.
export P_INFO to memory id '%%_P_INFO_%%'.
submit RPCEDT_LIST_TO_MEMORY exporting list to memory and return.
call function 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = P_LIST.
call function 'TABLE_COMPRESS'
TABLES
IN = P_LIST
OUT = OBJBIN
EXCEPTIONS
others = 1.
Read table RECLIST index 1.
I_sent-PERNR = ITAB-PERNR.
i_sent-usrid_long = RECLIST-RECEIVER.
select single *
from pa0002
where pernr eq itab-pernr.
concatenate pa0002-VORNA pa0002-NACHN into i_sent-name
separated by space.
i_sent-status = 'YES'.
append i_sent.
concatenate ' Payslip-' '(' ITAB-PERNR+4(4) ')'
into DOCDATA-OBJ_DESCR.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
TABLES
MONTH_NAMES = month_names
EXCEPTIONS
MONTH_NAMES_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.
if sy-datum+4(2) = '01'.
v_month = '12'.
else.
v_month = sy-datum+4(2) - 1.
endif.
read table month_names with key mnr = v_month.
concatenate 'Salary Slip for the month of' month_names-LTX
sy-datum+0(4) '-' i_sent-name
into DOCDATA-OBJ_DESCR.
DOCDATA-OBJ_NAME = 'Pay Slip'.
DOCDATA-OBJ_LANGU = SY-LANGU.
OBJTXT = 'Dear Mr.'.
concatenate OBJTXT i_sent-name into objtxt.
append OBJTXT.
append initial line to objtxt.
OBJTXT = 'Please find enclosed your salary slip for the month of'.
concatenate OBJTXT month_names-LTX sy-datum+0(4)
into objtxt separated by space.
append OBJTXT.
OBJTXT =
'as attachment This is confidential document and not be disclosed'.
append OBJTXT.
OBJTXT =
'shared with any other employee.In case of any queries on this subject'.
append OBJTXT.
OBJTXT =
'you are requested to contact the Payroll administrator Sabitha '.
OBJTXT = 'email:[email protected]'.
append OBJTXT.
append initial line to objtxt.
append initial line to objtxt.
OBJTXT = 'With Kind Regards'.
append OBJTXT.
append initial line to objtxt.
append initial line to objtxt.
OBJTXT = 'Sabitha'.
append OBJTXT.
OBJTXT = 'Payroll Administrator'.
append OBJTXT.
OBJTXT = 'Enteg Infotech Pvt Lyd.'.
append OBJTXT.
OBJTXT = 'Banaglore'.
append OBJTXT.
Write Packing List (Main)
describe table objtxt.
read table OBJTXT index sy-tfill.
DOCDATA-DOC_SIZE = ( sy-tfill - 1 ) * 255 + strlen( OBJTXT ).
clear OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = sy-tfill.
OBJPACK-DOC_TYPE = 'TXT'.
append OBJPACK.
Create Message Attachment
Write Packing List (Attachment)
ATT_TYPE = 'ALI'.
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 = 'Payslip'.
append OBJPACK.
Send the document
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOCDATA
PUT_IN_OUTBOX = ''
COMMIT_WORK = 'X'
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
others = 8.
endloop.
endif.
ENDFORM. " Get_values
*****************************At User Command*************************
at User-Command.
case Sy-ucomm.
When 'NEXT'.
describe table itab.
if sy-tfill GT v_index.
v_index = v_index + 1.
Perform Print using v_index.
else.
message E000(8i) with 'You Have Reached the Last Entry'.
endif.
When 'PREV'.
if v_index LE 1.
Message E000(8i) with 'You Have Reached the First Entry'.
else.
v_index = v_index - 1.
Perform Print using v_index.
endif.
When 'BACK'.
leave to screen 0.
WHen 'EXIT'.
set Screen 0.
leave screen.
Endcase.
*& Form Print
text
--> p1 text
<-- p2 text
FORM Print using v_index.
if v_index = 1.
select *
from HRPY_RGDIR
into corresponding fields of table itab
where PERNR in P_num
endif.
if not itab[] is initial.
sort itab by pernr .
read table itab index v_index.
select single *
from PA0105
where PERNR eq ITAB-PERNR
and USRTY eq '0010'.
call function 'GET_PAYSLIP'
EXPORTING
EMPLOYEE_NUMBER = itab-PERNR
SEQUENCE_NUMBER = itab-SEQNR
PAYSLIP_VARIANT = PAY_VAR
IMPORTING
RETURN = RETURN
P_INFO = P_INFO
TABLES
P_FORM = P_FORM.
loop at P_FORM
where LINDA eq F__CMD-NEWPAGE
and LTYPE eq F__LTYPE-CMD.
P_INDEX-INDEX = SY-TABIX.
append P_INDEX.
endloop.
P_IDX = 1.
refresh P_P_FORM.
append lines of P_FORM from P_IDX to P_INDEX-INDEX
to P_P_FORM.
P_IDX = P_INDEX-INDEX.
export P_P_FORM to memory id '%%_P_FORM_%%'.
export P_INFO to memory id '%%_P_INFO_%%'.
IMPORT P_P_FORM FROM MEMORY ID '%%_P_FORM_%%'.
IMPORT P_INFO FROM MEMORY ID '%%_P_INFO_%%'.
new-page "VKIK008647
line-size p_info-pcols
line-count p_info-psize
no-title
no-heading.
SET BLANK LINES ON.
LOOP AT P_P_FORM.
if sy-tabix lt 20.
NEW-LINE NO-SCROLLING.
endif.
CASE P_P_FORM-LTYPE.
WHEN F__LTYPE-TXT.
WRITE:/ P_P_FORM-LINDA.
WHEN F__LTYPE-CMD.
IF P_P_FORM-LINDA EQ F__CMD-NEWPAGE.
NEW-PAGE.
ENDIF.
WHEN others.
hide: itab,v_index.
WRITE:/ P_P_FORM-LINDA.
if sy-tabix lt 20.
NEW-LINE NO-SCROLLING.
else.
NEW-LINE SCROLLING.
endif.
ENDCASE.
ENDLOOP.
SET BLANK LINES OFF.
v_index = 1.
endif.
ENDFORM. " Print
*& Form Write_Values
text
--> p1 text
<-- p2 text
FORM Write_Values .
if p_print = 'X'.
loop at i_sent.
write :/ sy-vline,2 i_sent-pernr,18 sy-vline,
19 i_sent-name,40 sy-vline,
41 i_sent-usrid_long,63 sy-vline,
64 i_sent-status,70 sy-vline.
ULINE /1(70).
endloop.
endif.
ENDFORM. " Write_Values
i want to send the contents of objtxt has body.
cheersHi,
in the below code, BOLD Characters coming as body text in my mail.after that i am attaching V_LINE as the attachment.pl compare this with ur code.
revert, if you need any clarifications.
<b>*-populate body text</b>
CONCATENATE <b>'Japan BOL details for the Delivery#'
V_VBELN
',is attached'</b> INTO WA_OBJTXT SEPARATED BY SPACE.
APPEND WA_OBJTXT TO IT_OBJTXT.
<b>*---- Append Date and Time into Body of email.</b>
MOVE 'File is generated on'(004) TO V_INFO.
V_TIME = SY-UZEIT.
WRITE : SY-UZEIT TO V_TIME USING EDIT MASK '__:__:__'.
CONCATENATE V_TIME+0(2)
V_TIME+2(2)
V_TIME+4(2)
INTO
V_TIME2 SEPARATED BY ':'.
WRITE : sy-datum MM/DD/YYYY TO lv_date .
CONCATENATE SY-DATUM+4(2)
SY-DATUM+6(2)
SY-DATUM+0(4)
INTO V_DATE.
CONCATENATE <b>V_INFO
V_DATE
'At'
V_TIME2
INTO V_INFO</b> SEPARATED BY SPACE.
<b>WA_OBJTXT = V_INFO.</b> APPEND WA_OBJTXT TO IT_OBJTXT.
*-document size
CLEAR : V_TABLE_LINES.
DESCRIBE TABLE IT_OBJTXT LINES V_TABLE_LINES.
READ TABLE IT_OBJTXT INTO WA_OBJTXT INDEX V_TABLE_LINES.
X_DOC_CHNG-DOC_SIZE =
( V_TABLE_LINES - 1 ) * 255 + STRLEN( WA_OBJTXT ).
*-populate packing list for body text
CLEAR IT_OBJPACK-TRANSF_BIN.
WA_OBJPACK-HEAD_START = 1.
WA_OBJPACK-HEAD_NUM = 0.
WA_OBJPACK-BODY_START = 1.
WA_OBJPACK-BODY_NUM = V_TABLE_LINES.
WA_OBJPACK-DOC_TYPE = 'RAW'.
APPEND WA_OBJPACK TO IT_OBJPACK.
CLEAR WA_OBJPACK.
*--for attachment
*--add Internal table lines here, as attachment.
WA_OBJBIN = V_LINE.
APPEND WA_OBJBIN TO IT_OBJBIN.
CLEAR WA_OBJBIN.
*-get total no.of lines of Object table(attachment)
CLEAR : V_TABLE_LINES.
DESCRIBE TABLE IT_OBJBIN LINES V_TABLE_LINES.
*-populate object header
CONCATENATE 'Delivery#'(005)
V_VBELN
SY-DATUM
V_TIME
INTO
WA_OBJHEAD SEPARATED BY SPACE.
APPEND WA_OBJHEAD TO IT_OBJHEAD.
CLEAR WA_OBJHEAD.
*-packing list for attachment
WA_OBJPACK-TRANSF_BIN = C_X.
WA_OBJPACK-HEAD_START = 1.
WA_OBJPACK-HEAD_NUM = 1.
WA_OBJPACK-BODY_START = 1.
WA_OBJPACK-BODY_NUM = V_TABLE_LINES .
WA_OBJPACK-DOC_TYPE = 'CSV' .
WA_OBJPACK-DOC_TYPE = 'RAW' .
WA_OBJPACK-OBJ_NAME = 'POTR'.
CONCATENATE 'Delivery details for '(005)
CONCATENATE TEXT-005
V_VBELN
SY-DATUM
V_TIME
'.CSV'
INTO
WA_OBJPACK-OBJ_DESCR SEPARATED BY SPACE.
BREAK-POINT.
WA_OBJPACK-DOC_SIZE = V_TABLE_LINES * 255.
APPEND WA_OBJPACK TO IT_OBJPACK.
CLEAR WA_OBJPACK. -
XI Mail Adapter: Sending an XML attachment
Hi
I want to send an xml attachment using the XI Mail adapter. I have configured the adapter correctly and am currently receiving the email message.
My issue is that my attachment has a .txt extention and I want it to have a .xml extn.
I have seen a variety of web blogs around but none of these have helped.
I have also changed my configuration from XIPAYLOAD to XIALL and still cannot get my payload message as a .xml attachment.
When I config my adapter to use XIALL i get 2 attachments, a SOAP.xml and the my payload wiht the filename:
[email protected]
When I use XIPAYLOAD, with the keep attachment option ticked, I get an attachment with a .txt extn.
I am convinced there must be a J2EE setting or maybe a ABAP config paramter that I need to update to get the .xml extn.
Any help is greatly appreciated.
Regards
YackeenHi Yackeen,
You can use localejbs/AF_Modules/MessageTransformBean
You have to set the parameter :
Transform.ContentDisposition as
attachment;filename=myFileName.xml>
Best regards,
Bela -
Mail the local files as attachment and some body text
hello Exprests
I have a requirement where i have to mail the local files as attachment and some body text also...
I am using the following code, and the problem is that i am getting a blank TXT as an attachment.
Please help me solve this issue, if u change the spool request no., client & put ur mail id and execute it u will find that apart from the pdf we get an un wanted attachment also..
Please suggest me the solution..
WORK TABLE AREAS
TABLES: tsp01.
INTERNAL TABLES
DATA: lt_rec_tab LIKE STANDARD TABLE OF soos1 WITH HEADER LINE,
lt_note_text LIKE STANDARD TABLE OF soli WITH HEADER LINE,
lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE.
DATA: lt_objcont LIKE STANDARD TABLE OF soli WITH HEADER LINE,
lt_objhead LIKE STANDARD TABLE OF soli WITH HEADER LINE.
DATA: pdf_format LIKE STANDARD TABLE OF tline WITH HEADER LINE.
TYPES: BEGIN OF y_files,
file(60) TYPE c,
END OF y_files.
DATA: lt_files TYPE STANDARD TABLE OF y_files WITH HEADER LINE.
DATA: l_objcont LIKE soli OCCURS 0 WITH HEADER LINE.
DATA: l_objhead LIKE soli OCCURS 0 WITH HEADER LINE.
STRUCTURES
DATA: folder_id LIKE soodk,
object_id LIKE soodk,
link_folder_id LIKE soodk,
g_document LIKE sood4,
g_header_data LIKE sood2,
g_folmem_data LIKE sofm2,
g_header_data LIKE sood2,
g_receive_data LIKE soos6,
g_ref_document LIKE sood4,
g_new_parent LIKE soodk,
l_folder_id LIKE sofdk,
v_email(50).
DATA: hd_dat LIKE sood1.
VARIABLES
DATA: client LIKE tst01-dclient,
name LIKE tst01-dname,
objtype LIKE rststype-type,
type LIKE rststype-type.
DATA: numbytes TYPE i,
arc_idx LIKE toa_dara,
pdfspoolid LIKE tsp01-rqident,
jobname LIKE tbtcjob-jobname,
jobcount LIKE tbtcjob-jobcount,
is_otf.
DATA: outbox_flag LIKE sonv-flag VALUE 'X',
store_flag LIKE sonv-flag,
delete_flag LIKE sonv-flag,
owner LIKE soud-usrnam,
on LIKE sonv-flag VALUE 'X',
sent_to_all LIKE sonv-flag,
g_authority LIKE sofa-usracc,
w_objdes LIKE sood4-objdes.
DATA: c_file LIKE rlgrap-filename,
n_spool(6) TYPE n.
DATA: cancel.
DATA: desired_type LIKE sood-objtp,
real_type LIKE sood-objtp,
attach_type LIKE sood-objtp,
otf LIKE sood-objtp VALUE 'OTF', " SAPscript Ausgabeformat
ali LIKE sood-objtp VALUE 'ALI'. " ABAP lists
CONSTANTS
CONSTANTS: ou_fol LIKE sofh-folrg VALUE 'O',
c_objtp LIKE g_document-objtp VALUE 'RAW',
c_file_ext LIKE g_document-file_ext VALUE 'TXT'.
*=======================================================================
*=
*=========
*z_send_email_fax2
*function z_faian_mail_fax2.
""Interface local:
*" IMPORTING
*" REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
*" REFERENCE(FAX_MAIL_NUMBER) TYPE SO_NAME
*" REFERENCE(HEADER_MAIL) TYPE SO_OBJ_DES
*" REFERENCE(OBJECT_TYPE) TYPE SO_ESCAPE
*" TABLES
*" LT_BODY_EMAIL STRUCTURE SOLI
*" EXCEPTIONS
*" ERR_NO_ABAP_SPOOLJOB
Fist part: Verify if the spool really exists
*select single * from tsp01 where rqident = src_spoolid.
DATA src_spoolid TYPE tsp01-rqident VALUE '23242'.
DATA header_mail TYPE so_obj_des.
DATA lt_body_email TYPE STANDARD TABLE OF soli WITH HEADER LINE.
DATA l_t VALUE '1'.
header_mail = 'Subject line of mail'.
IF l_t = '1' .
RAISE err_no_abap_spooljob. "doesn't exist
*ELSE.
client = '200'."tsp01-rqclient.
name = 'SPOOL0000023242'."tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = client
name = name
part = 1
IMPORTING
type = type
objtype = objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4
OTHERS = 5.
IF objtype(3) = 'OTF'.
desired_type = otf.
ELSE.
desired_type = ali.
ENDIF.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = src_spoolid
desired_type = desired_type
IMPORTING
real_type = real_type
TABLES
buffer = l_objcont
EXCEPTIONS
no_such_job = 14
type_no_match = 94
job_contains_no_data = 54
no_permission = 21
can_not_access = 21
read_error = 54.
IF sy-subrc EQ 0.
attach_type = real_type.
ENDIF.
CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
owner = sy-uname
region = ou_fol
IMPORTING
folder_id = l_folder_id
EXCEPTIONS
OTHERS = 5.
fill out informations about the header of the email
CLEAR: g_document.
g_document-foltp = l_folder_id-foltp.
g_document-folyr = l_folder_id-folyr.
g_document-folno = l_folder_id-folno.
g_document-objtp = c_objtp.
g_document-objdes = header_mail.
g_document-file_ext = c_file_ext.
g_header_data-objdes = header_mail.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
method = 'SAVE'
office_user = sy-uname
IMPORTING
authority = g_authority
TABLES
objcont = lt_body_email
attachments = lt_attachments
CHANGING
document = g_document
header_data = g_header_data
EXCEPTIONS
OTHERS = 1.
folder_id-objtp = l_folder_id-foltp.
folder_id-objyr = l_folder_id-folyr.
folder_id-objno = l_folder_id-folno.
object_id-objtp = c_objtp.
object_id-objyr = g_document-objyr.
object_id-objno = g_document-objno.
link_folder_id-objtp = l_folder_id-foltp.
link_folder_id-objyr = l_folder_id-folyr.
link_folder_id-objno = l_folder_id-folno.
REFRESH lt_rec_tab.
CLEAR lt_rec_tab.
lt_rec_tab-sel = 'X'.
lt_rec_tab-recesc = object_type. "This field for FAX/MAIL
lt_rec_tab-recnam = 'U-'.
lt_rec_tab-deliver = 'X'.
lt_rec_tab-not_deli = 'X'.
lt_rec_tab-read = 'X'.
lt_rec_tab-mailstatus = 'E'.
lt_rec_tab-adr_name = fax_mail_number.
lt_rec_tab-sortfield = fax_mail_number.
lt_rec_tab-recextnam = fax_mail_number.
lt_rec_tab-sortclass = '5'.
APPEND lt_rec_tab.
lt_rec_tab-recextnam = ."Email id .
lt_rec_tab-recesc = 'U'. "object_type.
lt_rec_tab-sndart = 'INT'.
lt_rec_tab-sndpri = 1.
APPEND lt_rec_tab.
c_file = 'C:\Documents and Settings\abgupta\Desktop\Abhinav\zpk.txt'.
lt_files-file = c_file.
APPEND lt_files.
begin of insertion by faianf01
hd_dat-objdes = header_mail.
CALL FUNCTION 'SO_ATTACHMENT_INSERT'
EXPORTING
object_id = object_id
attach_type = attach_type
object_hd_change = hd_dat
owner = sy-uname
TABLES
objcont = l_objcont
objhead = l_objhead
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
object_type_not_exist = 17
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
x_error = 1000.
IF sy-subrc > 0.
ENDIF.
end of insertion by faianf01
lt_note_text-line = 'test prgram for email'.
APPEND lt_note_text.
send email from SAPOFFICE
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = folder_id
object_id = object_id
outbox_flag = outbox_flag
link_folder_id = link_folder_id
owner = sy-uname
check_send_authority = 'X'
TABLES
receivers = lt_rec_tab
note_text = lt_note_text
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
component_not_available = 1
folder_no_authorization = 5
folder_not_exist = 6
forwarder_not_exist = 8
object_no_authorization = 13
object_not_exist = 14
object_not_sent = 15
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
too_much_receivers = 73
user_not_exist = 35.
ENDIF.
COMMIT WORK AND WAIT.Hi!
Add the actual body right after the line, you have created the Multipart object.
// create and fill the first message part
MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setText(this.text); //body of message
Multipart mp = new MimeMultipart();
// Adding the body
mp.addBodyPart(mbp1);
//adding attachments
//... and so on...-Raine- -
E-mailing report output as an attachment
Hi Experts,
My requirement is to automatically e-mail the output of a report. I want my program to e-mail whatever appears on the output screen as an attachment(pdf or html), when the report is executed.
Thanks,
Rakesh.hi rakesh,
you can check this program.
here you can replace
1. your internal table
2. body message
3. attatchment.
4. receivers
please debug this one you will get clear idea where you can have correct replacement.
please check this.
report y_cr17_mail.
data method1 like sy-ucomm.
data g_user like soudnamei1.
data g_user_data like soudatai1.
data g_owner like soud-usrnam.
data g_receipients like soos1 occurs 0 with header line.
data g_document like sood4 .
data g_header like sood2.
data g_folmam like sofm2.
data g_objcnt like soli occurs 0 with header line.
data g_objhead like soli occurs 0 with header line.
data g_objpara like selc occurs 0 with header line.
data g_objparb like soop1 occurs 0 with header line.
data g_attachments like sood5 occurs 0 with header line.
data g_references like soxrl occurs 0 with header line.
data g_authority like sofa-usracc.
data g_ref_document like sood4.
data g_new_parent like soodk.
data: begin of g_files occurs 10 ,
text(4096) type c,
end of g_files.
data : fold_number(12) type c,
fold_yr(2) type c,
fold_type(3) type c.
parameters ws_file(4096) type c default 'c:\debugger.txt'.
Can me any file fromyour pc ....either xls or word or ppt etc ...
g_user-sapname = sy-uname.
call function 'SO_USER_READ_API1'
exporting
user = g_user
PREPARE_FOR_FOLDER_ACCESS = ' '
importing
user_data = g_user_data
EXCEPTIONS
USER_NOT_EXIST = 1
PARAMETER_ERROR = 2
X_ERROR = 3
OTHERS = 4
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
fold_type = g_user_data-outboxfol+0(3).
fold_yr = g_user_data-outboxfol+3(2).
fold_number = g_user_data-outboxfol+5(12).
clear g_files.
refresh : g_objcnt,
g_objhead,
g_objpara,
g_objparb,
g_receipients,
g_attachments,
g_references,
g_files.
method1 = 'SAVE'.
g_document-foltp = fold_type.
g_document-folyr = fold_yr.
g_document-folno = fold_number.
g_document-objtp = g_user_data-object_typ.
*g_document-OBJYR = '27'.
*g_document-OBJNO = '000000002365'.
*g_document-OBJNAM = 'MESSAGE'.
g_document-objdes = 'sap-img.com testing by program'.
g_document-folrg = 'O'.
*g_document-okcode = 'CHNG'.
g_document-objlen = '0'.
g_document-file_ext = 'TXT'.
g_header-objdes = 'sap-img.com testing by program'.
g_header-file_ext = 'TXT'.
call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
exporting
method = method1
office_user = sy-uname
ref_document = g_ref_document
new_parent = g_new_parent
importing
authority = g_authority
tables
objcont = g_objcnt
objhead = g_objhead
objpara = g_objpara
objparb = g_objparb
recipients = g_receipients
attachments = g_attachments
references = g_references
files = g_files
changing
document = g_document
header_data = g_header
FOLMEM_DATA =
RECEIVE_DATA =
File from the pc to send...
method1 = 'ATTCREATEFROMPC'.
g_files-text = ws_file.
append g_files.
call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
exporting
method = method1
office_user = g_owner
ref_document = g_ref_document
new_parent = g_new_parent
importing
authority = g_authority
tables
objcont = g_objcnt
objhead = g_objhead
objpara = g_objpara
objparb = g_objparb
recipients = g_receipients
attachments = g_attachments
references = g_references
files = g_files
changing
document = g_document
header_data = g_header
method1 = 'SEND'.
g_receipients-recnam = 'MK085'.
g_receipients-recesc = 'B'.
g_receipients-sndex = 'X'.
append g_receipients.
call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
exporting
method = method1
office_user = g_owner
ref_document = g_ref_document
new_parent = g_new_parent
importing
authority = g_authority
tables
objcont = g_objcnt
objhead = g_objhead
objpara = g_objpara
objparb = g_objparb
recipients = g_receipients
attachments = g_attachments
references = g_references
files = g_files
changing
document = g_document
header_data = g_header.
One more code:
REPORT ZSAP_EMAIL MESSAGE-ID Z001.
*TABLES: rlgrap, btcxpm." zlookup.
DATA:
V_ZCODE(3) TYPE C,
*svrname LIKE zlookup-zdesc,
WA_ERROR(80) TYPE C,
GLOBAL_FILEMASK_ALL(80).
DATA: T_SOUD LIKE SOUD.
DATA: P_INFOLDER LIKE SOFDK.
DATA: P_OUTFOLDER LIKE SOFDK.
DATA: OBJECT_HD_DISPLAY LIKE SOOD2.
DATA: OBJECT_ID LIKE SOODK.
DATA: DOCUMENT LIKE SOOD4.
DATA: HEADER_DATA LIKE SOOD2.
DATA: LINK_FOLDER_ID LIKE SOODK.
DATA: FOLDER_SELECTIONS LIKE SOFDS.
DATA: FOLDER_LIST LIKE SOXLI OCCURS 0 WITH HEADER LINE.
DATA: RECEIVERS LIKE SOOS1 OCCURS 0 WITH HEADER LINE.
DATA: OBJCONT LIKE SOLI OCCURS 0 WITH HEADER LINE.
DATA: OBJHEAD LIKE SOLI OCCURS 0 WITH HEADER LINE.
DATA: OBJECT_CONTENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
DATA: OBJECT_HD_CHANGE LIKE SOOD1.
DATA: BEGIN OF FILES OCCURS 0,
LINE(200) TYPE C,
END OF FILES.
DATA: LISTOBJECT LIKE ABAPLIST OCCURS 1 WITH HEADER LINE.
*Email to addresses
SELECTION-SCREEN: BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-BL1.
PARAMETERS: P_MAILTO(240) TYPE C.
*PARAMETERS:P_MAILTO TYPE SOLI-LINE.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN COMMENT 10(2) TEXT-001.
*Use zlookup-ztype as group to define multiple email to addresses
*SELECT-OPTIONS: s_mailto FOR zlookup-ztype.
SELECTION-SCREEN: END OF BLOCK BL1.
*Subject
SELECTION-SCREEN: BEGIN OF BLOCK BL2 WITH FRAME TITLE TEXT-BL2.
PARAMETERS: P_SUBJ LIKE DOCUMENT-OBJDES.
SELECTION-SCREEN: END OF BLOCK BL2.
*Body
SELECTION-SCREEN: BEGIN OF BLOCK BL3 WITH FRAME TITLE TEXT-BL3.
PARAMETERS: P_BODY1 LIKE SOLISTI1-LINE LOWER CASE.
PARAMETERS: P_BODY2 LIKE SOLISTI1-LINE LOWER CASE.
PARAMETERS: P_BODY3 LIKE SOLISTI1-LINE LOWER CASE.
PARAMETERS: P_BODY4 LIKE SOLISTI1-LINE LOWER CASE.
PARAMETERS: P_BODY5 LIKE SOLISTI1-LINE LOWER CASE.
PARAMETERS: P_BODY6 LIKE SOLISTI1-LINE LOWER CASE.
SELECTION-SCREEN: END OF BLOCK BL3.
*Attachments
SELECTION-SCREEN: BEGIN OF BLOCK BL4 WITH FRAME TITLE TEXT-BL4.
PARAMETERS: P_FNAME1 LIKE FILES-LINE.
PARAMETERS: P_FNAME2 LIKE FILES-LINE.
PARAMETERS: P_FNAME3 LIKE FILES-LINE.
PARAMETERS: P_FNAME4 LIKE FILES-LINE.
PARAMETERS: P_FNAME5 LIKE FILES-LINE.
PARAMETERS: P_FNAME6 LIKE FILES-LINE.
SELECTION-SCREEN: END OF BLOCK BL4.
AT SELECTION-SCREEN.
PERFORM CHK_SELECTION.
IF NOT WA_ERROR IS INITIAL.
MESSAGE E001 WITH WA_ERROR.
ENDIF.
START-OF-SELECTION.
END-OF-SELECTION.
PERFORM SEND_EMAIL.
FORM chk_selection
FORM CHK_SELECTION.
CLEAR WA_ERROR.
*Loop only once ???
*If more checkings to be done.
*Think about it and if not clear.
*Let it sink in for a couple of minutes.
*Still doesn't make sence? Go home and sleep on it.
DO 1 TIMES.
*Check Email to
IF P_MAILTO IS INITIAL .
*AND s_mailto IS INITIAL.
WA_ERROR = 'Invalid or no EMAIL TO selection'.
EXIT.
ENDIF.
ENDDO.
ENDFORM. "chk_selection
*& Form send_email
*text
*--> p1 text
*<-- p2 text
FORM SEND_EMAIL.
PERFORM GET_FOLDER_INFO.
PERFORM FILL_BODY.
PERFORM INS_NEW_OBJECT.
PERFORM CRT_ATTACHMENTS.
PERFORM FILL_RECEIVERS_INFO.
PERFORM SND_EMAIL.
ENDFORM. " send_email
*--+--
*FORM Get_folder_info
FORM GET_FOLDER_INFO.
CLEAR T_SOUD.
*Small so should be quick.
SELECT * FROM SOUD
INTO T_SOUD
WHERE SAPNAM = SY-UNAME.
P_INFOLDER-FOLTP = 'FOL'.
P_INFOLDER-FOLYR = T_SOUD-INBYR. "inbox
P_INFOLDER-FOLNO = T_SOUD-INBNO.
P_OUTFOLDER-FOLTP = 'FOL'.
P_OUTFOLDER-FOLYR = T_SOUD-OUTYR. "outbox
P_OUTFOLDER-FOLNO = T_SOUD-OUTNO.
ENDSELECT.
ENDFORM. "get_folder_info
*FORM fill_body *
FORM FILL_BODY.
OBJECT_CONTENT-LINE = P_BODY1.
APPEND OBJECT_CONTENT.
OBJECT_CONTENT-LINE = P_BODY2.
APPEND OBJECT_CONTENT.
OBJECT_CONTENT-LINE = P_BODY3.
APPEND OBJECT_CONTENT.
OBJECT_CONTENT-LINE = P_BODY4.
APPEND OBJECT_CONTENT.
OBJECT_CONTENT-LINE = P_BODY5.
APPEND OBJECT_CONTENT.
OBJECT_CONTENT-LINE = P_BODY6.
APPEND OBJECT_CONTENT.
ENDFORM. "fill_body
*FORM ins_new_object *
FORM INS_NEW_OBJECT.
OBJECT_HD_CHANGE-OBJNAM = 'Notes'.
OBJECT_HD_CHANGE-OBJDES = P_SUBJ.
CALL FUNCTION 'SO_OBJECT_INSERT'
EXPORTING
FOLDER_ID = P_OUTFOLDER
OBJECT_HD_CHANGE = OBJECT_HD_CHANGE
OBJECT_TYPE = 'RAW'
OWNER = SY-UNAME
IMPORTING
OBJECT_HD_DISPLAY = OBJECT_HD_DISPLAY
OBJECT_ID = OBJECT_ID
TABLES
OBJCONT = OBJECT_CONTENT
OBJHEAD = OBJHEAD
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 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "ins_new_object
*FORM crt_attachments *
*--> P_SUBJ *
FORM CRT_ATTACHMENTS.
DOCUMENT-FOLTP = P_OUTFOLDER-FOLTP.
DOCUMENT-FOLYR = P_OUTFOLDER-FOLYR.
DOCUMENT-FOLNO = P_OUTFOLDER-FOLNO.
DOCUMENT-OBJTP = OBJECT_ID-OBJTP.
DOCUMENT-OBJYR = OBJECT_ID-OBJYR.
DOCUMENT-OBJNO = OBJECT_ID-OBJNO.
DOCUMENT-OBJNAM = 'Notes'.
DOCUMENT-OBJDES = P_SUBJ.
DOCUMENT-OKCODE = 'CHNG'.
DOCUMENT-FILE_EXT = 'TXT'.
LINK_FOLDER_ID = OBJECT_ID.
HEADER_DATA-OBJLA = 'EN'.
HEADER_DATA-OBJNAM = DOCUMENT-OBJNAM.
HEADER_DATA-OBJDES = DOCUMENT-OBJDES.
HEADER_DATA-OBJPRI = '5'.
HEADER_DATA-OBJSNS = 'O'.
HEADER_DATA-FILE_EXT = 'TXT'.
REFRESH FILES.
CLEAR FILES.
IF NOT P_FNAME1 IS INITIAL.
FILES-LINE = P_FNAME1.
APPEND FILES.
ENDIF.
IF NOT P_FNAME2 IS INITIAL.
FILES-LINE = P_FNAME2.
APPEND FILES.
ENDIF.
IF NOT P_FNAME3 IS INITIAL.
FILES-LINE = P_FNAME3.
APPEND FILES.
ENDIF.
IF NOT P_FNAME4 IS INITIAL.
FILES-LINE = P_FNAME4.
APPEND FILES.
ENDIF.
IF NOT P_FNAME5 IS INITIAL.
FILES-LINE = P_FNAME5.
APPEND FILES.
ENDIF.
IF NOT P_FNAME6 IS INITIAL.
FILES-LINE = P_FNAME6.
APPEND FILES.
ENDIF.
IF NOT FILES[] IS INITIAL.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
METHOD = 'ATTCREATEFROMPC'
TABLES
FILES = FILES
CHANGING
DOCUMENT = DOCUMENT
HEADER_DATA = HEADER_DATA.
IF SY-SUBRC = 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. "crt_attachments
*FORM fill_receivers_info *
FORM FILL_RECEIVERS_INFO.
DATA: BEGIN OF RECLIST OCCURS 0,
REC LIKE RECEIVERS-RECEXTNAM,
END OF RECLIST.
*Build reclist
REFRESH RECLIST.
IF NOT P_MAILTO IS INITIAL.
RECLIST-REC = P_MAILTO.
APPEND RECLIST.
ENDIF.
*IF NOT s_mailto IS INITIAL.
*SELECT zdesc
*INTO reclist-rec
*FROM zlookup
*WHERE ztype IN s_mailto.
*APPEND reclist.
*ENDSELECT.
*ENDIF.
REFRESH RECEIVERS.
LOOP AT RECLIST.
FOLDER_SELECTIONS-FOLNAM = 'INBOX'.
CALL FUNCTION 'SO_FOLDER_LIST_READ'
EXPORTING
FOLDER_SELECTIONS = FOLDER_SELECTIONS
OWNER = SY-UNAME
REGION = 'P'
TABLES
FOLDER_LIST = FOLDER_LIST
EXCEPTIONS
COMPONENT_NOT_AVAILABLE = 1
OPERATION_NO_AUTHORIZATION = 2
OWNER_NOT_EXIST = 3
PARAMETER_ERROR = 4
X_ERROR = 5
OTHERS = 6.
IF SY-SUBRC = 0.
CLEAR RECEIVERS.
MOVE: SY-DATUM TO RECEIVERS-RCDAT,
SY-UZEIT TO RECEIVERS-RCTIM,
' ' TO RECEIVERS-RECESC,
P_MAILTO TO RECEIVERS-RECNAM,
'X' TO RECEIVERS-SNDEX.
APPEND RECEIVERS.
u2022 RECEIVERS-RCDAT = SY-DATUM.
u2022 RECEIVERS-RCTIM = SY-UZEIT.
u2022 RECEIVERS-RECNAM = RECLIST-REC.
u2022 RECEIVERS-RECNO = FOLDER_LIST-PARNO.
u2022 RECEIVERS-RECTP = FOLDER_LIST-PARTP.
u2022 RECEIVERS-RECYR = FOLDER_LIST-PARYR.
u2022 RECEIVERS-SNDTP = FOLDER_LIST-PARTP.
u2022 RECEIVERS-SNDYR = FOLDER_LIST-PARYR.
u2022 RECEIVERS-SNDNO = FOLDER_LIST-PARNO.
u2022 RECEIVERS-SNDNAM = SY-UNAME.
u2022 RECEIVERS-SNDPRI = '1'.
u2022 RECEIVERS-MSGID = 'SO'.
u2022 RECEIVERS-MSGNO = '619'.
u2022 RECEIVERS-DELIVER = 'X'.
u2022 RECEIVERS-NOT_DELI = 'X'.
u2022 RECEIVERS-READ = 'X'.
u2022 RECEIVERS-MAILSTATUS = 'E'.
**receivers-ADR_NAME
u2022 RECEIVERS-RESEND = ' '.
u2022 RECEIVERS-SORTFIELD = ' '. "'USER WF_BATCH INDIGO BATCH'.
u2022 RECEIVERS-SORTCLASS = '5'.
u2022 APPEND RECEIVERS.
ELSE.
CLEAR RECEIVERS.
RECEIVERS-SEL = 'X'.
RECEIVERS-RECESC = 'U'.
RECEIVERS-RECNAM = 'U-'.
RECEIVERS-RECEXTNAM = RECLIST-REC.
RECEIVERS-DELIVER = 'X'.
RECEIVERS-NOT_DELI = 'X'.
RECEIVERS-READ = 'X'.
RECEIVERS-MAILSTATUS = 'E'.
RECEIVERS-ADR_NAME = RECLIST-REC.
RECEIVERS-SORTFIELD = RECLIST-REC.
RECEIVERS-SORTCLASS = '5'.
APPEND RECEIVERS.
ENDIF.
ENDLOOP.
ENDFORM. "fill_receivers_info
*FORM snd_email *
FORM SND_EMAIL.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
FOLDER_ID = P_OUTFOLDER
OBJECT_ID = OBJECT_ID
OUTBOX_FLAG = 'X'
OWNER = SY-UNAME
CHECK_SEND_AUTHORITY = 'X'
ORIGINATOR_TYPE = 'J'
LINK_FOLDER_ID = LINK_FOLDER_ID
TABLES
OBJCONT = OBJECT_CONTENT
RECEIVERS = RECEIVERS
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
ORIGINATOR_NOT_EXIST = 20
X_ERROR = 21
OTHERS = 22.
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. "snd_email
reward me if it is useful.
thanks
AM
Maybe you are looking for
-
Sound stopped working on Audigy 2 ZS Plati
When I installed this sound card, my primary Master hard dri've was a Maxtor 40 GB. I installed the sound card and the driver, and the front-panel I/O dri've, and it all worked perfectly. I just installed a Western Digital 60 GB Hard dri've as the ne
-
Values of select-option in various variants
Hi all, does anybody know a report to determine the values of a specific select-option in various variants of a program? I know the function module RS_VARIANT_CONTENTS to get the values of select-options in one variant of a program (TABLES-parameter
-
K7NG-ILSR 13 multiplier doesn't apear to work
Well, do fully in part to this forums advise I searched the internet for a company that was selling B core Thoroughbred. I found one that people where saying they where getting good luck with so I gave it a shot. Sure enough I got one. Very happy. An
-
How to deploy a servlet in EBS
I need to deploy a personal servlet in EBS, and I have no idea about where or how to do that. Please can some one help me? thinks a lot
-
Hi I've constructed a process JDBC -> ccbpm -> soap The jdbc->ccbpm message interface works correctly but it doesn't start the ccbpm process is there a background job that needs to be scheduled to monitor for ccbpm events or is there some config that