How To send the text document as a attachment using a 'So_object_send'
Hi,
I want to send a mail to user in sap office.
I had used a function module 'SO_OBJECT_SEND'.
Also, I need to send all the attachments (like files .XLS,.TXT etc) in the mail as a attachment.
Please tell me how to pass the attachment to the Function module 'So_object_send'.
Thanks in advance
Regards,
Darshana
You should use FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail with attachments.
Below is the code for your reference :
Doc data
WL_DOC_DATA-OBJ_NAME = TEXT-031. "Survey Data
WL_DOC_DATA-OBJ_DESCR = TEXT-031. "Survey Data
WL_DOC_DATA-OBJ_LANGU = C_LANG_EN. "E
Receiver's details
WL_RECEIVERS-RECEIVER = ABCD AT XYZ DOT COM."l_survey_recipient_email.
WL_RECEIVERS-REC_TYPE = C_REC_TYPE. "U
WL_RECEIVERS-COM_TYPE = C_COMM_TYP. "INT
WL_RECEIVERS-NOTIF_DEL = C_CHK. "X
WL_RECEIVERS-NOTIF_NDEL = C_CHK. "X
APPEND WL_RECEIVERS TO TL_RECEIVERS.
Mail subject
WL_HEADER-LINE = TEXT-036. "Mail
APPEND WL_HEADER TO TL_HEADER.
LOOP AT TL_EMAIL_TAB2 INTO WL_HEADER2.
CONCATENATE WL_HEADER2-MESSAGE C_TAB INTO L_STRING.
CONCATENATE C_RET L_STRING INTO WL_OBJTXT-LINE SEPARATED BY SPACE.
APPEND WL_OBJTXT TO TL_OBJTXT.
ENDLOOP. "LOOP AT tl_email_ta..
DESCRIBE TABLE TL_OBJTXT LINES L_LINES.
L_TMP = L_LINES * 255.
MOVE L_TMP TO L_DOC_SIZE.
CONDENSE L_DOC_SIZE.
WL_PACK-HEAD_START = 1.
WL_PACK-HEAD_NUM = 0.
WL_PACK-BODY_START = 1.
WL_PACK-BODY_NUM = L_LINES.
WL_PACK-DOC_TYPE = C_DOC_TYP. "RAW
WL_PACK-OBJ_LANGU = C_LANG_EN. "E
WL_PACK-DOC_SIZE = L_DOC_SIZE.
APPEND WL_PACK TO TL_PACK.
Call function module to send the email to the survey recipient
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WL_DOC_DATA
PUT_IN_OUTBOX = C_CHK "X (Check)
COMMIT_WORK = C_CHK "X (Check)
TABLES
PACKING_LIST = TL_PACK
OBJECT_HEADER = TL_HEADER
CONTENTS_TXT = TL_OBJTXT
RECEIVERS = TL_RECEIVERS
IF SY-SUBRC = 0.
SUBMIT RSCONN01 WITH MODE = 'INT'
WITH OUTPUT = 'X'
AND RETURN.
ENDIF.
Regards,
NaPPy
Similar Messages
-
How to send the Adobe page as mail attachement from webdynpro...
Hi Experts,
How to send the Adobe page as external mail attachment from webdynpro automatically (for example: If I input the data for sales order in a view and created the sales order, if the sales order is created then have to place the created sales order number and the some details in a adobe form and should send as external mail and have to specifying the body as "Sales order created and details can be found in the attached adobe form" from webdynpro).
Do the needful.
Thanks & regards,
Ravi.Hi ravi,
See the WDA forum for the how to attach a file in webdynpro component for the attachments. -
How to export the text animation in Captivate and use it in Flash ?
I have published the text animation as swf and tried to import it into flash as a movie clip but it does not seem to work.
I have type the text " WELCOME" font size 70 using text animation and I want to use this as a movie clip in Flash.
There is in the menu File ---> Export----> to CS5 Flash . This is not working for the animated text.
I also tried publishing as swf and import it into the library of my Flash CS5.5 . This is not working as well.
I have removed the video skining , which means no buttons so that it is less complicated . -
im just trying to find out how to send a message on the mac ...... someone please help ! thanks so much !
HI,
This is fairly generic (for iChat 4) although some links are out of date.
Start at the second menu down that says "Get a Screen Name"
http://www.ralphjohns.co.uk/versions/ichatvers4/howtos4.html
iChat 5 is virtually no different
iChat 6 adds the Yahoo option.
As has been said more specific info from yourself will enable a much more detailed reponse from us.
10:44 pm Wednesday; July 24, 2013
iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.4)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad
"Limit the Logs to the Bits above Binary Images." No, Seriously -
How to send the Mail of shop papers attached to Service / PM order
I would like to send the E-Mail of shop ppers which I am printing from Service order / Plant Maintenance order. How to do it?
Hi Pete,
Thanks for your valuable input. I have read the note, but it gives solution for notification. Is there any other note for orders (Service order or Plant Maintenance Order). .
I would like to send the mail from orders (Service order or Plant Maintenance Order).
Thank you -
How to send the error file as a attachment
Hi All,
Is it possible to send a mail by attaching the error file.
I am writing the code in the events,if import failed then i need to send the mail with import failed error file as an attachment.
Thanks.In your mail code, include something like the following prior to the .Send command. strAttach is the path to the Attachment:
If Not strAttach="" Then' Attach file(s) to message
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(strAttach) Then .AddAttachment strAttach
Set fso = Nothing
End If -
How to send the order number(IW31,IW32,IW33) using SAPOffice in program?
Hi! All.
program send order number, use function "SO_NEW_DOCUMENT_ATT_SEND_API1".
and revicer(SAP logon ID) want use iw32(order change mode)
when double-click attachment order number.
SOURCE CODE **
data: docdata like sodocchgi1,
objpack like sopcklsti1 occurs 10 with header line,
objhead like solisti1 occurs 10 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,
objtyp(10),
objdes(100).
data:
l_object type swotobjid,
l_objheader like soxobj.
For the BOR attachment
constants:
c_object_describe like swotobjid-describe value '<OBJECT>'.
*0.
objtyp = 'BUS2007'.
objdes = '000080001948'.
*1. Document DATA
objtxt = 'Send ORDER'.
append objtxt.
objtxt = 'SAPOffice send mail TEST....'.
append objtxt.
objtxt = 'Have a nice day.'.
append objtxt.
describe table objtxt lines tab_lines.
read table objtxt index tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
docdata-obj_name = 'BOR Object'.
docdata-no_change = ''.
docdata-proc_type = 'R'.
docdata-obj_prio = '2'.
Title mail
concatenate 'Order' objdes
into docdata-obj_descr separated by space.
condense docdata-obj_descr.
*2. Packing List
Main INFO
clear objpack-transf_bin.
objpack-head_start = 0.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
append objpack.
Attachment INFO
clear objpack.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines. "0.
objpack-doc_type = 'OBJ'.
objpack-obj_name = objtyp.
objpack-obj_descr = objdes.
objpack-doc_size = tab_lines * 255.
append objpack.
*3. Object Header
l_object-describe = c_object_describe.
l_object-objtype = objtyp.
l_object-objkey = objdes.
call function 'OWN_LOGICAL_SYSTEM_GET'
importing
own_logical_system = l_object-logsys
exceptions
own_logical_system_not_defined = 1
others = 2.
if sy-subrc <> 0.
message e398(00) with 'No Log Sys Found'.
endif.
move-corresponding l_object to l_objheader.
append l_objheader to objhead.
*4.
reclist-receiver = sy-uname.
reclist-rec_type = 'B'. "B
append reclist.
*5. SAPOffice
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = docdata
put_in_outbox = 'X'
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.
if sy-subrc <> 0.
message id 'SO' type 'S' number '023'
with docdata-obj_name.
endif.please read the documentation. that is part configuration, part basis and very well described at help.sap.com.
-
How to convert the TEXT file into an XML using plsql code
Hi all ,
I need to convert an TEXT file into an XML file how can i do it
Below is my sample TEXT file .
TDETL00000000020000000000000120131021115854ST2225SKU77598059 0023-000000010000
I want the above to be converted into the below format
<?xml version="1.0" encoding="UTF-8"?>
<txt2xml>
<!-- Processor splits text into lines -->
<processor type="RegexDelimited">
<regex>\n</regex>
<!--
This is used to specify that a message should be created per line in
the incoming file;
NOTE: this was designed to work with all the processors, however it
only works correctly with 'RegexDelimited' processors (check the
enclosing top processor type)
-->
<maxIterationsPerMsg>1</maxIterationsPerMsg>
<!-- For lines beginning with FHEAD (File Header) -->
<processor type="RegexMatch">
<element>FHEAD</element>
<regex>^FHEAD(.*)</regex>
<processor type="RegexMatch">
<element>OriginalLine</element>
<regex>(.*)</regex>
<consumeMatchedChars>false</consumeMatchedChars>
</processor>
<processor type="RegexMatch">
<element>LineSeq,Type,Date</element>
<regex>^(\d{10})(\w{4})(\d{14})$</regex>
</processor>
</processor>
<!-- For lines beginning with TDETL (Transaction Details) -->
<processor type="RegexMatch">
<element>TDETL</element>
<regex>^TDETL(.*)</regex>
<processor type="RegexMatch">
<element>OriginalLine</element>
<regex>(.*)</regex>
<consumeMatchedChars>false</consumeMatchedChars>
</processor>
<processor type="RegexMatch">
<element>LineSeq,TransControlNumber,TransDate,LocationType,Location,ItemType,Item,UPCSupplement,InventoryStatus,AdjustReason,AdjustSign,AdjustQty</element>
<regex>^(\d{10})(\d{14})(\d{14})(\w{2})(\d{4})(\w{3})([\w ]{13})([\w ]{5})(\d{2})(\d{2})([+-]{1})(\d{12})$</regex>
</processor>
</processor>
<!-- For lines beginning with FTAIL (File Tail) -->
<processor type="RegexMatch">
<element>FTAIL</element>
<regex>^FTAIL(.*)</regex>
<processor type="RegexMatch">
<element>OriginalLine</element>
<regex>(.*)</regex>
<consumeMatchedChars>false</consumeMatchedChars>
</processor>
<processor type="RegexMatch">
<element>LineSeq,TransCount</element>
<regex>^(\d{10})(\d{6})$</regex>
</processor>
</processor>
</processor>
</txt2xml>
ThanksSorry, that doesn't make much sense.
The XML you gave is a configuration file for txt2xml utility. It doesn't represent the output format.
Are you a user of this utility? -
Sending a text document as pdf by email.
Hi,
I have a plain text document that needs to be send as a pdf document by email. The line type of the text document is PC408-linda, which is 132-character length. I am trying to use the FM SO_NEW_DOCUMENT_ATT_SEND_API1 for sending the document which uses structure SOLISTI1 for sending the document. The line size of SOLISTI1 is 256 characters. I tried to send 132-character length internal table instead of the given structure for the FM, it didnt work. Later, I put the 132-charcter line into the 256-character length line, which works well. But, I have a problem when the outgoing system converts the 256-character length into pdf document. It breaks the line.
Can you please suggest me how can I fit this 132-chracter line in the above FM or Is there any alaternateive FM for sending this 132-character lines, which will fit in the pdf format.
LokmanHi,
Here I am sending the part of the code that is sending the text document by using FM. Internal table $form conatins 132-character length text document. I want to send this document so that converted pdf appears similar to text line.
FORM send_email USING $form TYPE tt_form.
DATA:
$form_wa1 LIKE pc408.
data: paydate(15) type c.
Data date like sy-datum.
*date = sy-datum.
Email Subject.
DATA: s1(30) TYPE c VALUE ' Avis - Bulletin de paie du ',
s3(50) TYPE c .
loop at $form into $form_wa1.
if sy-tabix eq 10.
MOVE $form_wa1-linda+5(10) TO paydate.
endif.
objtxt-line = $form_wa1-linda.
append objtxt.
endloop.
CONCATENATE s1 paydate INTO s3 separated by SPACE.
*Email message body.
DATA: c1(30) TYPE c VALUE 'Vous trouverez ci-joint',
c2(50) type c value ' votre bulletin de paie du ' ,
c type c value '.',
c4(85) TYPE c.
CONCATENATE c1 c2 paydate c INTO c4 separated by SPACE.
data: a1(40) type c value 'À ouvrir avec le programme "Notepad" ',
a2(47) type c value ' ou "Wordpad" pour le visualiser correctement.',
a3(90) type c.
CONCATENATE a1 a2 INTO a3.
data: b1(45) type c value ' Pour imprimer, veuillez vous ',
b2(45) type c value ' assurer que les marges (droite et gauche)',
b3(35) type c value ' sont restreintes au minimum.',
b4(200) type c.
CONCATENATE a3 b1 b2 b3 INTO b4.
Main Text
data wa_form like PC408 .
Email Subject
docdata-obj_name = 'TEST_ALI'.
docdata-obj_descr = s3.
Email Message
objtxt = 'Bonjour,'.
append objtxt.
objtxt = ' '.
append objtxt.
objtxt = c4.
append objtxt.
objtxt = ' '.
append objtxt.
objtxt = b4.
append objtxt.
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 = 'RAW'.
append objpack.
Create Message Attachment
Write Packing List (Attachment)
loop at $form into $form_wa1.
*if sy-tabix eq 10.
*MOVE $form_wa1-linda+5(10) TO paydate.
endif.
objtxt-line = $form_wa1-linda.
append objtxt.
endloop.
att_type = 'RAW '.
describe table objtxt lines tab_lines.
read table objtxt index tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
clear objpack-transf_bin.
objpack-head_start = 6.
objpack-head_num = 0.
objpack-body_start = 6.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = 'Attached Document'.
append objpack.
Create receiver list
reclist-receiver = wa_pa0105-usrid. "<-- change address
*reclist-receiver = '[email protected]'. "<-- change address
reclist-rec_type = 'U'.
append reclist.
*reclist-receiver = sy-uname. "<-- change internal user
*reclist-rec_type = 'B'.
*append reclist.
Send Message
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
PUT_IN_OUTBOX = 'X'
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
tables
packing_list = objpack
OBJECT_HEADER = objhead
*CONTENTS_BIN = objbin
CONTENTS_TXT = objtxt
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
refresh: objtxt,
objpack,
objhead,
reclist.
IF sy-subrc <> 0.
message ID 'SO' TYPE 'S' NUMBER '023'
with docdata-obj_name.
ENDIF.
*write: / 'End of Program'.
ENDFORM. " send_email -
Problen when Sending the text file as attachment to the external mail
HI,
I am sending the text file as an attachment to a aexternal mai. mailing is going with text file attachment, but text file is empty. No information in the file is going, only empty text file is going. I am sending the code iam using. Please suggest, if I need to change any passing parameters orany other other solution.
tables: knb1,kna1,adr6,ITEMSET,bsid,TSP01.
INTERNAL TABLES
DATA: BEGIN OF it_kna1 occurs 0,
KUNNR LIKE KNA1-KUNNR,
ADRNR LIKE KNA1-ADRNR,
END OF it_kna1.
DATA: BEGIN OF it_email occurs 0,
ADDRNUMBER LIKE ADR6-ADDRNUMBER,
SMTP_ADDR LIKE ADR6-SMTP_ADDR,
END OF it_email.
DATA: BEGIN OF it_bsid occurs 0,
KUNNR LIKE BSID-KUNNR,
BUKRS LIKE BSID-BUKRS,
END OF it_bsid.
DATA: BEGIN OF it_final occurs 0,
KUNNR LIKE KNA1-KUNNR,
ADRNR LIKE ADR6-ADDRNUMBER,
EMAIL LIKE ADR6-SMTP_ADDR,
END OF it_final.
DATA: BEGIN OF BUFFER OCCURS 10000,
TEXT(255) TYPE C,
END OF BUFFER.
data:xtext type solix_tab." occurs 0 with header line."line.
data:xi_pdf type soli_tab.
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE,
OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE,
OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE,
RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE,
DOC_CHNG LIKE SODOCCHGI1,
PARAMS LIKE PRI_PARAMS,
ARPARAMS LIKE ARC_PARAMS,
DAYS(1) TYPE N VALUE 8,
COUNT(3) TYPE N VALUE 1,
VALID TYPE C,
RECEIVER(30),
STR(256).
data: spoolid type tsp01-rqident,
pdf_table like tline occurs 0 with header line,
v_bytecount type i,
itab_pdf like tline occurs 10 with header line,
xi_pdf like tline occurs 0 with header line,
xi_pdf like buffer occurs 0 with header line,
xi_pdf_1 like xi_pdf,
v_length(2) type p,
html like solisti1 occurs 0 with header line,
xi_temp like bapiqcmime occurs 0 with header line,
xi_mime(255) type c occurs 0 with header line.
VARIABLES
data: g_email type adr6-smtp_addr,
TAB_LINES LIKE SY-TABIX,
G_FLAG(1) TYPE C.
g_norm(1) TYPE C,
g_shbv(1) TYPE C,
g_merk(1) TYPE C,
g_park(1) TYPE C,
g_apar(1) TYPE C.
data: l_lines type i,
line1 type i,
l_temp(500) type c,
l_offset type p,
l_lineslen(2) type p,
l_mimelen(2) type p,
v_spono like tsp01-rqident,
l_tabix like sy-tabix.
*****VIA SELECTION-SCREEN
ENDFORM. " SEND_TO_SPOOL
*& Form GET_SPOOL_ID
*& Form CONVERT_SPOOL_TO_PDF
*& Form SEND_MAIL
FORM SEND_MAIL .
data:l_lin like sy-tabix,
l_lint like sy-tabix,
it_list like abaplist occurs 0,
l_newline(2) type x value '0D0A'.
*--Data for the status output after sending
data: user_address like sousradri1 occurs 1 with header line,
sent_to_all like sonv-flag.
clear: reclist, reclist[],
objtxt , objtxt[],
objpack, objpack[],
objbin , objbin[],
doc_chng.
*--move list to office table objbin
*--Start of Changes to support PDF attachments - UB20030116
loop at html.
objbin-line = html-line.
append objbin.
clear objbin.
endloop.
loop at xi_pdf.
objbin-line = xi_pdf-text.
append objbin.
clear objbin.
endloop.
*--We may write additional text to the main document
*--For faxing this will be the cover page. Like sending from SAPoffice
*--the layout set Office-Telefax will be used.
objtxt-line = 'NOTE : Please Consider the below Headers'.
append objtxt.
clear objtxt.
objtxt-line = 'Assignment --> Purchase order number '.
append objtxt.
clear objtxt.
objtxt-line = 'Document --> Invoice No '.
append objtxt.
clear objtxt.
objtxt-line = 'Amount In DC --> Amount Due '.
append objtxt.
clear objtxt.
objtxt-line = ' '.
append objtxt.
clear objtxt.
objtxt-line = ' '.
append objtxt.
clear objtxt.
objtxt-line = 'Please find attached statement for this week'.
append objtxt.
clear objtxt.
objtxt-line = ' '.
append objtxt.
clear objtxt.
objtxt-line = 'This is an AUTO GENERATED MAIL'.
concatenate objtxt-line 'Please Do not reply to this mail' into
objtxt-line separated by ' '.
append objtxt.
clear objtxt.
describe table objtxt lines tab_lines.
read table objtxt index tab_lines.
*--Create the document which is to be sent
doc_chng-obj_name = 'List'.
doc_chng-obj_name = 'SAPRPT'.
doc_chng-obj_descr = 'Customer statement for the week'.
concatenate 'Customer statement for '
sy-datum into
doc_chng-obj_descr
separated by ' '.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
*--Fill the fields of the packing_list for the main document:
*--It is a text document
clear objpack-transf_bin.
*--The document needs no header (head_num = 0)
objpack-head_start = 1.
objpack-head_num = 0.
*--but it has a body
objpack-body_start = 1.
objpack-body_num = tab_lines.
*--of type RAW
objpack-doc_type = 'RAW'.
append objpack.
*--Create the attachment (the list itself)
describe table objbin lines tab_lines.
*--Fill the fields of the packing_list for the attachment:
*--It is binary document
objpack-transf_bin = 'X'.
*--we need no header
objpack-head_start = 1.
objpack-head_num = 0.
*--but a body
objpack-body_start = 1.
objpack-body_num = tab_lines.
*--of type G_DOC_TYPE
objpack-doc_type = 'PDF'. "commented on 12/13/2007
objpack-doc_type = 'TXT'. "commented on 12/13/2007
objpack-obj_name = 'Attachment'.
objpack-obj_descr = 'Customer Statement'.
concatenate 'Customer Statement' sy-datum into objpack-obj_descr.
objpack-doc_size = tab_lines * 255.
append objpack.
reclist-receiver = g_email.
reclist-rec_type = 'U'.
reclist-com_type = 'FAX'.
append reclist.
data:xi type soli.
xi-line = 'haisdgsfsdf'.
append xi to xi_pdf.
xi-line = 'haisdfdsfd'.
append xi to xi_pdf.
xi-line = 'haisfgsdfsd'.
append xi to xi_pdf.
xi-line = 'haisdfsgfsdgg'.
append xi to xi_pdf.
*xi_pdf-text = 'hai'.
*append xi_pdf.
*xi_pdf-text = 'hai'.
*append xi_pdf.
*xi_pdf-text = 'hai'.
*append xi_pdf.
*xi_pdf-text = 'hai'.
*append xi_pdf.
CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'
EXPORTING
ip_solitab = xi_pdf[]
IMPORTING
EP_SOLIXTAB = xtext[].
**--Send the document by calling the SAPoffice API1 module for sending
**--documents with attachments
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
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
contents_hex = xtext
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
others = 99.HI,
There are lots of bugs.
Please refer this sample program to fix it.
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
Best regards,
Prashant -
How to print the texts retrived by using READ_TEXT fun module in Smartform
Please tell me how to print the text which is rertrived by using the READ_TEXT function module in smartform.
I have coded all things in the program lines and in that i am retriveing the long texts.
I am getting the text lines in my internal table clearly, the thing is that I am not able to pass these lines to the text.
I have to print the trouble ticket. in that the notes log I have to pass.
its urgent. Points will be rewarded for any type of clue. whether it will work or not.There are a few ways to do it. If you need to take all of the text in the text type, in your SF text element choose "Include Text".
Populate the fields with the data that corresponds to the text type. It is similar to the interface to the FM "Read_Text.
Text Name
Text Obje
Text ID
Language
Encase any variables with the "&" symbol.
If you have already coded the call to the FM "READ_TEXT" and loaded the text into an internal table, create a loop and loop through the itab. Inside of the loop create a text element and add a variable in the text element for the field you are looking to output. -
How to send a text message to a group of people and save the list for next time?
how to send a text message to a group of people and save the list for next time from an iphone 4s?
Hey there ipremacha,
It sounds like you need to enable Text Message Forwarding on your iPhone for your iPad to send MMS/SMS messages through your phone.
Connect your iPhone, iPad, iPod touch, and Mac using Continuity
Go to Messages > Text Message Forwarding, and enable the device(s) you would like to forward messages to.
Your Mac, iPad, or iPod touch will display a code. Enter this code on your iPhone to verify the SMS feature.
Thank you for using Apple Support Communities.
Regards,
Sterling -
How to sending simple text in the mail body
Hi friends,
How to send simple text in the mail body through ABAP code
plz send me the related code and setting for that mail.
Thanks&Regards,
Srinivastry this...
FORM send_file_as_email_attachment .
DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA : i_body TYPE soli_tab WITH HEADER LINE.
DATA: it_attach LIKE it_display1 OCCURS 0 WITH HEADER LINE.
DATA: doc_chng LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix.
DATA: att_lines TYPE i.
DATA: lv_lines TYPE i.
DATA: file TYPE string.
data: g_datum like sy-datum.
data: g_datum1(10) type c.
DATA: len TYPE n.
LOOP AT it_email.
CLEAR : objpack,
objhead,
objbin,
objtxt,
reclist.
REFRESH: objpack,
objhead,
objbin,
objtxt,
reclist.
g_datum = sy-datum - 1.
concatenate g_datum6(2) '.' g_datum4(2) '.' g_datum+0(4) into
g_datum1.
doc_chng-obj_descr = 'Aged Stock more than 45 Days'.
CONCATENATE 'Aged Stock more than 45 Days' '-' it_email-vkbur INTO
doc_chng-obj_descr.
CONCATENATE 'Please find enclosed Aged Stock Details ( >45days ) report as on'
g_datum1
INTO objtxt-line SEPARATED BY space.
APPEND objtxt.
objtxt-line = ' '.
APPEND objtxt.
objtxt-line = 'Regards'.
APPEND objtxt.
objtxt-line = 'LIS SAP Projects'.
APPEND objtxt.
objtxt-line =
'PS: Pls send feedback for futher improvements to SAP office.'.
APPEND objtxt.
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
objpack-obj_name = 'Run_prog'.
objpack-obj_descr = 'Agestock.txt'.
lv_lines = tab_lines.
APPEND objpack.
*CONCATENATE 'Plant' 'Material Number' 'Qty(More than 45days)'
*'Amount' INTO
it_display SEPARATED BY space.
append objbin.
clear: objbin.
CLEAR:it_display2.
REFRESH it_display2.
it_display2-werks = 'Plant|'.
it_display2-matnr = 'Material Number'.
it_display2-qty = '|Qty > 45 days'.
it_display2-amount = ' |Amount'.
APPEND it_display2.
it_display2-werks = ''.
it_display2-matnr = ''.
it_display2-qty = ''.
it_display2-amount = ''.
APPEND it_display2.
CLEAR : it_display2.
sort it_display1 by amount descending.
LOOP AT it_display1 WHERE werks = it_email-vkbur.
AT FIRST.
*CONCATENATE 'Plant ' 'Material Number' 'Qty(More than 45days)'
*'Amount' INTO
objbin-line SEPARATED BY space.
append objbin.
clear: objbin.
ENDAT.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = it_display1-matnr
IMPORTING
output = it_display1-matnr.
it_display1-qty = TRUNC( it_display1-qty ).
MOVE-CORRESPONDING it_display1 TO it_display2.
APPEND it_display2.
CLEAR:it_display1,it_display2,objbin.
CLEAR:it_display1.
ENDLOOP.
objbin[] = it_display2[].
DESCRIBE TABLE objbin LINES tab_lines.
objhead = 'Suug'.
APPEND objhead.
objpack-transf_bin = 'X'.
objpack-head_start = 3.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
objpack-obj_name = 'Run_prog'.
objpack-obj_descr = 'Agestock.txt'.
APPEND objpack.
reclist-receiver = '[email protected]'.
reclist-rec_type = 'U'.
APPEND reclist.
=====================================================================
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = doc_chng
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
operation_no_authorization = 4
OTHERS = 99.
CLEAR : it_email.
ENDLOOP.
ENDFORM. "send_mail
Message was edited by:
Sugumar Ganesan -
How to send the email to different email addresses from Workflow
Hello,
i an not getting that how to send the email from Workflow in SAP.
plz give the steps to do that.
i have done lots of time but system is not sending the email to different email address.Hi,
lot of configuration is invloved in sending
mail to external email id. check BASIS to
configure for external mails ans also check
debug FM and see which conditions exceptions
(Document not sendis raised)
also check below code
CLEAR: DOC_CHNG, OBJTXT, OBJBIN, OBJPACK, OBJHEAD, RECLIST,
RECIPIENT_INT, DOC_SIZE,TAB_LINES.
REFRESH: OBJTXT, OBJBIN, OBJPACK, OBJHEAD, RECLIST.
OBJBIN[] = CONTENT_OUT[].
Populate e-mail title
DOC_CHNG-OBJ_NAME = 'MAIL'.
CONCATENATE 'EETS for Contract #'(245)
OIA01_TAB-EXGNUM
INTO DOC_CHNG-OBJ_DESCR SEPARATED BY SPACE.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
It is a text document
CLEAR OBJPACK-TRANSF_BIN.
The document needs no header (head_num = 0)
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
but it has a body
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
of type RAW
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
Create the attachment (the list itself)
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
It is binary document
OBJPACK-TRANSF_BIN = 'X'.
we need no header
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
but a body
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
of type PDF
OBJPACK-DOC_TYPE = 'PDF'.
OBJPACK-OBJ_NAME = 'Attachment'(239).
CONCATENATE 'EETS_' OIA01_TAB-EXGNUM '_'
IT_ZMMTACCUID-ACCTUSRID
'_' SY-DATUM '_' SY-UZEIT '.PDF'
INTO OBJPACK-OBJ_DESCR.
READ TABLE OBJBIN INDEX TAB_LINES.
DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJBIN ).
OBJPACK-DOC_SIZE = DOC_SIZE.
APPEND OBJPACK.
Get e-mail address
CLEAR IT_ADDRESS.
READ TABLE IT_ADDRESS WITH KEY ACCTID = IT_ZMMTACCUID-ACCTUSRID
BINARY SEARCH.
IF SY-SUBRC = 0.
RECIPIENT_INT-ADDRESS = IT_ADDRESS-SMTP_ADR.
ENDIF.
*Send email to external mail address
RECLIST-RECEIVER = RECIPIENT_INT.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
CLEAR RECLIST.
*Send email to SAP Office mail address
RECLIST-RECEIVER = IT_ZMMTACCUID-ACCTUSRID.
RECLIST-REC_TYPE = 'B'.
APPEND RECLIST.
CLEAR RECLIST.
SEND THE DOCUMENT BY CALLING THE SAPOFFICE API1 MODULE
FOR SENDING DOCUMENTS WITH ATTACHMENTS
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = doc_chng
put_in_outbox = 'X'
importing
sent_to_all = sent_to_all
tables
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
receivers = reclist
exceptions
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
others = 99.
also check
https:/Re: mail sending problem
Regards
amole -
How to color the text elements in script?
how to color the text elements in script?
byeeeee
plz send the answersHi,
Please go through my blog to know how to do color printing in SAP scripts.
White Paper on 'Color Printing in SAP Scripts'
Regards,
Sireesha Ch
Maybe you are looking for
-
Multiple Kernel Panics after Mavericks Upgrade
I've been getting kernel panics (shut downs and restarts suddenly) weekly (haven't resolved this yet). I upgraded my Macbook Pro mid 2010 15inch Snow leopard to OS X Mavericks Ever since I upgraded to Mavericks OS X, I've been getting kernel panics e
-
Is it possible to call VBScript function through CFM pages ? ThePolarExpress
-
Why can't I see 3D views on Google Earth on my mbp?
Using Google Earth 7.1.1 on my early 2011 MBP w/ Safari 7.0, I am unable to see street views. When I drag the orange guy to the street all I see is a flat smear. Help!
-
This is getting tiring....
Wow ive been at this for 8 hours now...i got my new ipod with video playback this morning and since then ive been trying to get itunes to work. at first i downloaded QT PRO then i thought you had to to something to get my music for windows media and
-
Configuring Mackie MCU and Audition CS6
Hello all, I've just bought a MCU Pro to use with audition to mix down 8 channel sound for some musical theatre filming( piano, base, stereo pair on strings, 4 mics on actors stage). I'm having some basic set up problems and cant seem to get started.