cancel
Showing results for 
Search instead for 
Did you mean: 

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

harish2
Explorer
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

harish2
Explorer
0 Kudos

If any solution please let me know ...

How we  can show data from the first column ...

Thanks,

Harish .K