‎2010 Feb 02 5:52 PM
Hello everyone,
I'm trying to download data from internal table using this function but i get the following dump: UC_OBJECTS_NOT_CHAR
I believe this is because i have a column in my table that's decimals type. All fileds must be c or string types so the function can work successfully?
Here's a sample of my code, what am i doing wrong?
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code. (You posted a number of lines that wre commented out.)
Thanks in advance.
Edited by: Rob Burbank on Feb 2, 2010 1:12 PM
‎2010 Feb 02 6:01 PM
Hi,
WZEIT is of type DEC3. Could you check this field. Move it to character field and try.
Regards,
San
‎2010 Feb 02 6:01 PM
Hi,
WZEIT is of type DEC3. Could you check this field. Move it to character field and try.
Regards,
San
‎2010 Feb 02 7:03 PM
Hi Sandeep, thanks for your answer but I've already tried changing the character type to C and it doesn't work!!
I changed the ty_header structure field wzeit to c length 3 and i get the same dump....=|
‎2010 Feb 02 7:35 PM
‎2010 Feb 03 12:54 PM
WHILE sy-subrc EQ 0.
cnt = cnt + 1.
ASSIGN COMPONENT cnt OF STRUCTURE <data_tab_wa> TO <field>.
CHECK sy-subrc EQ 0.
READ TABLE fieldnames INDEX cnt ASSIGNING <fieldname>.
IF sy-subrc EQ 0.
<field> = <fieldname>.
ELSE.
sy-subrc = 0.
*>>>>>>>>>>>>>>>> WRITE cnt TO <field> LEFT-JUSTIFIED.*
ENDIF.
ENDWHILE.
the dump shows the problem on the bold line.
I know it's because of the "marc-wzeit" character type which is DEC3, but in this case what should I do? Changing the type for 'C' doesn't work.
Shouldn't this function work for all character types?
Thanks
‎2010 Feb 03 1:24 PM
Hi thanks for the help to everyone
I found a solution, I created another internal table with type c fields which is it_saida_aux.
All I had to was to loop the it_saida table (with fields standard table fields type) and move the data to it_saida_aux table.
‎2010 Feb 02 7:49 PM
I just wrote sample program as below, and working fine.
REPORT YSAT_020210_TEST1.
tables: rlgrap.
PARAMETERS: pathfile like rlgrap-filename.
data: begin of excel_down_wa,
col1(8) type c,
col2(40) type c,
col3(5) type c,
col4(10) type c,
col5(20) type c,
col6(10) type c,
col7(10) type c,
col8(10) type c,
col9(10) type c,
* begin note 686989
col10(10) type c,
col11(10) type c,
* end note 686989
end of excel_down_wa,
excel_down like excel_down_wa occurs 0.
CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
EXPORTING
FILE_NAME = pathfile
* CREATE_PIVOT = 0
* DATA_SHEET_NAME = ' '
* PIVOT_SHEET_NAME = ' '
* PASSWORD = ' '
* PASSWORD_OPTION = 0
TABLES
* PIVOT_FIELD_TAB =
DATA_TAB = excel_down
* FIELDNAMES =
EXCEPTIONS
FILE_NOT_EXIST = 1
FILENAME_EXPECTED = 2
COMMUNICATION_ERROR = 3
OLE_OBJECT_METHOD_ERROR = 4
OLE_OBJECT_PROPERTY_ERROR = 5
INVALID_PIVOT_FIELDS = 6
DOWNLOAD_PROBLEM = 7
OTHERS = 8.