Application Development and Automation 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: 
Read only

Task on exporting data

Former Member
0 Likes
384

Hi all,

How to use the 'EXCEL_OLE_STANDARD_DAT'

to export the data from itab to EXCEL file.

REPORT ZT11.

data : begin of itab occurs 0,

t1(3) type c value 'sag',

t2(3) type c value 'ntc',

end of itab.

append itab.

write : itab-t1,itab-t2.

CALL FUNCTION 'GET_FIELDTAB'

  • EXPORTING

  • LANGU = SY-LANGU

  • ONLY = ' '

  • TABNAME = ' '

  • WITHTEXT = 'X'

  • IMPORTING

  • HEADER =

  • RC =

TABLES

FIELDTAB =

  • EXCEPTIONS

  • INTERNAL_ERROR = 1

  • NO_TEXTS_FOUND = 2

  • TABLE_HAS_NO_FIELDS = 3

  • TABLE_NOT_ACTIV = 4

  • OTHERS = 5

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'

EXPORTING

FILE_NAME =

  • CREATE_PIVOT = 0

  • DATA_SHEET_NAME = ' '

  • PIVOT_SHEET_NAME = ' '

  • PASSWORD = ' '

  • PASSWORD_OPTION = 0

  • TABLES

  • PIVOT_FIELD_TAB =

  • DATA_TAB =

  • 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

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
355

Hi Sathya,

data : begin of itab occurs 0,

t1(3) type c value 'sag',

t2(3) type c value 'ntc',

end of itab.

append itab.

write : itab-t1,itab-t2.

CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'

EXPORTING

<b>FILE_NAME = 'C:\DETAILS '</b>

  • CREATE_PIVOT = 0

  • DATA_SHEET_NAME = ' '

  • PIVOT_SHEET_NAME = ' '

  • PASSWORD = ' '

  • PASSWORD_OPTION = 0

<b>TABLES</b>

  • PIVOT_FIELD_TAB =

<b>DATA_TAB = ITAB[]</b>

  • 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

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

TRY WITH THIS.

Regards,

Francis .

Reward points if useful.

1 REPLY 1
Read only

Former Member
0 Likes
356

Hi Sathya,

data : begin of itab occurs 0,

t1(3) type c value 'sag',

t2(3) type c value 'ntc',

end of itab.

append itab.

write : itab-t1,itab-t2.

CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'

EXPORTING

<b>FILE_NAME = 'C:\DETAILS '</b>

  • CREATE_PIVOT = 0

  • DATA_SHEET_NAME = ' '

  • PIVOT_SHEET_NAME = ' '

  • PASSWORD = ' '

  • PASSWORD_OPTION = 0

<b>TABLES</b>

  • PIVOT_FIELD_TAB =

<b>DATA_TAB = ITAB[]</b>

  • 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

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

TRY WITH THIS.

Regards,

Francis .

Reward points if useful.