Marketing Documents distribution via e-mail or fax add-on
We are looking for an add-on which can e-mail customer automatically that their order has been processed for shipment as soon as the order are added in SAP B1. Also the capability that the Invoice are automatically e-mailed or faxed based on customer preference.
Any sujestion?
Mike
Mike,
You may want to check out Crystal Wave as it has that ability and much more http://www.twbs.com/newsite/solutions-crystal-wave.htm
Hope this helps,
Karl
Similar Messages
-
Sending Payment Advices Via E-mail or Fax
SAP Gururs,
We recently implemented ACH payment method, we are sending ACH payment advices via e-mail or fax. However the need to maintain various e-mails or a combination of e-mail and fax is necessary.
Example #1
I have 2 e-mail address one for our purchase department and the other for the vendor I only want the vendor to receive payment advices, the other e-mail is use to send other information to vendor. How do I control this type of scenario.
Example #2,
I have a fax number and E-mail, but vendor wants payment advice to be send via fax and not e-mail. I did this testing by selecting the "Do Use Communication for e-mail" but I still got an e-mail and not a fax.
Example # 3,
I have various fax numbers 1 use for payment advices, the other to send other information to other users to the vendor such as matrixes, price disputes etc. how can I control this.
Does any one has any additional information on these topics I will truly appreciate.Hello,
Go to transaction code FIBF
Settings ==> Process Modules ==> ... of an SAP Application
Process: 00002040
Ctr: Blank
Appl.: FI-FI
Function Module: SAMPLE_PROCESS_00002040
You can copy the function module to "Z" function module and modify it accordingly. Then you can use your customized FM here.
This triggers an email of payment advice, provided if you have maintained Email Address in the Vendor Master "Address" Tab and the Standard Communication Method is "INT - Email"
You can see the email that is being triggered / delivered in transaction code SOST.
To deliver the emails settings in SCOT are being completed by Basis consultants and the gateways must have been opened. Except production environment, normally the gateways are closed in development or QA environment in order to avoid sending wrong payment advices outside.
Thanks,
Ravi -
Document Distribution for External Mails ids
Dear Expert Consultants,
I would like to know how to send Docuemnts as link from Document Distribution to external Mails. Also i want to know Mass printing functionality in DMS Documents.
Regards,
Deviprasad.PHi,
In the standard case you need to folow below procedure
1. Use TC SOCP to create external recipients. you may need BASIS help in this.
2. Create recipient list using TC CVI1.
2. Assign the documents to be distributed to this list. Document should be created before this step.
3. Assign External recipients to this list.
4. Distribute the document using CVI8.
5. TC CVI9 will help you to know the status of distribution.
Most important factor is that your SAP standard workflow which drives the distribution to external mail ids should be working. Please contact BASIS team if it has any problem. Without this distribution is not possible.
Hope it will help you.
Regards,
Atul -
Send Marketing Documents Via E-mail
Hello all,
I need to send via e-mail or fax Order information from a webservice call
In the SBO client, having the Order form opened, you can send it via email or fax using the "Send message" button on the tool bar. It creates a message with your order attached, with the same appearance as if you printed it.
Is it possible to do so using the DI API?
Thank you in advance,
Antonia.Dear Antonia,
The following sample describes how to add a new attachment to a message.
However, you need to prepare the attachment before to use it.
Private Sub cmdTest_Click()
Dim msg As SAPbobsCOM.Messages
Set msg = vCompany.GetBusinessObject(oMessages)
msg.MessageText = "This is the content of message"
msg.Subject = "Hello manager"
'there are two recipients in this message
Call msg.Recipients.Add
'set values for the first recipients
Call msg.Recipients.SetCurentLine(0)
msg.Recipients.UserCode = "manager"
msg.Recipients.NameTo = "manager"
msg.Recipients.SendEmail = tYES
msg.Recipients.EmailAddress = "email1"
'set values for the second recipient
Call msg.Recipients.SetCurentLine(1)
msg.Recipients.UserCode = "Werner"
msg.Recipients.NameTo = "Werner"
msg.Recipients.SendEmail = tYES
msg.Recipients.EmailAddress = "email2"
'set referenced doc
Call msg.AddDataColumn("Please review", "This is an invoice, pls review it, thx.", oInvoices, "1")
'add attachment
Call msg.Attachments.Add
msg.Attachments.Item(0).FileName = "C:\temp\Object.xml"
'send it out
Call msg.Add
End Sub
Best Regards
Jane Jing
SAP Business One Forums team -
Email document distribution PDF attachment conversion error
I have configured document distribution via emai with an attachment. My DMS documents have a single PDF original attachment.
The email transmits fine through SAPConnect, however when I open the attachment Adobe tells me the file cannot be opened, and is corrupt.
The issue seems to be in SAPConnect conversion, converting BIN to PDF. Any suggestions on the conversion function module or sample code for a fm to do the conversion are appreciated.Hi,
regarding the information with the BIN extension I would kindly ask you
to implement the SAP note 873597.
Further please check the following settings which helped to solve
such issue in the past successfully:
1. Go to transaction : FILE
2. Select DOCUMENT_DISTRIBUTION
3. Double click on "Syntax group definition"
4. You will find the file length defined for "WINDOWS NT
5. Change the length value to 70.
6. Also for As/400 change the length to 40.
Best regards,
Christoph -
Document Distribution DMS, problem with standard workflow WS20000104
Hi,
In our document distribution process we stacked with the problem, when we run the document distribution (via tcode CVI8) we got the error of workflow WS20000104. After some search at SCN we found that there is the similar issue, described in the thread: Document distribution workflow in error. Solution which was offered and marked as worked is to enable/activate Result Parameter check box, but in our case this check box is disabled and when we try to edit the BOR in order to activate Result Parameter check box the system asked to input Access Code.
Is there any way (note) to enable this check box without access code?
Thanks.Hi, Deepak Kori
In transaction SWU3 there is the following situation:
Maintain Runtime Environment is completely green, including sub-categories;
Maintain Definition Environment is red because of Check Entries from HR Control Tables;
Maintain Additional Settings and Services is red because of Maintain Web Server;
Classify Tasks as General is completely green, including sub-categories;
Guided Procedures is red because of Maintain Guided Procedures Gateway.
Could you, please, explain what do you mean under «workflow settings are activated», how parameters described above are related to workflow and may be related to our problem?
If described situation can be assumed as activated, what should we do now? Otherwise, how to make these settings to be activated?
Thanks. -
When I share a pages document as a PDF (via e-mail) all the pictures change from the original document, most are missing with just a few of them repeated in the spots where others had been. How do I do this without the document changing?
I need to be able to send it to a PC in order to print it.Hard to say what is happening without examining the file.
If you like click on my blue name and email me both the .pages file and the the .pdf you have made from it.
Peter
ps It would help to say what version of Pages you are using and on what you are running it. iOS or Mac and what version. -
Trouble opening pdf's - I have received several pdf's from a friend via e-mail (Thunderbird). Some of them open just fine but others give me the message: "There was an error opening this document. The file is damaged and could not be repaired." My friend made sure that the files in question opened without issue on his computer (a PC). Further, I was able to open one of these "damaged" files on my Android phone, but I cannot open them on the Macbook Air. Any help would be greatly appreciated.
Back up all data.
Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
/Library/Internet Plug-ins
In the Finder, select
Go ▹ Go to Folder
from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
If you still have the issue, repeat with this line:
~/Library/Internet Plug-ins
If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again. -
How to trigger xml publisher API (ex:Delivering Documents via e-Mail)?
Dear All:
How to use xml publisher API ?
In user's guide always talk API's code.(ex:Delivering Documents via e-Mail
// create delivery manager instance
DeliveryManager dm = new DeliveryManager();
// create a delivery request
DeliveryRequest req =
dm.createRequest(DeliveryManager.TYPE_SMTP_EMAIL);
// set email subject
req.addProperty(DeliveryPropertyDefinitions.SMTP_SUBJECT, "Invoice");
// set SMTP server host
req.addProperty(
DeliveryPropertyDefinitions.SMTP_HOST, "mysmtphost");
// set the sender email address
req.addProperty(DeliveryPropertyDefinitions.SMTP_FROM,
"[email protected]");
// set the destination email address
req.addProperty(
DeliveryPropertyDefinitions.SMTP_TO_RECIPIENTS,
"[email protected], [email protected]" );
// set the content type of the email body
req.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_TYPE,
"text/html");
// set the document file name appeared in the email
req.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_FILENAME,
"body.html");
// set the document to deliver
req.setDocument("/document/invoice.html");
// submit the request
req.submit();
// close the request
req.close(); )
Not say how to use this code to account effect !!
Having anybody to use API before?
Please tell me how to use that,thanks!!
BY Emily_yeHi Emily
I had the same question. After much research and a lot of deduction I produced the following:
import oracle.apps.fnd.cp.request.*;
import java.io.*;
import java.sql.*;
import java.util.Vector;
import oracle.apps.fnd.util.*;
import oracle.apps.xdo.XDOException;
import oracle.apps.xdo.common.pdf.util.PDFDocMerger;
import oracle.apps.xdo.delivery.DeliveryException;
import oracle.apps.xdo.delivery.DeliveryManager;
import oracle.apps.xdo.delivery.DeliveryPropertyDefinitions;
import oracle.apps.xdo.delivery.DeliveryRequest;
import oracle.jdbc.driver.OracleCallableStatement;
public class RunTravProgram implements JavaConcurrentProgram {
CpContext mCtx; // global reference to concurrent program context
LogFile logFile; // global reference to context logfile
OutFile outFile; // global reference to context outfile
Connection mConn = null;
ReqCompletion lRC;
//File Separator
private String mFileSeparator;
// globals for template
String XDOAppShortName = "";
String XDOtemplateCode = "";
// hard-wired constants for template addition
final String XDOLanguage = "en";
final String XDOTerritory = "US";
final String XDOFinal_format = "PDF";
final String XDOtemplateType = "TEMPLATE_SOURCE";
String PDFFile = "";
String outFilePath = "";
String progShortName = "";
String progDesc = "";
Integer iRequestID = 0;
String sWatermark = ""; // watermark text
String emailAddress = ""; // Not Implemented
String emailServer = "";
public static final String M_SUCCESS = "SUCCESS";
public static final String M_ERROR = "ERROR";
public static final String M_WARNING = "WARNING";
* Create a Java FND ConcurrentRequest objec to call fnd_request.submit_request
* The first three parameters are:
* Application Short Name -- Application Short name (ie. WAHC)
* Current Program Short Name -- Concurrent Program being called
* Current Program Description -- description for above
* These should be the first three parameters passed by the concurrent
* program in this order. The next two are constants set to null
* These are followed by the parameters passed by the first concurrent
* program that are being passed to the next concurrent program.
* I am limiting the parameter list to ten for now.
// Dynamic PLSQL statement used to get a concurrent request completion status
// This is necessary because the java class does not provide this method :-(
String mGetCompleteStatus =
"DECLARE R_VAL BOOLEAN; " + "b_phase VARCHAR2 (80) := NULL; " +
"b_status VARCHAR2 (80) := NULL; " +
"b_dev_phase VARCHAR2 (80) := NULL; " +
"b_dev_status VARCHAR2 (80) := NULL; " +
"b_message VARCHAR2 (240) := NULL; " + "BEGIN " +
"r_val := fnd_concurrent.wait_for_request (:1,5,1000," +
"b_phase,b_status,b_dev_phase,b_dev_status,b_message); " +
":2 := b_phase; " + ":3 := b_status; " + ":4 := b_message; " + "end;";
public RunTravProgram() {
// no constructor necessary for now
* Concurrent Processing provides an interface 'JavaConcurrentProgram' with abstract method
* runProgram() which passes the concurrent processing context 'CpContext'. The concurrent
* program developer will implement all of their business logic for a concurrent program in
* runProgram(). The main() method, implemented by AOL, will call runProgram() after
* performing all of the required initialization for the concurrent program, including
* establishing a database connection, initializing the required contexts, and setting up
* the log and output files. CpContext will have the request specific log and output
* file input methods
public void runProgram(CpContext pCpContext) {
mCtx = pCpContext;
OracleCallableStatement lStmt = null;
boolean bCompletion = true;
String sPhase = "";
String sStatus = "";
String sMessage = "";
//get handle on request completion object for reporting status
lRC = pCpContext.getReqCompletion();
// assign logfile
logFile = pCpContext.getLogFile();
// assign outfile
outFile = pCpContext.getOutFile();
// assign fileseparator
mFileSeparator = getFileSeparator();
// get the JDBC connection object
mConn = pCpContext.getJDBCConnection();
outFilePath =
((new File(outFile.getFileName())).getParent() == null ? "" :
(new File(outFile.getFileName())).getParent() +
mFileSeparator);
logFile.writeln("OutFile File Path: -> " + outFilePath, 0);
// get parameter list object from CpContext
// these come from the concurrent program
ParameterList lPara = pCpContext.getParameterList();
// create a temporary array and retrieve the parameters created by
// the program. Currently limiting the number of parameters to 10 for now
String pvals[] = new String[10];
int pcount = 0;
while (lPara.hasMoreElements()) {
NameValueType aNVT = lPara.nextParameter();
pvals[pcount] = aNVT.getValue();
pcount++;
if (pcount > 9)
break;
// send parameter values to the log file
logFile.writeln("Arg 1: APPL_SHORT_NAME -> " + pvals[0], 0);
logFile.writeln("Arg 2: CURR_PROG_SHORT_NAME -> " + pvals[1], 0);
logFile.writeln("Arg 3: CURR_PROG_DESCRIPTION -> " + pvals[2], 0);
logFile.writeln("Arg 4: TEMPLATE_CODE -> " + pvals[3], 0);
logFile.writeln("Arg 5: P_PLANT_CODE -> " + pvals[4], 0);
logFile.writeln("Arg 6: P_BATCH_NO -> " + pvals[5], 0);
logFile.writeln("Arg 7: P_SHOW_PROMISE -> " + pvals[6], 0);
logFile.writeln("Arg 8: P_WATERMARK -> " + pvals[7], 0);
XDOtemplateCode = pvals[3]; // store the template name globally
progShortName = pvals[1]; // store the program short name globally
XDOAppShortName = pvals[0]; // store the application short name
sWatermark = pvals[7]; // store the watermark globally
progDesc = pvals[2];
try {
// create a concurrent request object
ConcurrentRequest cr = new ConcurrentRequest(mConn);
// use the parameters to call fnd_request.submit_request
cr.addLayout(XDOAppShortName, XDOtemplateCode, XDOLanguage,
XDOTerritory, XDOFinal_format);
Vector param = new Vector();
param.add(pvals[4]); // plant code
param.add(pvals[5]); // batch ID
param.add(pvals[6]); // Show SO info flag
iRequestID =
cr.submitRequest(XDOAppShortName, progShortName, progDesc,
null, false, param);
mConn.commit();
// send the request ID to the log file
logFile.writeln("-- Request ID: ->" + Integer.toString(iRequestID),
0);
// call fnd_concurrent.wait_for_request to wait until the request
// has ended - use this to check the request status before proceeding
lStmt =
(OracleCallableStatement)mConn.prepareCall(mGetCompleteStatus);
lStmt.setInt(1, iRequestID);
lStmt.registerOutParameter(2, java.sql.Types.VARCHAR, 0, 255);
lStmt.registerOutParameter(3, java.sql.Types.VARCHAR, 0, 255);
lStmt.registerOutParameter(4, java.sql.Types.VARCHAR, 0, 255);
lStmt.execute();
// get the results of the completion
sPhase = lStmt.getString(2);
sStatus = lStmt.getString(3);
sMessage = lStmt.getString(4);
lStmt.close();
// send the results of the request processing to the log file
logFile.writeln("-- Phase: -> " + sPhase, 0);
logFile.writeln("-- Status: -> " + sStatus, 0);
logFile.writeln("-- Message: -> " + sMessage, 0);
// test here to make sure it completed correctly
if (sPhase.equals("Completed") && sStatus.equals("Normal")) {
// construct the PDF file name generated by the called request
PDFFile = progShortName + "_" + iRequestID + "_1.pdf";
// add a watermark to the generated PDF
// create an output stream for the existing PDF
// and set ouput to append
OutputStream pdfout =
new FileOutputStream(outFilePath + PDFFile, true);
// create an inputstream array (required by calling method)
InputStream pdfin[] = new InputStream[1];
pdfin[0] = new FileInputStream(outFilePath + PDFFile);
// add the watermark passed as a parameter
bCompletion = addWatermark(pdfin, pdfout);
// assign the modified file to the context out
// this will print using this request
if (bCompletion)
outFile.setOutFile(outFilePath + PDFFile);
// release the connection object
// and set the completion status for the request
if (bCompletion) {
pCpContext.getReqCompletion().setCompletion(ReqCompletion.NORMAL,
} else {
lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
pCpContext.releaseJDBCConnection();
} catch (SQLException s) {
logFile.writeln("SQL Error: Exception thrown w/ error message: " +
s.getMessage(), 0);
lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
pCpContext.releaseJDBCConnection();
} catch (IOException ioe) {
logFile.writeln("IO Error: Exception thrown w/ error message: " +
ioe.getMessage(), 0);
lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
pCpContext.releaseJDBCConnection();
} catch (Exception e) {
logFile.writeln("General Exception: " + e.getMessage(), 0);
lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
pCpContext.releaseJDBCConnection();
} finally {
try {
if (lStmt != null)
lStmt.close();
pCpContext.releaseJDBCConnection();
} catch (SQLException e) {
logFile.writeln(e.getMessage(), 0);
lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
* addWatermark()
* @param pdfin
* @param pdfout
* @return boolean
* This method will work for an existing document or a newly generated
* one. Set the outputstream append flag to false for a new document
* and true for an existing one.
* NOTE: PDFDocMerger requires an inputstream array even if it only
* contains one document.
private boolean addWatermark(InputStream[] pdfin, OutputStream pdfout) {
if (!sWatermark.equals("")) {
try {
PDFDocMerger docMerger = new PDFDocMerger(pdfin, pdfout);
//docMerger.setTextDefaultWatermark(sWatermark);
docMerger.setTextWatermark(sWatermark, 80f, 50f);
docMerger.setTextWatermarkAngle(25);
docMerger.setTextWatermarkColor(1.0f, .50f, .50f);
docMerger.setTextWatermarkFont("Garamond", 100);
docMerger.process();
docMerger = null;
return true;
} catch (XDOException e) {
logFile.writeln("Watermark process Failed: " + e.getMessage(),
0);
return false;
return true;
* Returns the file separator
private String getFileSeparator() {
return (System.getProperty("file.separator"));
* EBSEmailDelivery
* @return
* Just for testing right now.
private boolean EBSEmailDelivery() {
if (!emailAddress.equals("")) {
try {
// create delivery manager instance
DeliveryManager delMgr = new DeliveryManager();
// create a delivery request
DeliveryRequest delReq =
delMgr.createRequest(DeliveryManager.TYPE_SMTP_EMAIL);
// set email subject
delReq.addProperty(DeliveryPropertyDefinitions.SMTP_SUBJECT,
"EBS Report:" + progDesc +
" for request: " + iRequestID);
// set SMTP server host
delReq.addProperty(DeliveryPropertyDefinitions.SMTP_HOST,
emailServer); // need to supply the email smtp server
// set the sender email address
delReq.addProperty(DeliveryPropertyDefinitions.SMTP_FROM,
emailAddress);
// set the destination email address
delReq.addProperty(DeliveryPropertyDefinitions.SMTP_TO_RECIPIENTS,
emailAddress);
// set the content type of the email body
delReq.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_TYPE,
"application/pdf");
// set the document file name appeared in the email
delReq.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_FILENAME,
PDFFile);
// set the document to deliver
delReq.setDocument(outFilePath + PDFFile);
// submit the request
delReq.submit();
// close the request
delReq.close();
return true;
} catch (DeliveryException de) {
logFile.writeln("email process Failed: " + de.getMessage(), 0);
return false;
return true;
This is the class for a JCP I created to perform the following:
1) Launch an existing Concurrent Program that produces PDF output
2) Grab the PDF and apply a watermark based on user input or conditions
3) associate the modified PDF to CP output for PASTA printing
It isn't elegant but it is fairly simple. I added the email capability and tested it but am not implementing it at the present time.
there is a fair amount of information out there that explains how to create a JCP councurrent program but very little that demonstrates the class needed.
I hope this helps -
I Tried to open a document via e-mail but it didn't work
I Tried to open a document I got via e-mail but it said upgrade to newest version of reader but I am running newest version.
I tried uninstalling reader and re-installing but still the same error message
this is the error message
Thanks 4 your helpOK,
I just solved this problem myself
what you do is just double click the error message
I did this using mail standard e-mail application of apple -
Why i can't share my documents via e-mail?
I click on share, then via e-mail and then you can chose between numbers, excel and PDF but after doing all this, the mail window doesn't open anymore, before was good but it just stoped working.
Help pleaseIn theory, slash or colon were not allowed in filenames.
For years, the operating system did its best to behave correctly with them.
It seems that, at last, Apple decided that the rule must apply and we see examples of tools failing when the rule isn't applied.
I remember that some years ago we had the same kind of problems with filename embedding the character # which is legal.
During 11 days I fought against the Bug Reporter Web site which failed when I tried to file a reporet with an attachment.
At last, I discovered that the wrongdoer was the character à which is embedded in the screenshot's name created on French system (Capture d’écran 2011-10-05 à 12:34:56)
So, if you have items whose name embed the forbidden chars, the answer is simple : hurry up, rename them.
Yvan KOENIG (VALLAURIS, France) mercredi 5 octobre 2011 23:27:18
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community -
Attachments in marketing documents not exposed via DI
Marketing Documents have now a new tab called "Attachments". The DI should expose the
functionality to "deal" with those attachments (e.g. Add, Update or Remove an attachment).
I created CRM 860084.
Kind Regards,
paoloYou can create new UDF, and then fill the value thru DI.
-
Printing marketing documents via DI API
Hello everybody?
I've been looking for some information about how to print marketing documents through DI API using the layout assigend in the PLD. Until now i have not found a way to do this, so I want to know if anyone has found a solution either using ALD?
I've seen some workaround using the DI API but it's not useful for me, so it's a definitive answer to say that it's not possible to do this?
ThanksHi,
When i had a similar requirement i used Crystal reports to preview and print my custom reports, I opened the Report on the Print Preview menu icon click.
Hope it helps,
Vasu Natari. -
Sending report output via E-mail (excel pivoted format)
Hi all,
i have a written a report where i need to send the report output to somebody via
E-mail.i am sending this report output via E-mail successfully.The receiver receives, my output in excel format.but this excel is not <b>pivoted</b>.
i want , the receiver should get my output in pivoted excel format.i.e my output data should be exactly fit in the excel sheet.
now the columns in excel sheet are overlapping.once i double clicked, the columns are getting separated.i do not want to double click.i want all the columns should come properly i.e excel field length should be adjusted as per the output field length.
i am giving my coding below.plz suggest how i can do the above thing .it's urgent.
any idea will be highly appreaciated.
Regards
if not p_email1 is initial.
perform fill_report_csv.
perform f_send_internet_mail.
endif.
FORM fill_report_csv.
data : l_text(232) type c,
v_matnr1(21) type c,
v_matnr(21) type c,
v_matkl(14) type c,
v_maktx(45) type c,
v_ttlstk(14) type c,
v_verpr(14) type c,
v_werks(14) type c,
v_lgort(14) type c,
v_char(10) type c,
v_stks type p ,
v_po(40) type c,
v_qty(13) type c,
v_qty1 type sy-datum,
v_date(15) type c,
v_date1(15) TYPE C,
v_name(35) type c,
v_eknam(18) type c,
v_lifnr(15) type c,
l_po(40) type c,
v_matnr(20) type c,
l_rate(11) type p decimals 5,
l_flag type c.
concatenate c_equal c_colon 'PO no.' c_colon
into v_po.
concatenate c_equal c_colon 'Material no.' c_colon
into v_matnr.
concatenate c_equal c_colon 'Description.' c_colon
into v_maktx.
concatenate c_equal c_colon 'Due Qty.' c_colon
into v_qty.
concatenate c_equal c_colon 'Del Date.' c_colon
into v_date.
concatenate c_equal c_colon 'Vendor.' c_colon
into v_name.
concatenate c_equal c_colon 'Buyer.' c_colon
into v_eknam.
concatenate c_equal c_colon 'Vendor Code.' c_colon
into v_lifnr.
concatenate
v_po v_matnr v_maktx v_qty
v_date v_name v_eknam v_lifnr
into i_download
SEPARATED BY con_tab.
append i_download .
clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
clear wa_output.
loop at i_output into wa_output.
on change of wa_output-ebeln.
clear v_lines.
loop at i_eket into wa_eket
where ebeln = wa_output-ebeln.
v_lines = v_lines + 1.
clear wa_eket.
endloop.
**-- Checking of page break
v_lines = sy-linno + v_lines .
if 55 < v_lines .
write:/0(161) sy-uline.
new-page.
endif.
clear v_lines.
loop at i_eket into wa_eket
where ebeln = wa_output-ebeln.
v_lines = v_lines + 1.
clear wa_eket.
endloop.
*-- Calculating the due qty.
wa_output-dumng = wa_output-menge - wa_output-wemng.
*-- Writing the Line items of the PO.
read table i_ekpo into wa_ekpo
with key ebeln = wa_output-ebeln
ebelp = wa_output-ebelp.
l_rate = wa_ekpo-netpr / wa_ekpo-peinh.
*-- Writing of PO detail
if wa_output-dumng gt 0 .
v_qty = wa_output-dumng.
v_date1 = wa_output-eindt.
v_maktx = wa_output-maktx.
if wa_output-maktx+0(1) = '"' .
concatenate c_equal wa_output-maktx
into v_maktx .
else .
concatenate c_equal c_colon wa_output-maktx c_colon
into v_maktx .
endif .
if wa_output-name1+0(1) = '"' .
concatenate c_equal wa_output-name1
into v_name .
else .
concatenate c_equal c_colon wa_output-name1 c_colon
into v_name .
endif .
v_name = wa_output-name1.
v_lifnr = wa_output-lifnr.
write wa_output-eindt to v_date1 DD/MM/YYYY.
concatenate '="' wa_output-ebeln '/'
wa_output-ebelp '"' into v_po .
concatenate '="' wa_output-matnr '"' into v_matnr .
concatenate c_equal c_colon wa_output-maktx c_colon
into v_maktx .
concatenate c_equal c_colon wa_output-dumng c_colon
into v_qty1 .
concatenate c_equal c_colon wa_output-eindt c_colon
into v_date1 .
concatenate c_equal c_colon wa_output-name1 c_colon
into v_name .
concatenate c_equal c_colon wa_output-eknam c_colon
into v_eknam .
concatenate c_equal c_colon wa_output-lifnr c_colon
into v_lifnr .
concatenate c_equal c_colon wa_mard-werks '/'
wa_mard-lgort c_colon
into v_lgort .
concatenate '="' wa_output-lifnr '"' into v_lifnr .
condense:v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
concatenate
v_po v_matnr v_maktx v_qty
v_date1 v_name v_eknam v_lifnr
into i_download
SEPARATED BY con_tab.
concatenate con_cret i_download INTO i_download .
append i_download .
endif.
clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
endloop.
ENDFORM. " fill_report_csv
*& Form f_send_internet_mail
text
--> p1 text
<-- p2 text
FORM f_send_internet_mail.
Variables
data: it_packing_list like sopcklsti1 occurs 0 with header line,
it_contents like solisti1 occurs 0 with header line,
it_receivers like somlreci1 occurs 0 with header line,
it_attachment like solisti1 occurs 0 with header line,
gd_cnt type i,
gd_sent_all(1) type c,
gd_doc_data like sodocchgi1,
gd_error type sy-subrc.
data: it_message type standard table of SOLISTI1 initial size 0
with header line.
data : found_receiver type c,
v_title(80) type c,
l_text(180) type c.
Fill the document data.
gd_doc_data-doc_size = 1.
Adds text to email text table
append 'Pls see attached open purchase order report.' to it_message.
append '' to it_message.
concatenate 'Note: This is system generated report'
', figures may subject to actual physical count.'
into l_text separated by space.
append l_text to it_message.
Populate the subject/generic message attributes
CLEAR gd_doc_data.
READ TABLE i_download INDEX w_cnt.
gd_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( i_download ).
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
if p_asdate is initial .
concatenate p_title ' '
sy-datum sy-uzeit into v_title separated by space.
else .
concatenate p_title ' '
p_bldat p_cputm into v_title separated by space.
endif .
gd_doc_data-obj_descr = v_title .
gd_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = i_download[].
Describe the body of the message
clear it_packing_list.
refresh it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
describe table it_message lines it_packing_list-body_num.
it_packing_list-doc_type = 'RAW'.
append it_packing_list.
Create attachment notification
it_packing_list-transf_bin = 'X'.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES it_packing_list-body_num.
it_packing_list-doc_type = 'XLS'.
it_packing_list-obj_descr = 'OPEN PURCHASE ORDER' .
it_packing_list-obj_name = 'PO.XLS' .
it_packing_list-doc_size = it_packing_list-body_num * 255.
APPEND it_packing_list.
assign SAP user smtp address from successful retrieval.
loop at p_email.
Add the recipients email address
found_receiver = 'X' .
it_receivers-receiver = p_email-low.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = ''.
it_receivers-notif_ndel = 'X'.
append it_receivers .
endloop .
Add default recipient email when unable to locate purc group email
if found_receiver is initial .
it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = ''.
it_receivers-notif_ndel = 'X'.
append it_receivers.
endif .
Call the FM to post the message to SAPMAIL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
commit_work = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = it_receivers
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
Store function module return code
gd_error = sy-subrc.
Get it_receivers return code
loop at it_receivers.
endloop.
Instructs mail send program for SAPCONNECT to send email.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = ' '
and return.
endif.
ENDFORM. " f_send_internet_mailHi,
go through this link,
http://www.sapdevelopment.co.uk/reporting/email/emailhome.htm
you have some sample programs.
Regards,
Raghavendra -
Hi all,
i have a written a report where i need to send the report output to somebody via
E-mail.i am sending this report output via E-mail successfully.The receiver receives, my output in excel format.but this excel is not <b>pivoted</b>.
i want , the receiver should get my output in pivoted excel format.i.e my output data should be exactly fit in the excel sheet.
now the columns in excel sheet are overlapping.once i double clicked, the columns are getting separated.i do not want to double click.i want all the columns should come properly i.e excel field length should be adjusted as per the output field length.
i am giving my coding below.plz suggest how i can do the above thing .it's urgent.
any idea will be highly appreaciated.
Regards
if not p_email1 is initial.
perform fill_report_csv.
perform f_send_internet_mail.
endif.
FORM fill_report_csv.
data : l_text(232) type c,
v_matnr1(21) type c,
v_matnr(21) type c,
v_matkl(14) type c,
v_maktx(45) type c,
v_ttlstk(14) type c,
v_verpr(14) type c,
v_werks(14) type c,
v_lgort(14) type c,
v_char(10) type c,
v_stks type p ,
v_po(40) type c,
v_qty(13) type c,
v_qty1 type sy-datum,
v_date(15) type c,
v_date1(15) TYPE C,
v_name(35) type c,
v_eknam(18) type c,
v_lifnr(15) type c,
l_po(40) type c,
v_matnr(20) type c,
l_rate(11) type p decimals 5,
l_flag type c.
concatenate c_equal c_colon 'PO no.' c_colon
into v_po.
concatenate c_equal c_colon 'Material no.' c_colon
into v_matnr.
concatenate c_equal c_colon 'Description.' c_colon
into v_maktx.
concatenate c_equal c_colon 'Due Qty.' c_colon
into v_qty.
concatenate c_equal c_colon 'Del Date.' c_colon
into v_date.
concatenate c_equal c_colon 'Vendor.' c_colon
into v_name.
concatenate c_equal c_colon 'Buyer.' c_colon
into v_eknam.
concatenate c_equal c_colon 'Vendor Code.' c_colon
into v_lifnr.
concatenate
v_po v_matnr v_maktx v_qty
v_date v_name v_eknam v_lifnr
into i_download
SEPARATED BY con_tab.
append i_download .
clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
clear wa_output.
loop at i_output into wa_output.
on change of wa_output-ebeln.
clear v_lines.
loop at i_eket into wa_eket
where ebeln = wa_output-ebeln.
v_lines = v_lines + 1.
clear wa_eket.
endloop.
**-- Checking of page break
v_lines = sy-linno + v_lines .
if 55 < v_lines .
write:/0(161) sy-uline.
new-page.
endif.
clear v_lines.
loop at i_eket into wa_eket
where ebeln = wa_output-ebeln.
v_lines = v_lines + 1.
clear wa_eket.
endloop.
*-- Calculating the due qty.
wa_output-dumng = wa_output-menge - wa_output-wemng.
*-- Writing the Line items of the PO.
read table i_ekpo into wa_ekpo
with key ebeln = wa_output-ebeln
ebelp = wa_output-ebelp.
l_rate = wa_ekpo-netpr / wa_ekpo-peinh.
*-- Writing of PO detail
if wa_output-dumng gt 0 .
v_qty = wa_output-dumng.
v_date1 = wa_output-eindt.
v_maktx = wa_output-maktx.
if wa_output-maktx+0(1) = '"' .
concatenate c_equal wa_output-maktx
into v_maktx .
else .
concatenate c_equal c_colon wa_output-maktx c_colon
into v_maktx .
endif .
if wa_output-name1+0(1) = '"' .
concatenate c_equal wa_output-name1
into v_name .
else .
concatenate c_equal c_colon wa_output-name1 c_colon
into v_name .
endif .
v_name = wa_output-name1.
v_lifnr = wa_output-lifnr.
write wa_output-eindt to v_date1 DD/MM/YYYY.
concatenate '="' wa_output-ebeln '/'
wa_output-ebelp '"' into v_po .
concatenate '="' wa_output-matnr '"' into v_matnr .
concatenate c_equal c_colon wa_output-maktx c_colon
into v_maktx .
concatenate c_equal c_colon wa_output-dumng c_colon
into v_qty1 .
concatenate c_equal c_colon wa_output-eindt c_colon
into v_date1 .
concatenate c_equal c_colon wa_output-name1 c_colon
into v_name .
concatenate c_equal c_colon wa_output-eknam c_colon
into v_eknam .
concatenate c_equal c_colon wa_output-lifnr c_colon
into v_lifnr .
concatenate c_equal c_colon wa_mard-werks '/'
wa_mard-lgort c_colon
into v_lgort .
concatenate '="' wa_output-lifnr '"' into v_lifnr .
condense:v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
concatenate
v_po v_matnr v_maktx v_qty
v_date1 v_name v_eknam v_lifnr
into i_download
SEPARATED BY con_tab.
concatenate con_cret i_download INTO i_download .
append i_download .
endif.
clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
endloop.
ENDFORM. " fill_report_csv
*& Form f_send_internet_mail
text
--> p1 text
<-- p2 text
FORM f_send_internet_mail.
Variables
data: it_packing_list like sopcklsti1 occurs 0 with header line,
it_contents like solisti1 occurs 0 with header line,
it_receivers like somlreci1 occurs 0 with header line,
it_attachment like solisti1 occurs 0 with header line,
gd_cnt type i,
gd_sent_all(1) type c,
gd_doc_data like sodocchgi1,
gd_error type sy-subrc.
data: it_message type standard table of SOLISTI1 initial size 0
with header line.
data : found_receiver type c,
v_title(80) type c,
l_text(180) type c.
Fill the document data.
gd_doc_data-doc_size = 1.
Adds text to email text table
append 'Pls see attached open purchase order report.' to it_message.
append '' to it_message.
concatenate 'Note: This is system generated report'
', figures may subject to actual physical count.'
into l_text separated by space.
append l_text to it_message.
Populate the subject/generic message attributes
CLEAR gd_doc_data.
READ TABLE i_download INDEX w_cnt.
gd_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( i_download ).
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
if p_asdate is initial .
concatenate p_title ' '
sy-datum sy-uzeit into v_title separated by space.
else .
concatenate p_title ' '
p_bldat p_cputm into v_title separated by space.
endif .
gd_doc_data-obj_descr = v_title .
gd_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = i_download[].
Describe the body of the message
clear it_packing_list.
refresh it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
describe table it_message lines it_packing_list-body_num.
it_packing_list-doc_type = 'RAW'.
append it_packing_list.
Create attachment notification
it_packing_list-transf_bin = 'X'.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES it_packing_list-body_num.
it_packing_list-doc_type = 'XLS'.
it_packing_list-obj_descr = 'OPEN PURCHASE ORDER' .
it_packing_list-obj_name = 'PO.XLS' .
it_packing_list-doc_size = it_packing_list-body_num * 255.
APPEND it_packing_list.
assign SAP user smtp address from successful retrieval.
loop at p_email.
Add the recipients email address
found_receiver = 'X' .
it_receivers-receiver = p_email-low.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = ''.
it_receivers-notif_ndel = 'X'.
append it_receivers .
endloop .
Add default recipient email when unable to locate purc group email
if found_receiver is initial .
it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = ''.
it_receivers-notif_ndel = 'X'.
append it_receivers.
endif .
Call the FM to post the message to SAPMAIL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
commit_work = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = it_receivers
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
Store function module return code
gd_error = sy-subrc.
Get it_receivers return code
loop at it_receivers.
endloop.
Instructs mail send program for SAPCONNECT to send email.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = ' '
and return.
endif.
ENDFORM. " f_send_internet_mailans
Maybe you are looking for
-
Adobe Acrobat 9.5 (standard) has stopped working
Acrobat has always been prone to crashing on my various Windows computers throughout the years, and my current version 9.5 standard on Windows 7 64-bit is no exception. Crashes usually occur when extracting and/or deleting pages. With my almost total
-
My mom and my brother are both on PC's, she can't see any of the gallery (although this may be part user error on her part), my brother is pretty fluent with computers and he can see pictures, but can't get the movies to roll in any browser (IE7, FF
-
Can't install Clamxav on new Intel solo core mini
Hi, I'm new to this forum and also apple mac's having just abandoned Windows after my 3 millionth crash. Anyhow, after reading the forums I'm aware viruses aren't such a big deal, if at all, however I'd rather be safe than sorry so I was looking to i
-
How to show JTree on html,jsp
Any help?What to use JFrame, scrollpane or what? Thanxs
-
Unknown high data transfer on storage account
I have an Azure subscription from MSDN Ultimate (running on the old pricing model). There, I run two VMs (West Europe). Both have their VHDs stored in the same storage account (also West Europe). It is geo-redundand by default (didn't change it). The