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

Sample code for XXL_SIMPLE_API FM

Former Member
0 Likes
2,204

Hi All,

Can anybody send me sample code for " XXL_SIMPLE_API" function module how to use this in our program to download internal table data to excel sheet.

Balu.

5 REPLIES 5
Read only

Former Member
Read only

Former Member
0 Likes
1,049

I want sample code of this Fm, Help me plz

Edited by: Bala Chandar on Aug 22, 2008 7:38 AM

Read only

Former Member
0 Likes
1,049

Any body help me in this....

Read only

Former Member
0 Likes
1,049

Have a look at report XXLSTEST in se38. May b hepful for you...

Read only

Former Member
0 Likes
1,049

I have below code and tested it, its working fine, but one proble m is there.

I have given C:\test.xls path in variable w_file and passed in exporting paramete filename. But if we execute its not going to specified path, then it directly asking to save.

can anybody help me in this.

REPORT Z_EXCEL_FORMAT.

types: begin of tp_marc,

matnr type matnr,

werks type werks_d,

end of tp_marc.

data: t_head type standard table of GXXLT_V,

wa_head like line of t_head,

t_tab1 type standard table of GXXLT_o,

t_tab2 type standard table of GXXLT_p,

t_marc type standard table of tp_marc,

w_file type GXXLD_FILE.

select matnr

werks

into table t_marc

from marc

where werks = '4012'.

clear wa_head.

wa_head-COL_NO = 1.

wa_head-COL_NAME = 'Material No.'.

append wa_head to t_head.

clear wa_head.

wa_head-COL_NO = 2.

wa_head-COL_NAME = 'Plant'.

append wa_head to t_head.

clear wa_head.

w_file = 'C:\test.xls'.

CALL FUNCTION 'XXL_SIMPLE_API'

EXPORTING

FILENAME = w_file

HEADER = space

N_KEY_COLS = 1

TABLES

col_text = t_head

data = t_marc

online_text = t_tab1

print_text = t_tab2

EXCEPTIONS

DIM_MISMATCH_DATA = 1

FILE_OPEN_ERROR = 2

FILE_WRITE_ERROR = 3

INV_WINSYS = 4

INV_XXL = 5

OTHERS = 6

.

IF sy-subrc 0.

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

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

ENDIF.