How to create .csv file from ABAP report

Advertisement

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
Uma

Advertisement

I 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

November 30, -0001

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 o

Stored Proc to create .csv file from table

Hi all, I have a table with 4 columns and 10 rows. Now I need a stored proc to create a .csv file from the table data. Here the scripts to create a table and insert the row's. Create table emp(emp_id number(10), emp_name varchar2(20), department varc

How to create xml file from original

I have this complicated xml and I want to search through it and make a new xml with only element I find that match. what is the best way to do this? the file is about 6mb and I want to read the whole file easily..should i load to database table and c

How to create MUSE file from existing MUSE site?

Hi- A customer has a site that was created with MUSE and she wants some edits made to it. I have installed MUSE and can access the server via FTP. I've downloaded the site's html files and assets, but these are useless in MUSE. How do I create or get

How to create xml file from relational tables in 10gR2

Hi, I am very new to XML and was wondering how to create an XML file from querying relational tables. Some child tables may contain multiple rows that need to be returned in certain instances. Other queries will just be single or multiple rows from o

How to Run Batch files from inside Reports.

Hi All, I have 2 questions. 1) How to change the direction of the reports with Arabic orientation i.e Right to left Change without changing the registry. 2) How to execute a batch file from report or before execution of the report i.e before opening

How to Create PDF files from XSL-Fo

Hi all, I have in my KM content many XML files, and I want to export the content to PDF. Hi have the XSLT file, but some one could help me how to integrate this with FOP? Thank youHi Joao,                 Verify these links hope it may helps... http:

How to create POPUP windows (from ALV report)

Hi there, I have a ALV report which has a field where the user can click and view more details of the selected data. I would like to have a popup and then display the selected data...is that possible? Any function module which I can use to pop up a w

Creating PDF Files from Microsoft Office | Learn Acrobat X | Adobe TV

This video explains how to create PDF files from Microsoft Office products including Office 2010 in Acrobat X Std. or Pro. http://adobe.ly/w5Vsg9I have used Print to PDF from the File Menu in Office many times. Normally it works fine, but for whateve

How to create pdf files in UNIX directory from oracle reports

I would like to know how to create pdf files in UNIX directory from oracle reports. Thanks,Please make your question more clear . Also mention the reports version. 1) If you are runnning reports in Unix, you can give .... destype=file desformat=pdf d

Print html file with barcode from abap report

hi i am printing html file from abap program using gui_execute. i am using netscape.exe , its printing first time and when reprint its not working basically html file contains gif file which has fedex barcode. could you please let me know how to prin

Just bought a new macbook w/ mtn lion. transferred data from my old macbook over n it created another user name. that's actually good--xcept for music, which i want on my new acct. How do i move files from my "old comp" acct to my new one?

i just bought a new macbook w/ mtn lion. when i transferred data from my old macbook over, it created another user name (i called it "old computer"). That's actually good--I'm not going to be accessing old files frequently--except for music, whi

How to send a file from FTP to external server

My requirement is to send a file from FTP to D3(External) server. Now I am able to store the file in Appln server. I want to send the file created by the program thru FTP to D3 server. I know the username,Password,HostID,RFC destination details. How

IP - Is it possible to call exit planning function from ABAP Report..

Hi All, Greetings. Is it possible to call exit planning function from ABAP Report (t-code SE38) ? Or I mean is not limited only to be called from ABAP Report, perhaps from BSP / Web-Dynpro / Function Module. If somebody here has been doing it before,

How to delete a  file from AL11??????

Hi Friends, how can i delete a file from AL11 directory.... i have found FM's like EPS_DELETE_FILE, EDI_PORT_DELETE_FILE and some more from SAP system but those are not deleting the files.... let me know if i can write a program for this and if yes t

How to use csv files in OWB

Hi Experts I have one UNIX server and i my user is putting the csv files on windows machine. I want 1. If User put some new csv file in windows machine it should automatically reflect in UNIX machine. 2. If user enter some data in windows csv files t

Calling custom Infotype method from ABAP report

Hi Experts, I am working on an application where i need to call a method of a custom defined infotype. I have done this --> 1. Create a custom infotype 9111 2. SAP creates a class of that infotype ZCL_HRPA_INFOTYPE_9111 3. Inside this method there ar

How do I export file from photoshop CC?

How do I export file from Photoshop CCGood day! Export what as which file format? • jpg, png, gif can be created with File > Save for Web, • jpg, png, gif, tif, psd, psb, eps, - with File > Save As (check »As a Copy« if needed), • some video formats

How to save CSV file in application server while making infospoke

How to save CSV file in application server to be used as destination while making infospoke. Please give the steps.........Hi If you want to load your flatfile from Application server,then you need to trasfer your file from your desktop(Computer) to

Howto make created folders/ files from one teacher, read only for other teachers?

Hello there, as an admin @ school I was wondering how to make created folders/ files from one teacher, read only for other teachers?  - In a 2008domain, created a group "teachers"  - created a folder "teacher data" where all teachers h