02-15-2007 3:47 AM
Dear All ,
I have put my Excel file which needs to be uploaded by using bdc . How do I Read The excel file from Application server .
02-15-2007 4:00 AM
Balmurugan,
Pls. use below FM...
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = filename
i_begin_col = '1'
i_begin_row = '1'
i_end_col = '200'
i_end_row = '5000'
TABLES
intern = meta_xl_itab.
Pls. mark if useful
02-15-2007 4:06 AM
Hi,
REPORT zztest.
DATA : filename LIKE dxfields-longpath.
DATA : BEGIN OF itab OCCURS 0,
a(200) TYPE c,
END OF itab.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
i_location_flag = 'A'
I_SERVER = '?'
I_PATH =
<b>filemask = '*.xls'</b>
FILEOPERATION = 'R'
IMPORTING
O_LOCATION_FLAG =
O_SERVER =
o_path = filename
ABEND_FLAG =
EXCEPTIONS
rfc_error = 1
error_with_gui = 2
OTHERS = 3.
OPEN DATASET filename FOR INPUT IN BINARY MODE.
WHILE sy-subrc = 0.
CLEAR itab .
READ DATASET filename INTO itab.
APPEND itab.
ENDWHILE.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'd:\abc.xls'
filetype = 'BIN'
TABLES
data_tab = itab.
Refer these threads:
Regards,
Priyanka.
02-15-2007 9:03 AM
Hi,
Use dataset operations for taking data from appln server.
for ex use various opns like open dataset...
read datset...
clsoe dataset
02-16-2007 3:52 AM
Bala,
Use CG3Y transaction.Kindly let me know in what way it benefitted.
K.Kiran.
02-16-2007 5:05 AM
Hi
Use the below code:
OPEN DATASET g_file FOR INPUT IN TEXT MODE ENCODING DEFAULT
IF SY-SUBRC EQ 0.
DO.
READ DATASET g_file INTO FILE.
if sy-subrc = 0.
split FILE at ',' into itab.(created in ur program with ur required fields)
endif.
Regards,
kumar
02-16-2007 9:56 AM
Use open datataset, read dataset to read the file from application server.
02-16-2007 9:59 AM
first use CG3Y to download data from application server to presentation server...
then use...
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = filename
i_begin_col = '1'
i_begin_row = '1'
i_end_col = '200'
i_end_row = '5000'
TABLES
intern = meta_xl_itab.
to upload data and use it in BDC...
02-17-2007 3:43 AM
Hi Bala,
Is your requirement to download the file from Application server to your desktop and then do a BDC where you will specify the file path. Not you cannot pass the Internal Table in BDC, if its something like a popup where u specify ur file path then you can follow this.
There are 2 steps for this :
1) Read the file form Application Server to a local PC
Read from App server to INternal Table
OPEN DATASET fp_path FOR INPUT IN BINARY MODE.
IF sy-subrc EQ 0.
DO.
READ DATASET fp_path INTO t_doc_content.
IF sy-subrc EQ 0.
APPEND t_doc_content.
CLEAR t_doc_content.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET fp_path.
ENDIF.
Internal Table to local PC
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = 'c:text.xls'
CHANGING
data_tab = t_doc_content[]
2) In the BDC recording specify the file path.
<b>AS</b>