Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

MS_EXCEL_OLE_STANDARD_DAT field names

Hi all,

I'm confused about the fieldnames parameter of the above mentioned function call. I want to create a tabel of field names to pass in. Say...MATERIAL...PLANT...TEXT. i figured I could just do the following:

TYPES: BEGIN OF t_fieldNames,

fieldName TYPE C,

END OF t_fieldNames.

DATA: it_fieldNames TYPE STANDARD TABLE OF t_fieldNames INITIAL SIZE 0.

DATA: wa_fieldNames TYPE t_fieldNames.

wa_fieldNames-fieldName = 'Plant'.

APPEND wa_fieldNames TO it_fieldNames.

wa_fieldNames-fieldName = 'Material'.

APPEND wa_fieldNames TO it_fieldNames.

...and pass it_fieldNames in. But, I get the following error on execution:

The current statement is defined for character-type data objects only.

Following is the call:

CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'

EXPORTING

FILE_NAME = 'c:\TEMP\NO_EST_REPORT'

TABLES

DATA_TAB = gt_mkal_y

FIELDNAMES = it_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.

any ideas?

regards,

Mat

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question