Hello everyone.
In custom BSP application, On click of a hyperlink field , I need to download data from different tables into single excel .
This excel should have more than one sheet(tab) with that data downloaded, see attached image.
I am able to download data in single sheet(Tab), but don't know approach how to download/create data in another tab of same excel.
I am using CRM 2007: download HTML file from Web UI | SCN approach but not smartform.
CONCATENATE
header
Year'
cl_abap_char_utilities=>horizontal_tab
_Type'
cl_abap_char_utilities=>horizontal_tab
'Company_Name'
cl_abap_char_utilities=>horizontal_tab
'Company_id
cl_abap_char_utilities=>horizontal_tab
'Company_Address'
cl_abap_char_utilities=>horizontal_tab
'Company_Email_ID'
cl_abap_char_utilities=>horizontal_tab
'Signatory_Name'
cl_abap_char_utilities=>horizontal_tab
ID'
cl_abap_char_utilities=>horizontal_tab
Address'
cl_abap_char_utilities=>horizontal_tab
Email_ID'
cl_abap_char_utilities=>horizontal_tab
'Responsible_text'
cl_abap_char_utilities=>horizontal_tab
'Date_of_Appointment'
cl_abap_char_utilities=>horizontal_tab
'Date_Of_Resignation'
cl_abap_char_utilities=>cr_lf
INTO header SEPARATED BY space.
.
LOOP AT lt_indscn_ar INTO ls_indscn_ar.
CONCATENATE
output
ls_bo_dflt_scn-date
cl_abap_char_utilities=>horizontal_tab
ls_zmca_blk_scn_gent_type
cl_abap_char_utilities=>horizontal_tab
ls_bo_dflt_scn-comp_name
cl_abap_char_utilities=>horizontal_tab
ls_bo_dflt_id -id
cl_abap_char_utilities=>horizontal_tab
ls_bo_dflt_scn-comp_address
cl_abap_char_utilities=>horizontal_tab
ls_bo_dflt_scn-comp_email
cl_abap_char_utilities=>horizontal_tab
ls_indscn_arname
cl_abap_char_utilities=>horizontal_tab
ls_indscn_-pan_id
cl_abap_char_utilities=>horizontal_tab
ls_indscn_-address
cl_abap_char_utilities=>horizontal_tab
ls_indscn_-email_address
cl_abap_char_utilities=>horizontal_tab
ls_indscn_-email_address
cl_abap_char_utilities=>horizontal_tab
ls_indscn_-date_of_appoint
cl_abap_char_utilities=>horizontal_tab
ls_indscn_-date_of_resignat
cl_abap_char_utilities=>cr_lf
INTO output SEPARATED BY space.
ENDLOOP.
ENDIF.
ENDLOOP.
ENDIF.
CONCATENATE
header
output
INTO output
SEPARATED BY space.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = output
mimetype = 'APPLICATION/MSEXCEL;charset=utf-16le'
IMPORTING
buffer = l_xstring.
CONCATENATE
cl_abap_char_utilities=>byte_order_mark_little
l_xstring INTO l_xstring
IN BYTE MODE.
lv_content_type = 'text/csv; charset=UTF-16'.
ir_server->response->set_header_field( name = 'Content-Disposition' value = 'attachment; filename=export.csv').
ir_server->response->set_header_field( name = 'Content-Type' value = lv_content_type ).
ir_server->response->set_header_field( name = 'expires' value = '0' ).
ir_server->response->set_data( data = l_xstring ).
ENDIF.
please let me know if you have any idea/suggestions.
Regards,
Harish Kumar.