Issue in CSV file attachment.
Hi All,
I am using the FM : SO_DOCUMENT_SEND_API1 for sending mails in CSV format. This CSV file contains some chinese scripts. But when I open the attachment I can see some junk characters instead of that. My SAP version is 4.6c
I searched in all the forums and found these 2 solutions
1. OSS note 633265 .
2. Changed the characters set into simplified and traditional chinese.
Both didnt helped.
Suggestions are welcome.
Regards,
Dinesh.
Hi Dinesh,
again: Never use FM : SO_DOCUMENT_SEND_API1 . Go for CL_BCS. Check programs
BCS_EXAMPLE_5
BCS_EXAMPLE_6
BCS_EXAMPLE_7
BCS_EXAMPLE_8
Regards,
Clemens
Similar Messages
-
SOAP Axis sender with CSV file attachment
Hi Experts,
I have a requirement where I receive a CSV file attachment from a Web Service post ( i.e a SOAP sender with attachment). I decided to use SOAP with Servlet(Axis) protocol, since standard SOAP sender does not allow modules to be used.
I am able to test this interface through SOAPUI with attachment to the point where I can get the attachment payload as my main payload in IE, but it fails in mapping since CSV needs to be converted to XML. I have following queries for proceeding ahead with this scenario:
1. How do I convert the CSV attachment to XML inorder for mapping to be used in IE. Is there a standard axis handler available for this ???? Also where should this handler be called in the sequence of Axis modules ???
2. Can I use MessageTransformationBean for converting plain to XML ??? If yes where should this module be called in the sequence of Axis modules. I tried using this module between the CallSapAdapter and the first AdapterBean but it returns exception in SOAPUI saying " Messaging exception: No Main"
3. Is there a blog available which illustrates about using additional modules/handlers in Axis. I have had a look at the FAQ note of Axis but it just gives the overview.
Thanks.
Siddhesh S.TawateSolved :).
1 AF_Adapters/axis/HandlerBean Local Enterprise Bean xireq
2 AF_Adapters/axis/AFAdapterBean Local Enterprise Bean afreq
3 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean Plain2XML
4 CallSapAdapter Local Enterprise Bean sap
5 AF_Adapters/axis/AFAdapterBean Local Enterprise Bean afresp
6 AF_Adapters/axis/HandlerBean Local Enterprise Bean xires
Above sequence worked. I guess I was missing some parameter in content conversion earlier.
Thanks. -
BEA 9.2 Portal issue: downloaded CSV file contains embedded html code
We have J2EE application using BEA 9.2 Portal framework, and one of the page has feature to generate report( in pop up window) in CSV file format. As per the history from previous developer, BEA 8.1 didn't have this issue but, after mirgration to 9.2, they started having file download error( incomplete contents ..). To overcome this issue they commented out setting content length to HttpServletResponse as attached below, but this, now, causes html page source code of the parent page( where submit button is clicked to generate csv file report) being rendered along with actual report in the downloaded CSV file. Has anyone have this sort of issue? If so, can you please share your thoughts? or any thoughts in general?
BEA 9.2 with Portal framework, JDK 15, JSP, Beehive NetUI, Sun Microsystem Solaris server
Here is the source code that avoids setting content length and reasoning behind it..
private static void setResponseHeadersForCSVFile(HttpServletResponse response, String filename, int contentLength)
String mimeType = mimeTypes.getContentType(filename);
response.reset();
response.setContentType(mimeType);
// DON'T explicitly set the content length, since the length of the String or StringBuffer that contains
// the contents of the CSV file will be character encoded when it is actually written to the output stream, based
// upon the character encoding of this JVM App Server's settings. So let the JVM App Server framework apply the character
// encoding AND set the final and truly correct content length header at the time the contents of the String or StringBuffer are truly
// streamed back to the user.
//response.setContentLength(contentLength);
response.addHeader("Content-Disposition", "attachment; filename=\"" + filename + "\"; size=" + contentLength);
}1) Yes, the old content.tld is available as part of a web library module as a taglib.tld file. The module is: wlp-services-web-lib.war, which can be found in your bea/weblogic92/portal/lib/modules directory.
2) The new API is accessible from the ContentManagerFactory class. This provides access to INodeManager, ITypeManager, ISearchManager, etc. The new API is contained within the com.bea.content.federated package. The 8.1.x API in the com.bea.content.manager package including RepositoryManager, NodeOps, SearchOps, etc. has been deprecated with 9.2.
3) Yes, via the new I*Manager implementations. The entitlement support is for application-scoped visitor roles. Make sure you're using the ISearchManager when performing search operations. This will ensure secure results are returned. -
Sender "Mail" adapter - CSV file attachment
Hi there
I'm looking for some help in configuring a sender mail adapter that receives ".csv" files. I did read some blogs that mention using the "PayloadSwapBean" module to read the mail attachment instead of the mail content. My problem is to now convert the ".csv" file into a message. Is there a module that I can use ( is it the "MessageTransfomBean" ) and how. Any help would be appreciated.
Thanks
SalilHi Salil,
If you want to send a mail with a body and attachments, the message sender HAS to provide an XI message with attachments. I doubt a CSV file does justice.
As Renjith said you need to convert CSV to XmL.
A short description about the Standard Modules:
MessageTransformationBean is a standard module used to apply the XSLT mapping to the adapter module by using <i>Transform.class</i> ( This xslt mapping is done to create a mail package, Dont confuse with the actual mapping in your case this is NOT for converting csv to xml).
Also this module can be used to change the name and type of payloads by using <i>Transform.contentType</i>, <i>Transform.contentDisposition</i>, <i>Transform.contentDescription</i>.
PayloadSwapbean is a standard module for replacing payloads with other payloads (SWAP)
If you want to give each attachment a certain name use Parameters, <i>swap.keyname</i> for name of the payload and <i>swap.keyvalue</i>.
I Hope the use of standard modules is understood. -
CSV File attachment in Receiver Mail Adapter
Hi Experts ,
mine is a proxy to mail scenario Information from proxy needs to be converted to CSV file and to be send across in the form of attachment to multiple recievers.
I would request best suggestions from experts.
Regards,
Arnab .Hi,
first approach is,
1. in cilent proxy report to call 'GUI_UPLOAD' function module , in exporting, filetype = 'txt', filename.
second approach is,
2. you can you message transformation bean in you mail receiver communication channel.
http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm
you want to send multiple receivers ,
3. In the Receiver Determination, you need to select " Extended" in the Type of Receeiver determination.
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3343.
regards,
ganesh. -
Javax.mail CSV file attachment corrupt?
I'm having some trouble with attaching a file to an outgoing email, it's a CSV file and when it is uploaded/attached to the email, it becomes "corrupt". Excel will still open it but if I open it in notepad the formatting is noticeably messed up. I need it to retain all the correct return carriages and line feeds, which I believe are what are getting mingled. (Another program must read it and this formatting is messing everything up).
Here's the code:
MimeBodyPart messageBodyPart =
new MimeBodyPart();
//fill message
messageBodyPart.setText(outBoundMessage);
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
if (fileAttachment != null) {
// Part two is attachment
MimeBodyPart attachment = new MimeBodyPart();
attachment.attachFile(fileAttachment);
attachment.setFileName(fileAttachment.getName());
attachment.setHeader("type", "text/csv");
multipart.addBodyPart(attachment);
// Put parts in message
message.setContent(multipart);The other parts of the message are being created and attached where necessary. My guess is that it's not transferring in binary? I've never really done this sort of thing so if anyone could lend a hand and show me how to properly attach files so they don't get altered in anyway I would greatly appreciate it.Hi,
I am sending csv file as an attachment by using below code
import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class AttchmtMail
String finaldt;
public void mailAtchmt(String fname,String dt) {
String to="[email protected]";
String from = "[email protected]";
String to2="[email protected]";
String host = "xxx.xx.xxx.xxx";
// Create properties, get Session
Properties props = new Properties();
// If using static Transport.send(),
// need to specify which host to send it to
props.put("mail.smtp.host", host);
// To see what is going on behind the scene
props.put("mail.debug", "true");
Session session = Session.getInstance(props);
try {
// Instantiatee a message
Transport bus = session.getTransport("smtp");
bus.connect();
Message msg = new MimeMessage(session);
//Set message attributes
msg.setFrom(new InternetAddress(from));
InternetAddress[] address = {new InternetAddress(to),new InternetAddress(to2)};
msg.setRecipients(Message.RecipientType.TO, address);
msg.setSubject("New OU's on "+dt+".");
msg.setSentDate(new Date());
// String filename= "C:/Feeds/"+finaldt+"/"+files;
String file1= fname;
File f1=new File(file1);
if(f1.exists())
setFileAsAttachment(msg, file1);
else
//setFileAsAttachment(msg,"","",info);
msg.saveChanges();
bus.sendMessage(msg, address);
bus.close();
catch (MessagingException mex) {
// Prints all nested (chained) exceptions as well
mex.printStackTrace();
// How to access nested exceptions
while (mex.getNextException() != null) {
// Get next exception in chain
Exception ex = mex.getNextException();
ex.printStackTrace();
if (!(ex instanceof MessagingException)) break;
else mex = (MessagingException)ex;
public void setFileAsAttachment(Message msg, String filename)
throws MessagingException {
// Create and fill first part
MimeBodyPart p1 = new MimeBodyPart();
p1.setText("Dear ,\n\nPlease check the attachment " );
// Create second part
MimeBodyPart p2 = new MimeBodyPart();
// Put a file in the second part
if(!filename.equals(""))
FileDataSource fds = new FileDataSource(filename);
p2.setDataHandler(new DataHandler(fds));
p2.setFileName(fds.getName());
// Create the Multipart. Add BodyParts to it.
Multipart mp = new MimeMultipart();
mp.addBodyPart(p1);
if(!filename.equals(""))
mp.addBodyPart(p2);
} // Set Multipart as the message's content
msg.setContent(mp);
}//End of class
Madhu -
Setting required to process incomming Email with CSV file attached
Dear all,
We are having a scenario where in the supplier receives a PO confirmation CSV file from the download center as an Email attachment. The supplier updates the file by confirming PO's and replies back. The CSV file needs to update the confirmed PO's in SNC.
The SO50 settings are in place but still we are not able to receive the Email back in SNC. Any suggestion on what settings we need in SNC to receive and process the CSV file?
thanks,
mahehsHi,
You can use the upload center to process the changed data. Isnt that helpful?
Best Regards,
Harsha Gatt -
Issue loading CSV file into HANA
Hi,
From last couples of weeks i am trying to load my CSV file into HANA Table, but i am unable to succeed.
I am getting error "Cannot open Control file, /dropbox/P1005343/CRM_OBJ_ID.CTL". I have followed each and every step in SDN, still I could not load data into my HANA table.
FTP: /dropbox/P1005343
SQL Command:
IMPORT FROM '/dropbox/P1005343/crm_obj_id.ctl'
Error:
Could not execute 'IMPORT FROM '/dropbox/P1005343/crm_obj_id.ctl''
SAP DBTech JDBC: [2]: general error: Cannot open Control file, /dropbox/P1005343/crm_obj_id.ctl
Please help me on this
Regards,
PraneethHi All,
I have successfully loaded the file into HANA database in folder P443348 but while importing file, I am getting the following error message such as
SAP DBTECH JDBC: [2] (at 13) : general error: Cannot open Control file, "/P443348/shop_facts.ctl"
This is happening while I am executing the following import statement
IMPORT FROM '/P443348/shop_facts.ctl';
I have tried several options including changing the permissions of the folders and files to no success. As of now my folder has full access, which is 777
Any help would be greatly appreciated so that I can proceed further
Thanks
Vamsidhar -
Issue Loading CSV file using OPENROWSET
Hi All,
I have a csv file that has a value like -200 when i tried open the file in SQL using OPENROWSET that value is read as null.
select * from
OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Text;Database=C:\TEST\;',
'SELECT * FROM ABC.csv')
when i save teh fiel as .xlsx and open using the OPENROWSET syntax for xlsx file it shows the correct value.
I am not sure if it is the behaviour of teh file or withe SQL.Can some one tell me what would be the possible reasons for that.
Thanks in advance.
RaghavCheck this link and sample:
http://www.databasejournal.com/features/mssql/article.php/10894_3331881_2
select * from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};
DefaultDir=C:\External;','select top 6 * from
MyCsv.csv')
Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered. -
Crystal Reports 9.2.0.448 Formatting and exporting issues on CSV file
Hello,
when starting export to csv, excel or text - out of the crystal reports preview - content gets lost, i.e. crystal cuts parts of the csv text.
If I try exporting to word or pdf the whole content is being exported.
Can anybody tell me how to fix that problem?
Is this a known issue? Does there probably already exist a hotfix? I couldn't find any.
Would be great, if someone helped me!
MonikaHi Monika,
No more fixes done to CR 9 since it's so old. Go to this link and download any patches you can find for CR 9:
http://service.sap.com/sap/bc/bsp/spn/bobj_download/main.htm
If that doesn't work try increasing the field width or using the Can Grow option. If that doesn't work then try downloading a trial version of CR XI R2 or Cr 2008 and test again. I suggest you try this on a PC other than your main PC just in case. We support side by side installs but you never know what it may do depending on what else you have installed.
Thank you
Don -
set echo off
--set line 999
set space 0
set feedback on
set term off
set linesize 32000
set pagesize 49999
set colsep ,
select ci.CIRC_HUM_ID as Circuit_id,
cp.CIRC_PATH_HUM_ID as Associated_Path,
ci.TYPE as Category,
ci.bandwidth,
ci.VENDOR,
ci.STATUS,
si.CLLI as A_Site,
si.ADDRESS as A_Site_Address,
si.CITY as A_Site_City,
si.STATE_PROV as A_Site_State,
si1.CLLI as Z_Site,
si1.ADDRESS as Z_Site_Address,
si1.CITY as Z_Site_City,
si1.STATE_PROV as Z_Site_State
from telepac1.circ_path_inst cp
,telepac1.site_inst si
,telepac1.site_inst si1
,telepac1.circ_inst ci
where si.site_inst_id = cp.A_SIDE_SITE_ID
and si1.site_inst_id = cp.Z_SIDE_SITE_ID
and cp.CIRC_PATH_INST_ID = ci.CIRC_PATH_INST_ID (+);I am getting correct data in csv format but for Z_Site_Address some the vales of cell are coming to next row.
Z_Site_Address
SBC
345 N San Joaquin the data is coming is like this for few rows
but i want data like below
Z_Site_Address
SBC 345 N San Joaquin>
I am getting correct data in csv format but for Z_Site_Address some the vales of cell are coming to next row.
Z_Site_Address
SBC
345 N San JoaquinThat is because, as Jeneesh said, your data has embedded record delimiters. That data above may LOOK wrong but it is EXACTLY what your column contained.
That often happens when an application uses a MEMO field that lets a user type in multiple lines for a long text description or, in your case, for an address.
If you don't want embedded record delmiters in your DB data you should remove them when your app saves the data to begin with. If you convert those characters to spaces in the file and load the file again you will NOT have the same content you have to begin with. That means that app field will display one long line of characters to the user.
That is the price you pay for using delimited files; by default any embedded delimiters will cause the created file to be unloadable.
Be aware that if you are creating a COMMA delimited file then any embedded commas can cause a problem also unless the field is enclosed in double quotes. That is because when you read or try to load the file those 'extra' comma will be interpreted as a FIELD separator.
For example an address like '123 Maple St, Apt 111' will appear to be TWO values: '123 Maple St' and 'Apt 111'. -
Hi All,
I have a table with the following columns
SYSTEM_SOURCE VARCHAR
NATIONAL_IDENTIFIER VARCHAR
HOURS NUMBER
EARNING_CODE VARCHAR
PAYROLL_NAME VARCHAR
COST_CENTER VARCHAR
BRAND VARCHAR
WEEK_NUMBER NUMBER
AMOUNT NUMBER
STATUS VARCHAR
DETAIL_FLAG VARCHAR
My sqlldr script is as follows:
LOAD DATA
INFILE *
APPEND INTO TABLE XXARG.XXARG_HR_TIME_SUMMARY_STG
fields terminated by ","
TRAILING NULLCOLS
SYSTEM_SOURCE CONSTANT 'RTI'
,NATIONAL_IDENTIFIER CHAR terminated by "," "substr(REPLACE(:NATIONAL_IDENTIFIER,'TC#'),1,3) || '-' || substr(REPLACE(:NATIONAL_IDENTIFIER,'TC#'),4,2) || '-' || substr(REPLACE(:NATIONAL_IDENTIFIER,'TC#'),6,4)"
,HOURS DECIMAL EXTERNAL terminated by "," NULLIF (HOURS=BLANKS)
,EARNING_CODE CHAR terminated by "," "trim(:EARNING_CODE)"
,PAYROLL_NAME CHAR terminated by ","
,COST_CENTER CHAR terminated by "," "'01'|| LPAD(TRIM(REPLACE(:COST_CENTER,'a')),5,'0')"
,BRAND CONSTANT 'ARG'
,WEEK_NUMBER DECIMAL EXTERNAL
,AMOUNT DECIMAL EXTERNAL NULLIF (AMOUNT=BLANKS)
,STATUS CONSTANT 'U'
,DETAIL_FLAG CONSTANT 'N'
The data file is as follows:
999999999 , 35.416, REG, RNO , 07157, 1, ,
999999999 , 34.549, REG, RNO , 07157, 2, ,
999999999 , , BON, RNO , 07157, 2, 25.00
When I run sqlldr from my desktop (sqlldr 9i), it works fine. However when I run the sqlldr from the server (unix box), it fails for row 3
Record 3: Rejected - Error on table XXARG.XXARG_HR_TIME_SUMMARY_STG, column AMOUNT.
ORA-01722: invalid number
If I put a ',' at the end of line 3, it works fine on the server as well. Appreciate your help in resolving this issue.
Thanks
VenkyWhat is the full database version (I suspect 10g+) ? In your control file, you have specified
>
fields terminated by ","
>
yet your last field in the third row does not have this delimiter. 9i may have been forgiving and used the CR/LF as a separator, but the database version needs the delimiter.
HTH
Srini -
How can I email using UTL_SMTP with a csv file as an attachment?
Dear All,
It would be great if someone could help me. I am trying to use UTL_SMTP to email with a csv file as attachment. I do get an email with a message but no attachment arrives with it.
In fact the code used for attaching the csv file gets appended in the message body in the email.
CREATE OR REPLACE PROCEDURE test_mail
AS
SENDER constant VARCHAR2(80) := '[email protected]';
MAILHOST constant VARCHAR2(80) := 'mailhost.xxxx.ac.uk';
mail_conn utl_smtp.connection;
lv_rcpt VARCHAR2(80);
lv_mesg VARCHAR2(9900);
lv_subject VARCHAR2(80) := 'First Test Mail';
lv_brk VARCHAR2(2) := CHR(13)||CHR(10);
BEGIN
mail_conn := utl_smtp.open_connection(mailhost, 25) ;
utl_smtp.helo(mail_conn, MAILHOST) ;
dbms_output.put_line('Sending Email to : ' ||lv_brk||'Suhas Mitra' ) ;
lv_mesg := 'Date: '||TO_CHAR(sysdate,'dd Mon yy hh24:mi:ss')||lv_brk||
'From: <'||SENDER||'>'||lv_brk||
'Subject: '||lv_subject||lv_brk||
'To: '||'[email protected]'||lv_brk||
'MIME-Version: 1.0'||lv_brk||
'Content-type:text/html;charset=iso-8859-1'||lv_brk||
' boundary="-----SECBOUND"'||
''||lv_brk||
'-------SECBOUND'||
'Some Message'
|| lv_brk ||
'-------SECBOUND'||
'Content-Type: text/plain;'|| lv_brk ||
' name="xxxx.csv"'|| lv_brk ||
'Content-Transfer_Encoding: 8bit'|| lv_brk ||
'Content-Disposition: attachment;'|| lv_brk ||
' filename="xxxx.csv"'|| lv_brk ||
lv_brk ||
'CSV,file,attachement'|| lv_brk || -- Content of attachment
lv_brk||
'-------SECBOUND' ;
dbms_output.put_line('lv_mesg : ' || lv_mesg) ;
utl_smtp.mail(mail_conn, SENDER) ;
lv_rcpt := '[email protected]';
utl_smtp.rcpt(mail_conn, lv_rcpt) ;
utl_smtp.data(mail_conn, lv_mesg) ;
utl_smtp.quit(mail_conn);
EXCEPTION
WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
NULL ;
WHEN OTHERS THEN
dbms_output.put_line('Error Code : ' || SQLCODE) ;
dbms_output.put_line('Error Message : ' || SQLERRM) ;
utl_smtp.quit(mail_conn) ;
END;LKBrwn_DBA wrote:
Use UTL_MAIL instead.That package is an utter disappointment - and an excellent example IMO of how not to design an application programming interface. Even the source code is shoddy.. I mean, having to resort to a GOTO statement....!!?? The person(s) who wrote that package are sorely lacking in even the most basic of programming skills if structured programming is ignored and a spaghetti command used instead.
No wonder the public interface of that code is equally shabby and thoughtless... The mail demo code posted by Oracle was better written than this "+package+" they now have bundled as the official Mail API.
I dunno.. if I was in product management there would have been hell to pay over pushing cr@p like that to customers. -
CSV file as an attachment is not in the recognizable format
Hi All,
I have a requirement to send a csv file as an e-mail attachment. For this, I am collecting the required data into the final internal table and converted this final internal table data into CSV format and then sending this in the mail as csv file attachment using the functiona module 'SO_NEW_DOCUMENT_ATT_SEND_API1'. Program is working fine and mail is coming to receiver's inbox.
Well.. Now the problem is, I am getting the message while opening the csv file as "The file is not in a recognizable format." and if we say OK... then it is opening. Now how can we avoid coming of this message while opening the file.
Please advice.
Thanks a lot in advance.
Regards
Ramesh.These are all the Object types which are allowed in the attachement format.. try changing to any of the formats..
ALI ABAP list document
ARC Archive object (image)
BCS External Document Storage
BIN Binary document
DLI Distribution list
EXT PC document
FOL Folder
GRA SAP Business Graphics
OBJ Business object
OFO Object folder
OTF OTF document
R3I IDoc
RAW SAP editor document
SCR SAPscript document
URL Link to Internet/Intranet
WIM Work item
XXL Document for list viewer -
Hello All,
We are facing below issue during CSV file generation :
Generated file shows field value as 8.73E+11 in output and when we are clicking inside this column result shown is approximate of the correct value like 873684000000. We wish to view the correct value 872684000013.
Values passes from report program during this file generation are correct.
Please advice to resolve this issue.
Thanks in Advance.There is nothing wrong in your program, it is the property of excel that if the value in the cell is larger than
default size it shows in output of that format.
Maybe you are looking for
-
I have been using firefox and having no problem until yesterday when trying to print various item on web sites I am getting communication errors with my printer. I can print from word perfect, Internet explorer, etc. It is not a printer problem but a
-
Interactive PDF in HTMLResources?
I've figured out how to embed a pdf within the DPS project that I'm working on, however I want to be able to create some interactive navigation within the pdf? As of now, the pdf comes in without any interactivity. Is there any way to do this or is i
-
Can't focus on custom itemRenderer?
I have made a custom itemRenderer doubling as an itemEditor following the guidelines in the documentation. However, even though I have set the rendererIsEditor="true", when tabbing amongst other editable fields, the controls inside the itemRenderer d
-
Is there a known bug using IE8 and trying to Export an FDM map to Excel?
I'm using 11.1.2 and keep getting an error message.
-
I don't know, how install Solaris 10 in V445server
I dosnt know how install Solaris 10in these station, please help me