10-31-2007 3:32 AM
10-31-2007 3:37 AM
Hi,
First use FM ALSM_EXCEL_TO_INTERNAL_TABLE to upload the same in internal table and then from internal table upload to Z table.
Regards,
Atish
10-31-2007 3:37 AM
Hi,
First use FM ALSM_EXCEL_TO_INTERNAL_TABLE to upload the same in internal table and then from internal table upload to Z table.
Regards,
Atish
10-31-2007 3:37 AM
Hi Vibhuti ,
It can be done in 2 steps .
1. Read the excel into an internal table , using the FM ALSM_EXCEL_TO_INTERNAL_TABLE
2. Insert the data in the internal table into the transparent table using modify command.
Regards
Arun
10-31-2007 3:38 AM
Hi,
You can write a custom program to upload the file and update data to a custom table.
Use function module ALSM_EXCEL_TO_INTERNAL_TABLE to get data from Excel file to internal table.
ashish
10-31-2007 3:39 AM
Hi,
Try the function module "ALSM_EXCEL_TO_INTERNAL_TABLE".
TEXT_CONVERT_XLS_TO_SAP
KCD_EXCEL_OLE_TO_INT_CONVERT
GUI_UPLOAD
Regards,
Ruthra
10-31-2007 4:25 AM
hi,
for this first u have to create a internal table like ztable and upload data from local file to internal table and from internal table to ztable.
for uploading data from local file to internal table u can use following fm's.
1. GUI_UPLOAD
2. WS_UPLOAD
3. UPLOAD
then using INESRT LINES OF statement are UPDATE ST transfer all records from internal table to ztable.
if helpful reward some points.
with regards,
Suresh Aluri.
10-31-2007 4:37 AM
Hi,
<u>use the following code:</u>
REPORT zvexceltodbms .
TABLES : zvresult.
TYPE-POOLS: truxs.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: filename TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK b1.
TYPES: BEGIN OF t_datatab,
empid LIKE zvresult-empid,
bitsid LIKE zvresult-bitsid,
name LIKE zvresult-name,
maths LIKE zvresult-maths,
sp LIKE zvresult-sp,
de LIKE zvresult-de,
mgmt LIKE zvresult-mgmt,
total LIKE zvresult-total,
avrg LIKE zvresult-avrg,
END OF t_datatab.
DATA: itab TYPE STANDARD TABLE OF t_datatab WITH HEADER LINE,
seltab TYPE STANDARD TABLE OF t_datatab WITH HEADER LINE.
DATA: it_raw TYPE truxs_t_text_data.
At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = filename.
***********************************************************************
*START-OF-SELECTION.
START-OF-SELECTION.
IF filename IS NOT INITIAL.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = filename
TABLES
i_tab_converted_data = itab[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ELSE.
MESSAGE s001(zmsgclass).
ENDIF.
***********************************************************************
END-OF-SELECTION.
END-OF-SELECTION.