on 09-23-2008 1:43 PM
Hi,
I am getting the error "Could not ascertain code page" when i try to call my BAPI (to export to excel sheet) on click of a custom button in ALV.
I have done the creation and event handling etc for the custom button.
Kindly help if anybody knows this error.
Thanks
Roshan
Hi Roshan,
I am also getting same error message.
Error "Could not ascertain code page".
If you able solve this error message can you tell me
How to solve this error message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually I am passing a single value and fetching different records from tables based on that value. So the importing parameter is a variable and the BAPI fetches all the records which it saves in an excel sheet.
Hope it is clear to you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Suman....
But u r mistaken because both the i_methcode and lv_methcode are simple variable types.
They are neither internal tables nor structures.
So that is not the problem for sure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thats because i need to download the data into a specific format(tree structure) different from what the standard export provides.
Plz solve it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Roshan,
You are doing mistake here....
i_methcode is internal table in exporting parameter.But you are assignning structure to it thats why you are getting error.
call function 'ZBAPI_EXCEL_DLOAD_METHODOLOGY'
exporting
i_methcode = lv_methcode
tables
et_return = lt_return
.
get_attribute will return only structure.If you want to return the entire table data to internal table.you can do in this way...
data:
node_sflight type ref to if_wd_context_node,
elem_sflight type ref to if_wd_context_element,
lt_elements type WDR_CONTEXT_ELEMENT_SET,
stru_sflight type if_main=>element_sflight_node,
it_flights type if_main=>elements_sflight_node.
navigate from <CONTEXT> to <SFLIGHT_NODE> via lead selection
node_sflight_node = wd_context->get_child_node( name = ' FLIGHTS' ).
get element via lead selection
elem_sflight_node = node_sflight_node->get_element( ).
lt_elements = node_sflight->get_elements( ).
get all declared attributes
loop at lt_elements into elem_sflight.
elem_sflight->get_static_attributes(
importing
static_attributes = stru_sflight ).
append stru_sflight to it_flights.
endloop.
Now you have table data in the internal table it_flights.
( or )
data: node_flights type ref to if_wd_context_node,
it_flights type if_main=>elements_sflight_node.
node_sflight->get_static_attributes_table(
EXPORTING
FROM = 1
TO = 2147483647
IMPORTING
TABLE = TABLE
).
Thanks
Suman
Hello Roshan,
Why don you use the standard functionality for downloading the data to Excel from ALV Table ?
Regards
Vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am creating a custom export button(after disabling the standard export button) to download the data into an excel sheet in my own format. I have created the new button. The code is given here.
data lr_buttonui2 type ref to cl_salv_wd_fe_button.
data input2 type ref to cl_salv_wd_function.
data: lr_column_settings type ref to if_salv_wd_column_settings,
lr_input_field type ref to cl_salv_wd_uie_input_field.
create object lr_buttonui2.
call method lr_buttonui2->set_text
exporting
value = 'Export'
.
input2 = lo_value->if_salv_wd_function_settings~create_function( id = 'EXPORT' ).
input2->set_editor( lr_buttonui2 ).
data lr_ref3 type ref to cl_salv_wd_fe.
call method input2->get_editor
receiving
value = lr_ref3
I have also created the event handler for my button and written the below code thr. I am caling a BAPI to download the data into my excel format. The problem is coming here only.
data: lt_return type table of bapiret2.
data lo_nd_methcode type ref to if_wd_context_node.
data lo_el_methcode type ref to if_wd_context_element.
data ls_methcode type wd_this->element_methcode.
data lv_methcode like ls_methcode-methcode.
navigate from <CONTEXT> to <METHCODE> via lead selection
lo_nd_methcode = wd_context->get_child_node( name = wd_this->wdctx_methcode ).
get element via lead selection
lo_el_methcode = lo_nd_methcode->get_element( ).
get single attribute
lo_el_methcode->get_attribute(
exporting
name = `METHCODE`
importing
value = lv_methcode ).
call function 'ZBAPI_EXCEL_DLOAD_METHODOLOGY'
exporting
i_methcode = lv_methcode
tables
et_return = lt_return
.
Plz give me a solution
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you post your code here and also tell me why you are calling BAPI.
thanks
Suman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.