E-Mail Body coming as an attachment
Email body is coming as an attachment while sending external mail through SAP
hi Sudhanshu,
Give a little snippet of your code. It will help us to analyze the problem.
Regards,
Shaheen
Similar Messages
-
In Mail Body Coming as attachment
Hi All,
I have created one Zfunctionmodule , in that i have used one standard function module SO_NEW_DOCUMENT_SEND_API1.
My problem is Body is coming as an attachment in mail instead of displaying directly.
Plz help me on this..
DATA: ls_mail_doc TYPE sodocchgi1,
lt_header TYPE TABLE OF solisti1,
lt_content TYPE TABLE OF solisti1,
lt_reciever TYPE TABLE OF somlreci1,
ls_header TYPE solisti1,
ls_content TYPE solisti1,
ls_reciever TYPE somlreci1.
ls_reciever-rec_type = 'U'.
ls_reciever-receiver = lv_reciver.
ls_reciever-COM_TYPE = 'INT'.
APPEND ls_reciever TO lt_reciever.
ls_mail_doc-obj_name = 'DRAW'.
ls_mail_doc-obj_descr = 'Invoice Rejection Information'.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = ls_mail_doc
document_type = 'RAW'
commit_work = 'X'
IMPORTING
new_object_id = ev_objid
TABLES
object_header = lt_header
object_content = lt_content
receivers = lt_reciever
Regards,
Sivayou can try with following piece of code
DATA: ls_mail_doc TYPE sodocchgi1,
lt_header TYPE TABLE OF solisti1,
lt_content TYPE TABLE OF solisti1,
lt_reciever TYPE TABLE OF somlreci1,
ls_header TYPE solisti1,
ls_content TYPE solisti1,
ls_reciever TYPE somlreci1,
L_WA_TXT TYPE SOLISTI1,
ev_objid type SOFOLENTI1-OBJECT_ID.
ls_reciever-rec_type = 'U'.
ls_reciever-receiver = 'xyz@xyz..'. " put your email id here
ls_reciever-COM_TYPE = 'INT'.
APPEND ls_reciever TO lt_reciever.
ls_mail_doc-obj_name = 'DRAW'.
ls_mail_doc-obj_descr = 'Invoice Rejection Information'.
L_WA_TXT = 'content of the mail'.
APPEND L_WA_TXT TO lt_content.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = ls_mail_doc
document_type = 'RAW'
commit_work = 'X'
IMPORTING
new_object_id = ev_objid
TABLES
object_header = lt_header
object_content = lt_content
receivers = lt_reciever.
Best Regards
Sanju.Pal -
How to make the main payload be sent as mail body
Hi,
Currently, I want to send out a mail with several attachments by Mail adapter. And <b>the main payload</b> should be sent out as <b>mail body</b> instead of attachment. I know by default, the main payload is also sent as a attachment. So I used the module AF_Modules/MessageTransformBean to make the main payload be sent as mail body instead of attachment. It does work in case there's no attachment to be sent. However if I want to send<b> a mail with several attachments</b> (the attachment is created in my own adapter module using method message.createPayload()), in this case if I use the module AF_Modules/MessageTransformBean, the main payload is sent as mail body , however meanwhile, it is also sent as a attachment. And the attachment I created is also sent as attachment. This is not expected by me. In this case, I wish <b>the main payload</b> is <b>only sent as mail body</b> and <b>other payload</b> created by me as attachment.
Do you have any idea about it?
Thankshi
go through this links:
/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
/people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
Thanks -
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.) -
Receiver Mail Adapter - Mail body as attachment
Hello friends,
I have scenario = File -> XI -> Mail
The scenario is working but the problem is body of the email is coming as attachment in the mail client.(outlook express)
Is there any way to avoid the body coming as attachment.
Regards
Ramesh PHi Ramesh,
You can use the MessageTransformBean in the receiver mail adapter for this.
Refer this for the parameters which you can use
http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/content.htm
Regards,
Chandra -
Content coming as .txt attachment along with email but not in email body
Hi,
I have a proxy to email scenario. The requirement is to generate an excel sheet and keep it as an attachment and send it to user through email.
I am able to get the excel sheet as an attachment in email but the content of email is also coming as attachment which I do not want.
Problem area :
============================================
The Content should come in Email body but it is coming as .txt attachment in email. The email body is blank.
Can someone help as how I can get the content in email body.?
/Regds
AzaharHi Azahar,
May you can find the solution in the "
Adapter-Specific Message Attributes
Configuring the Receiver Mail Adapter (SAP Library - Partner Connectivity Kit) -
Mail Adapter Use Mail Package, Mail Body and Attachment
Hello
Have some body a idea, how I can configure the mail adapter with use mail package, that I have in the mail a attachment with content from the messages and a mail body with also text from the message.
Thanks for your reply.
Regards Tom
The different Weblog , I have check:
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-addressHi Thomas,
If you are configuring your Mail adapter as reciever then refer
http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm
your sender (say file) should have some message like this
<i>
<ml:Mail xmlns:ml=http://sap.com/xi/XI/Mail/30>
<Subject>Important</Subject>
<From>[email protected]</From>
<To>[email protected]</To>
<X_Mailer>Outlook Express </X_Mailer>
<Content>
This is the content.
</Content>
</ml:Mail></i>
And for Sender Mail Adpater
http://help.sap.com/saphelp_nw04/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm
Hope this will be helpful
Regards
Suraj -
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- -
Mail body from SBWP always as attachment
Hi there,
I want to send simple mails from Business Workplace to external users (internet address).
The problem is, that the body always comes as attachment (txt-file) with the mail to the user. Not as body text in his mail client.
Any help would be greatly appreciated,
BerndHello Bernd,
It is working as design. If you use the disclosure, than it will be
put in the body, and all previous mail parts will be sent as attachment.
The reason behind is, that SAP do not want to modify the original body
of the mail.
If you want to have a different behaviour, than you can design an own
send program, where you put the disclaimer in the body itself.
Regards,
Wen Peng -
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".
-
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. -
How to put mail body while sending Payment Advice Note by mail
Hi,
I am sending payment advice form through mail using the BTE 2040.
Everything is fine and mail is coming properly but mail does not have any body line. It just contains the PDF as an attachment.
I want to put mail body in that. I have just copied the Script, I have not copied the driver program.
E.g
Hello,
Please find the payment advice note as an attachment.
Kindly advice how to put mail body in that mail, is there any BTE through which we can put the mail body?
Kindly help.
Regards
Sachin YadavHi,
I am sending payment advice form through mail using the BTE 2040.
Everything is fine and mail is coming properly but mail does not have any body line. It just contains the PDF as an attachment.
I want to put mail body in that. I have just copied the Script, I have not copied the driver program.
E.g
Hello,
Please find the payment advice note as an attachment.
Kindly advice how to put mail body in that mail, is there any BTE through which we can put the mail body?
Kindly help.
Regards
Sachin Yadav -
Email Delivery Option - Simple TEXT Output is coming as an attachment
Hi All,
I am trying to use R12.1.3 feature "Delivery Option" while Submitting Concurrent Program "Payables Open Interface Import" using FND_SUBMIT with email Delivery Option and email is coming with an attachment (Concurrent Program Output).
Email Body is blank (as expected if Output is coming as an attachment), as per documentation if CP Output is in TEXT Format then Email body should show the Output instead of an attachment.
My Question, is if Output is TEXT why it is coming as an attachment, do I need to Configure something?
I am using and it is working fine(not sure if any of the argument is required to Set "SMTP_CONTENT_TYPE",
l_ret := fnd_request.add_delivery_option
(type => FND_DELIVERY.TYPE_EMAIL
,p_argument1 => 'Quick Invoice to Workbench Transfer Details' -- Subject
,p_argument2 => '[email protected]' -- From
,p_argument3 => l_email_add -- To
,p_argument4 => '[email protected]'); -- CC
In Java Based Concurrent Program example, I foudn this line, not sure how to do that using PL/SQL
req.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_TYPE, "application/pdf");
Please Help.
Regards
SachinHello Kamath,
Have you set PARAMETER6 to true or false?
http://docs.oracle.com/cd/E28280_01/bi.1111/e22258/add_burst_def.htm#CHEJDGAG
Please send us your bursting query so we can check it.
For more info on this, please review section 7.3 Adding a Bursting Definition to Your Data Model
from Fusion Middleware Data Modeling Guide for Oracle Business Intelligence Publisher
http://docs.oracle.com/cd/E28280_01/bi.1111/e22258/add_burst_def.htm#BIPDM347
Bogdan -
Mail not sent as an attachment
Hi,
I create a Service Process and then a Complaint for it by copying a material.
Next I click a Return Request, Subsequent Delivery and then Credit Memo. After this a mail will be sent to the Email address of Sold to Party.
The Email is generated using a Smartform. The output of Smartform should arrive as a PDF attachment in mail but it is not coming as an attachment.
It is coming as a simple mail. is there any setting to be made for this.
Thanks,
PrasannaHi Prasanna,
you can change this in transaction 'scot' (double click on SMTP --> Button 'Set').
Regards
Thomas -
Hi All,
I need to know whether it is possible to use multiple font styles in the body of an e-mail sent through a report program.
I am using the FM 'SO_DOCUMENT_REPOSITORY_MANAGER' as I want to send a document from the desktop as an e-mail attachment.
The FM 'SO_DOCUMENT_SEND_API1' does not serve the primary purpose of my requirement. So, it is eliminated.
Please suggest any method to achieve the requirement of using multiple font styles in e-mail body.
Thanks,
DawoodIf you set the document to be a HTML type, then you can use HTML scripting to set
the font.
Create send request
send_request = cl_bcs=>create_persistent( ).
Create html content:
mail_line = '.mail TBODY,{font-family:verdana;font-size:10pt;}'.
append mail_line TO mail_text.
... (your text)
Create document with type 'HTM' and provide your HTML scripting
document = cl_document_bcs=>create_document( i_type = 'HTM'
i_text = mail_text
i_subject = 'Subject' ).
Add document to send request
CALL METHOD send_request->set_document( document ).
Send document
CALL METHOD send_request->send( ).
Maybe you are looking for
-
hello, I am using report builder 6i. I want print on half page but the printer LQ-300+ uses full page. i want to print two receipts from one pages. Thanks iftikhar
-
How do I change the size of a Spry Input Text field box?
I created an email reply box, and then I created a reply message box. How do I change the size of each box independantly of each other? All I have is one set of Spry CSS rules! Oh, and the Working with the Validation Text Rule widget file in the Help
-
When I go to gmail, and enter my username and password I get the error message: ''The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem
-
Using Native Dynamic SQL in Forms
Can Native Dynamic SQL be used in Forms 5.0 or Forms 6.0? (Database 8.1.6.0.0) I have tried the following code (examples below) from the PL/SQL User's Guide and Reference Release 8.1.6 and the Metalinks Note: 62592.1 and the trigger/procedure (in For
-
I laid out some pages in DreamWeaver CS3 with a background image I applied to the page using the page properties window. The image is set not to repeat. In older versions of Internet Explorer the text is smeared like a bad fax where the background im