2004 Oct 18 1:27 PM
Hi @ ALL,
i am using a Code from another topic here in the forum ()
There is a solution but it is not working correct and i dont knwo why`??? The error message says this: ""The type of the database table and work area (or internal table) "WB_TAB" are not Unicode convertible."!"
Does anyone knows whats wrong?
Here is the Code:
If WBID is initial.
Select * from RSRWBINDEXT into table WB_TABLE
where OBJVERS = 'A' and LANGU = 'E'.
Sort WB_TABLE by TITLE.
ENDIF.
19. Select OnInputProcessing from the drop down list.
20. Copy the following code into the OnInputProcessing area:
event handler for checking and processing user input and
for defining navigation
CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
DATA: tv type ref to CL_HTMLB_TABLEVIEW,
table_event type ref to CL_HTMLB_EVENT_TABLEVIEW.
DATA event TYPE REF TO IF_HTMLB_DATA.
event = CL_HTMLB_MANAGER=>get_event_ex( request ).
Case event->event_server_name.
when 'go'.
tv ?= CL_HTMLB_MANAGER=>GET_DATA( request = request
name = 'tableView'
id = 'tvX' ).
IF tv IS NOT INITIAL.
table_event = tv->data.
selectedRowIndex = table_event->SELECTEDROWINDEX.
*launch the workbook
DATA: wb_tab TYPE ZBINARY_table,
wb_line LIKE LINE OF wb_tab,
output TYPE string.
DATA: response TYPE REF TO if_http_response.
read table WB_TABLE index selectedRowIndex into WB.
WBID = WB-WORKBOOKID.
SELECT * FROM rsrwbstore INTO TABLE wb_tab
WHERE WORKBOOKID = WBID.
LOOP AT wb_tab INTO wb_line.
data: file_data type string.
file_data = wb_line-clustd.
CONCATENATE output
file_data
INTO output.
ENDLOOP.
file_mime_type = 'application/vnd.ms-excel'.
file_length = XSTRLEN( file_content ).
file_content = output.
response = runtime->server->response.
response->set_data( file_content ).
response->set_header_field( name = if_http_header_fields=>content_type
value = file_mime_type ).
response->delete_header_field( name =
if_http_header_fields=>cache_control ).
response->delete_header_field( name = if_http_header_fields=>expires ).
response->delete_header_field( name = if_http_header_fields=>pragma ).
response->set_header_field( name = 'content-disposition' value =
'attachment;filename=webform.xls' ).
navigation->response_complete( ). " signal that response is complete
RETURN.
ENDIF.
Regards,
M. Erbil
2004 Oct 18 5:32 PM
You should be able to go to attributes and 'unclick' unicode. This should resolve the issue.
2004 Oct 18 5:32 PM
You should be able to go to attributes and 'unclick' unicode. This should resolve the issue.
2004 Oct 18 5:55 PM
Hello Erbil,
most probably the structure of database table and internal table differ somehow. Most likely one contains numberlike fields and the other one characterlike fields. In former times ABAP did an automatic conversion. But for Unicode enabled programs this is not possible.
If the structures have similar names I would suggest to use a select like
select * from <db> into corresponding fields of <itab> ....
If the names are not similar you may use dedicated assignments.
Best Regards
Klaus
2004 Oct 18 7:29 PM
Hi Krista,
i cant find this setting?
Do you know where?
Regards,
M. erbil
2004 Oct 18 8:49 PM
Hello,
look at the Weblog: <a href="/people/horst.keller/blog/2004/10/18/abap-geek-1--abap-program-attributes">ABAP Geek 1 - ABAP Program Attributes</a>.
Regards
Gregor