Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

convert to .CSV format

Former Member
0 Kudos

Hi,

I am working on a report in BW.

Can any one tell me, is there any function module in BW to convert the file to .CSV(comma separated file).

I can use SAP_CONVERT_TO_TEXT_FORMAT, but this is not available in BW.

2 REPLIES 2

venkat_o
Active Contributor
0 Kudos

Hi, Try this way to prepare comma separated file.


DATA :BEGIN OF it_marc OCCURS 0,
                werks TYPE marc-werks,
                lgort TYPE marc-lgort,
                matnr TYPE marc-matnr,
           END OF it_marc.
DATA :BEGIN OF it_data OCCURS 0,
             data TYPE string,
           END OF it_data.
DATA:g_separator TYPE C VALUE ','.
START-OF-SELECTION.
SELECT * FROM marc INTO CORRESPONDING FIELDS OF TABLE it_marc up to 100 rows.
LOOP AT it_marc.
  CONCATENATE it_marc-werks it_marc-lgort  it_marc-matnr INTO it_data-data SEPARATED BY g_separator.
  APPEND it_data.
  CLEAR  it_data.
ENDLOOP.
"Now it_data table contains data which is separated by comma. You do not need always function module.
I hope that it helps you. Thanks Venkat.O

Former Member
0 Kudos

hi naga,

have you searched SCN for this? each day we get some post regarding this. Please find your answer from them.