Send mail as comma seperated file from abap
Hi,
i need to send mail from my program...as a comma seperated file...can u help me out.
regards
shankar
See function module SO_NEW_DOCUMENT_ATT_SEND_API1, there is an example in the documentation. The example is for a .BMP file but you should be able to use the similar code for a text file (you might need to use object RAW). The content of comma-separated file must be in an internal table when you'll call this function module.
There are also lots of examples available all over the Internet, use search by FM name.
Similar Messages
-
Is it possible to download a comma delimited file from ABAP to a Portal
directory or Web Dev URL on the Portal?
We currently have a comma delimited file being emailed nightly using standard SAP FMs to a distribution list.
We want to move these files to the Portal instead.
Speaking with our Portal guys, they say the easiest way for them to receive the file is if I can download directly to a Web Dev URL.
Does SAP provide a way to communicate from our app server to the portal?
thanks alot,
rp.Is it possible to verify a signed jar-file from a
program
(using some API) likewise jarsigner does?Hi,
You would have to open the jarfile, read each jar entry and for each of them do a getCertificates() and then in turn verify each certificate with the public key of the enclosed certificates in the jar file.
An easier solution would be to use the verify flag of the JarFile or JarInputStream.
Hope it helps..
Cheers,
Vijay -
Regarding sending mails to group of users from ABAP program
Hi,
I have a program which sends Email's to group of users.
And code for that purpose is written as below.
<b>* Insert distribution list name into i_send
i_send-receiver = 'TEST-DIST'. "Distribution List</b>
Can anybody tell me where the mail id's[Group of] will be given for this purpose.
TEST-DIST will be having set of mail id's where does i can see them and change.
If anybody knows please post!
Thanks in advance.
Thanks & Regards,
Prasad.Hi,
I got the issue.
It will be in SO01.
Where we can give Mail ID's for Shared/Private Distribution List(s).
Thanks,
Prasad. -
Generate an Upload the current table to a comma seperated file
Hi Freaks,
i want to generate a comma seperated file from the current table (which was modified in the current Apex Window) and also upload the file to a file server.
What is the best practice?
Thanks a lot
WolleHello Wolle,
In the APEX SQL Workshop -> Object browser, when you select a table, and select the Data tab. There's a link at the bottom of the table, "Download". This will automatically generate a csv file for you.
Alternatively you can use a client like toad or sql developer to generate a csv.
Greetings,
Rutger
http://rutgerderuiter.blogspot.com/
===============================================================================
You can reward this reply by marking it as either Helpful or Correct ;-) -
Sending .xlsx file from ABAP
Hi Experts,
How can we send .XLSX file from ABAP.
I have done as suggested in note 1459896 but it's not working.
I have added the header table with such value
concatenate '&SO_FILENAME=' lv_filename into lv_text_line.
append lv_text_line to lt_att_head.
passing header table to
lo_document->add_attachment( exporting i_attachment_type = 'XLS'
i_attachment_subject = 'AttachmentFilename'
i_attachment_size = lv_size
i_attachment_header = lt_att_head
i_att_content_hex = binary_content ).
but when I try to open it in SOST it says," file format or extension is not valid " .
Do you think if I send thsi mail to outlook it will work. ?
Thanks
WilliBut SAP note says 1459896 , it can be done
using
filename = 'attachment.xlsx'
concatenate '&SO_FILENAME=' lv_filename into lv_text_line.
append lv_text_line to lt_att_head.
but still not working. -
9iJSP Report output to a comma seperated file
Hi,
Is it possible to create a comma seperated file with output data from a 9iJSP report. If yes, can anyone tell me how ??
thanks in advance
UnmeshHello Unmesh,
If your JSP report has a paper layout, then you can use Reports Builder or the client/servlet/runtime executables to generate the paper layout to CSV formatted output with the DESFORMAT=DELIMITEDDATA and DELIMITER=, command-line options. If you have only a web layout , it will generate its output only in HTML format.
You can add a paper/web layout to your JSP report, if it already doesn't have one, by opening it in Reports Builder, and inserting a report block in the paper layout view/web source view. This JSP report can then be used both to generate to CSV format using rwservlet, and to the web when deployed as a JSP.
Thanks,
The Oracle Reports Team. -
I am trying to read in data from a .CSV file.
The CSV file contains a list of questions and answers in the
format;
Question, option1, option2,option3,option4, correct answer
My problem is that I can get the whole line into an array but
I can't find a way of getting each element of the comma seperated
file into a multi dimensioned array.
I need to be able to use MyArray[1,1] is equal to
Question and MyArray[1,2] is equal to
option1 etc etc
Hope this makes sense
PaulIn your routine you have two loops.
Either one will work on thier own but as soon i nest them
then it just stops working........
The below data is stored as a Data.csv file (Obviously it
contains a lot more these are the first 3 records.) **Can't count =
4 records lol)
,,B,,,,Lorry,,,,,X,,,,,CC5001 ,Mark one answer,,under 7.5
tonnes maximum authorised mass,over 7.5 tonnes maximum authorised
mass,over 7.5 metres overall height,under 7.5 metres overall
height,,,1111,This sign means no entry for goods
vehicles,TS4619.eps,CC5001.gif ,Vehicle Weights and Dimensions
,,B,,,,Lorry,,,,,X,,,,,CC5002 ,Mark one answer,,either the
left-hand or middle lane,only the left-hand lane,only the middle
lane,any of the lanes,,,1111,Your lorry is over 7.5 tonnes maximum
authorised mass. This sign means you may use,TS4545.eps,CC5002.gif
,Vehicle Weights and Dimensions
,,C,,,,Lorry,,,,,,X,,,,CC5003,Mark one answer,,30 mph,40
mph,50 mph,60 mph,,,1111,You are driving a lorry with a maximum
authorised mass of 7 tonnes. What is the maximum speed limit on a
single carriageway?,,,Vehicle Weights and Dimensions
,,B,,,,Lorry,,,,,X,,,,,CC5004,Mark one answer,,30 mph,40
mph,50 mph,60 mph,,,1111,What is the national speed limit on a
single carriageway road for a rigid lorry weighing more than 7.5
tonnes maximum authorised mass?,,,Vehicle Weights and
Dimensions -
How to make comma seperated file
hi
I have a select statement that looks like below. I want to make comma seperated file for the selected columns. How to write it?
SELECT MM.DAL_NUMBER,
'19-NOV-2009' as WSS_CE,
CPN_INT,
TRADE_DATE,
MX_DATE "LAST_DATE",
CUSTOMER_SPECIF CUST_GID,
NAME_SHORT CUST_NAME_SHORT
from my_table;
if you could provide me with exact query.
ThanksSlightly more generic approach...
As sys user:
CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
/As myuser:
CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
,p_dir IN VARCHAR2
,p_header_file IN VARCHAR2
,p_data_file IN VARCHAR2 := NULL) IS
v_finaltxt VARCHAR2(4000);
v_v_val VARCHAR2(4000);
v_n_val NUMBER;
v_d_val DATE;
v_ret NUMBER;
c NUMBER;
d NUMBER;
col_cnt INTEGER;
f BOOLEAN;
rec_tab DBMS_SQL.DESC_TAB;
col_num NUMBER;
v_fh UTL_FILE.FILE_TYPE;
v_samefile BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
BEGIN
c := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
d := DBMS_SQL.EXECUTE(c);
DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
ELSE
DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
END CASE;
END LOOP;
-- This part outputs the HEADER
v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
FOR j in 1..col_cnt
LOOP
v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
END LOOP;
-- DBMS_OUTPUT.PUT_LINE(v_finaltxt);
UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
IF NOT v_samefile THEN
UTL_FILE.FCLOSE(v_fh);
END IF;
-- This part outputs the DATA
IF NOT v_samefile THEN
v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
END IF;
LOOP
v_ret := DBMS_SQL.FETCH_ROWS(c);
EXIT WHEN v_ret = 0;
v_finaltxt := NULL;
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
ELSE
v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
END CASE;
END LOOP;
-- DBMS_OUTPUT.PUT_LINE(v_finaltxt);
UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
END LOOP;
UTL_FILE.FCLOSE(v_fh);
DBMS_SQL.CLOSE_CURSOR(c);
END;This allows for the header row and the data to be written to seperate files if required.
e.g.
SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
PL/SQL procedure successfully completed.Output.txt file contains:
empno,ename,job,mgr,hiredate,sal,comm,deptno
7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
Adapt to output different datatypes and styles are required. -
Creating an xml file from abap code
Hello All,
Please let me know which FM do I need to execute in order to create an XML file from my ABAP code ?
Thanks in advance,
Paul.This has been discussed before
XML files from ABAP programs -
Create XML file from ABAP with SOAP Details
Hi,
I am new to XML and I am not familiar with JAVA or Web Service. I have searched in SDN and googled for a sample program for creating XML document from ABAP with SOAP details. Unfortunately I couldn't find anything.
I have a requirement for creating an XML file from ABAP with SOAP details. I have the data in the internal table. There is a Schema which the client provided and the file generated from SAP should be validating against that Schema. Schema contains SOAP details like Envelope, Header & Body.
My question is can I generate the XML file using CALL TRANSFORMATION in SAP with the SOAP details?
I have tried to create Transformation (Transaction XSLT_TOOL) in SAP with below code. Also in CALL transformation I am not able to change the encoding to UTF-8. It's always show UTF-16.
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
<xsl:template match="/">
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Header>
<CUNS:HeaderInfo>
<CUNS:InterfaceTypeId>10006</InterfaceTypeId>
<CUNS:BusinessPartnerID>11223344</BusinessPartnerID>
<CUNS:SchemaVersion>1.0</SchemaVersion>
<CUNS:DateTime>sy-datum</DateTime>
</CUNS:HeaderInfo>
</SOAP:Header>
<SOAP:Body>
<xsl:copy-of select="*"/>
</SOAP:Body>
</SOAP:Envelope>
</xsl:template>
</xsl:transform>
In ABAP program, I have written below code for calling above Transformation.
call transformation ('Z_ID')
source tab = im_t_output[]
result xml xml_out.
call function 'SCMS_STRING_TO_FTEXT'
exporting
text = xml_out
tables
ftext_tab = ex_t_xml_data.
Please help me how to generate XML file with SOAP details from ABAP. If anybody have a sample program, please share with me.
Is there any easy way to create the XML file in CALL Transformation. Please help.
ThanksTry ABAP forum, as it seems not to be PI related.
-
How can One sender communication channel pick two file from two location
Hello
I have a requirement that how can One sender communication channel pick two file from two location.Both the file has same name...How to configure the one receiver communication channel.i dont have any IR,no mapping..Please help me...>
Soumitra Sinha wrote:
> Hello Vijay
> I already done the adapter specific message attribute.i am getting the file name properly.but that is nothing to do with my req.i am again clearing my problem:
> i have two folder folder a,folder b.Both has the same file credit0002. i have two destination folder i have one sender and one receiver channel.I dont have any IR.How one sender channel can pick file from two location and how one receiver channel can put in two location.please help me..
Ok now I get your requirement.
you cant achieve this - how one receiver channel can put in two location if you dont have a dynamic configuration defined i.e Adapter specific attributes.
easy way - involve IR mapping
else
have a adapter module to define your dynamic configuration.
Ref: /people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules & /people/michal.krawczyk2/blog/2006/10/09/xi-dynamic-configuration-in-adapter-modules--one-step-further
Set the dynamic directory/file name etc for your receiver adapter. -
How to create .csv file from ABAP report
Hi
We have a requirement to generate .csv file from abap report.
Currently user saves data from abap report to spreadsheet(.xls format) in desktop. Then opens excel file and save as .csv format. Need option to save directly in .csv format instead of .xls format.
Please let me know, if there is any standard function module available to create .csv file.
Regards
UmaI tried with your code it's going to dump
REPORT ZTEMP101 message-id 00.
tables: lfa1.
types: begin of t_lfa1,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
end of t_lfa1.
data: i_lfa1 type standard table of t_lfa1,
wa_lfa1 type t_lfa1.
types truxs_t_text_data(4096) type c occurs 0.
data: csv_converted_table type table of TRUXS_T_TEXT_DATA.
select-options: s_lifnr for lfa1-lifnr.
select lifnr name1 from lfa1 into table i_lfa1
where lifnr in s_lifnr.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = ';'
I_LINE_HEADER =
I_FILENAME =
I_APPL_KEEP = ' '
TABLES
I_TAB_SAP_DATA = I_LFA1
CHANGING
I_TAB_CONVERTED_DATA = csv_converted_table
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = ' '
CODEPAGE = ' '
FILENAME =
'C:\Documents and Settings\ps12\Desktop\Test folder\exl.cvs'
FILETYPE = 'DAT'
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = csv_converted_table
FIELDNAMES =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
my version is 4.6c -
Is there a way that I can bring a comma seperated file into an oracle table?
If you are using Oracle 9i and above, you may also want to consider using external tables.
http://download-west.oracle.com/docs/cd/A91202_01/901_doc/server.901/a90192/ch11.htm#1656 -
Create datastore for complex comma seperated file
I am trying to integrate a comma seperated file to an Oracle database. The files contain multiple record types each of which have different number of fields and a different order of datatypes within those fields. The order that the records types are listed in the file determines the relationship between them, e.g.
The file could contained the following record types in the order shown:
Segment
Fixture
Position
Position
Segment
Segment
Fixture
Position
Position
Position
So there is a parent-child relationship between the Segement record and the Fixture record that immediately follows it and similarly the position records are child records to the Fixture record.
How can I create datastores that represents this relationship when there is no parent field in the child record types?I dont think ODI would be able to help you much with Out of the box functionality. You will need to modify the LKM (SQLLDR) to achieve this.
The following entry illustrates the logic:
[http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7526680049479]
Hope that helps -
Comma seperated file uploading
Hi ,
i want to upload comma seperated file into sap.
iam using 'GUI_UPLOAD' fm.
problem is flat file currency field it is also contains comma.
i can't change file type comma to tab.
How can i upload currency fields with comma.
Regards,
Suresh.You can upload your file into a string table. Now split it:
split uploadtab at ',' into table items.
if you have
a,b,c,11,d,e,f
your tables items contains 7 elements now.
if you have
a,b,c,11,22,d,e,f
your table contains 8 elements now. In that case you now that you have splitted a number with a comma and need to do some actions, e.g. merge elements 4 and 5 together to get 11,22 again and shift the 6th to 5th, the 7th to 5th and the 8th to 7th element.
After that you number is again in item 4.
An easier way is to enforce you customer to put values into apostrophes or quotes. If this is not possible, you have to check if an unwanted split was taken in place and act as shown above.
But: this will work only if one item with a comma in between. If oyu have more components you can not evaulate where the unwanted split is in effect.
Maybe you are looking for
-
I am using MAC os version of elements 12 with OS 10.9.4 (the latest). When I am importing pictures from a card elements freezes consistently and needs to be voce closed. When I then restart elements it continues to bring the pictures in but this is v
-
Oracle drivers not found by servlets after upgrade of JDK
I am using jakarta-tomcat 4.0.1 with WIN2K. After a recent upgrade to jdk 1.4.0_02 from jdk1.3.1, servlets that try to use oracle crash with this error: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver at ProductLookup.loadJDBCDri
-
Week old 15in C2D MacBook Pro and just bought another battery for it. I am trying to switch batteries but I can't seem to remove the one that came with it. I have pushed on both tabs together until orange appears beneath. Somehow the battery is not p
-
WebI report - Report filters question
All, please help me in understanding if it's possible to have a report filter containing all the possibile values for the dimension it refers to, so that changing the value in this filter, the query is refreshed and shows data according to the new se
-
I have a problem, i try to display text in a JTextPane with setText() method, but randomly, the application hangs while processing that method. Debugging the code i have found that the application hangs in RepaintManager.addDirtyRegion. My applicatio