Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8212

my concern is I am able to download the data in CSV file format in webdynpro but first column is getting blank

$
0
0

Hi Friends ,

 

In my current project we are suppose to download the data from internal table to CSV file format excel(xls and xlsx are not allowed).

 

my concern is I am able to download the data but first column is getting blank .

 

for your information i am adding the sample code .

 

 

  data : str type string,

            xstr type xstring.

  do 3 TIMES.
  CONCATENATE str  'singh2' 'singh2' cl_abap_char_utilities=>newline    INTO str  SEPARATED BY  ','.
  ENDDO.

 

      CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
      text  = str
     
    IMPORTING
      buffer = xstr.

  CALL METHOD cl_wd_runtime_services=>attach_file_to_response
    EXPORTING
      i_filename      = 'Dashboard.csv'
      i_content      = xstr
      i_mime_type    = 'TEXT/CSV'
      i_in_new_window = abap_false
      i_inplace      = abap_false.

 

my concern is i am able to download in CSV file but first column is gertting blank.

 

 

output
--------------------------

col1  col2     col3      col4

       singh2   singh2

       singh2   singh2

       singh2   singh2

 

expexcted output

--------------------------

 

col1       col2     col3      col4

singh2   singh2

singh2   singh2

singh2   singh2

 

output should start from column 1 but it is starting from column 2 leaving column1 blank.

 

 

kindly let me know if nay solution is there

 

Thanks,

Harish Singh.


Viewing all articles
Browse latest Browse all 8212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>