Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

problem while down loading data into Excel

Former Member
0 Kudos

Hi friend's,

I am getting a error while down loading header

internal table to excel.

since in my header internal table there is no p

type field..but i am getting this error..

-


Only flat, character-type data objects are supported at the argument

position "dest" for the statement

"WRITE src TO dest".

In this case, the operand "dest" has the non-character-type or deep type

"P". The current program is flagged as a Unicode program. In the Unicode

context, type X fields are seen as non-character-type, as are

structures that contain non-character-type components.

-


i have coded like this

REPORT ZACG_CCA_EXCEL .

Tables : zacg_cca.

data: P_file like RLGRAP-FILENAME.

Data: Begin of it_header occurs 0,

ccode(10) ,

mat_cd(12) ,

ingr_desc(30),

con(10),

quan(10),

percqty(10),

DATE(10),

rsamnos(10),

flag(5),

end of it_header.

Data : begin of it_final occurs 0,

ccode type zacg_cca-ccode,

mat_cd type zacg_cca-mat_cd,

ingr_desc type zacg_cca-ingr_desc,

conc type zacg_cca-conc,

quantity type zacg_cca-quantity,

percqty type zacg_cca-percqty,

APP_DATE type zacg_cca-app_date,

rsamnos type zacg_cca-rsamnos,

flag ,

end of it_final.

SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text-000.

select-options : s_Date for zacg_cca-app_date.

SELECTION-SCREEN : END OF BLOCK blk.

it_header-ccode = 'Samp_code'.

it_header-mat_cd = 'Mat_code'.

it_header-ingr_desc = 'Ingr_Desc'.

it_header-con = 'Conc'.

it_header-quan = 'Quantity'.

it_header-percqty = 'Perc'.

it_header-date = 'Date'.

it_header-rsamnos = 'Rsamnos'.

it_header-flag = 'Flag'.

Append it_header.

select ccode mat_cd ingr_desc conc quantity percqty

app_date rsamnos from zacg_cca into corresponding

fields of table

it_final where zacg_cca~app_date in s_date.

loop at it_final.

it_final-flag = 'T'.

modify it_final.

it_final-quantity = it_final-quantity * 2 .

Modify it_final.

endloop.

CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'

EXPORTING

FILE_NAME = 'C:\amol\p_file'

  • CREATE_PIVOT = 0

  • DATA_SHEET_NAME = ' '

  • PIVOT_SHEET_NAME = ' '

  • PASSWORD = ' '

  • PASSWORD_OPTION = 0

TABLES

  • PIVOT_FIELD_TAB =

DATA_TAB = it_final

  • FIELDNAMES = it_header

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

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

can any one....

1 REPLY 1

Former Member
0 Kudos

hii

for title this FM have some restriction as it can not take value if its more then 10 length so you need to give length as 10 only for every string then append it with FIELDNAMES = it_header

regards

twinkal