‎2008 Aug 22 6:09 AM
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.
‎2008 Aug 22 6:16 AM
Hi Bala,
Check these links for complete infromation:
http://help.sap.com/printdocu/core/print46b/en/data/en/pdf/BCABA/BCABAXXL.pdf
http://help.sap.com/saphelp_40b/helpdata/pt/b3/eba0f1542811d1895c0000e829fbbd/content.htm
Regards,
Chandra Sekhar
‎2008 Aug 22 6:34 AM
I want sample code of this Fm, Help me plz
Edited by: Bala Chandar on Aug 22, 2008 7:38 AM
‎2008 Aug 22 7:34 AM
‎2008 Aug 22 7:40 AM
Have a look at report XXLSTEST in se38. May b hepful for you...
‎2008 Aug 22 8:01 AM
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.