Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Internal Table to xls Attachment cl bcs?

$
0
0

Hy folks i'm facing an issue while converting an internal table to excel using cl_bcs (to send as attachment.

After the first row, the first column wouldn't be fill again.

i can't figure out why.

this is my piece of code.

LOOP AT lt_kdmat INTO ls_kdmat.

DO.

ASSIGN COMPONENT sy-index OF STRUCTURE ls_kdmat TO <lv_field>.

IF sy-subrc EQ 0.

IF lv_string IS INITIAL.

WRITE <lv_field> TO lv_string_field.

lv_string = lv_string_field.

ELSE.

WRITE <lv_field> TO lv_string_field.

CONCATENATE lv_string gc_tab lv_string_field INTO lv_string.

ENDIF.

ELSE.

CONCATENATE lv_string gc_crlf INTO lv_string.

EXIT.

ENDIF.

ENDDO.

ENDLOOP.

 

TRY.

CALL METHOD cl_bcs_convert=>string_to_solix

EXPORTING

iv_string = lv_string

* iv_codepage = '4103'

* iv_add_bom =

IMPORTING

et_solix = gt_binary_data

ev_size = gw_doc_len. 

CATCH cx_bcs .

MESSAGE 'Error when transfering document contents' TYPE 'E'.

ENDTRY.

 

What do i miss?


Viewing all articles
Browse latest Browse all 8332

Trending Articles



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