‎2009 Mar 05 12:58 PM
Hi all,
Can any one tell me how to populate the excel sheet data which is there in application server to the internal table.
Thanks in advance.
Prakash Reddy .S
‎2009 Mar 05 2:02 PM
hi,
If its app server you can use statements
OPEN DATASET
READ DATASET
CLOSE DATASET
and populate the contents into a internal table.
If its a presentation server TEXT_CONVERT_XLS_TO_SAP to populate the internal table with the data in the excel sheet.
Thanks
sharath
‎2009 Mar 06 1:59 AM
Office Integration:
ALSM_EXCEL_TO_INTERNAL_TABLE - Uploads Excel spreadsheet to internal table
EXCEL_OLE_STANDARD_DAT - Starts Excel and transfers internal table data
EXECUTE_WINWORD - Opens MS Word on the PC
KCD_EXCEL_OLE_TO_INT_CONVERT - Uploads data directly from Excel sheet
MS_EXCEL_OLE_STANDARD_DAT - Builds a file and automatically starts Excel
RH_START_EXCEL_WITH_DATA - Starts Excel with contents of an internal table
RS_SEND_MAIL_FOR_SPOOLLIST - Sends message from program to SAPoffice
SAP_CONVERT_TO_XLS_FORMAT - Downloads internal table to Excel
SO_NEW_DOCUMENT_ATT_SEND_API1 - Attaches a document to an e-mail
SO_NEW_DOCUMENT_SEND_API1 - Sends an express mail (SAPoffice)
WS_EXCEL - Starts MS Excel on the PC
‎2009 Mar 06 9:35 AM
Hi Prakash,
Sample code for your reference.
TYPE-POOLS : truxs.
DATA: w_header TYPE truxs_t_text_data.
PARAMETERS: p_filepath TYPE rlgrap-filename.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_line_header = 'X'
i_tab_raw_data = w_header
i_filename = p_filepath
TABLES
i_tab_converted_data = it_ltab[]
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
where "p_filepath" specifies the path of the excel file
"it_itab" specifies the internal table to which the excel sheet data needs to be uploaded.
‎2009 Mar 06 9:39 AM
Hi,
please see the pgm..
REPORT zexcel78 .
DATA: it_sflight TYPE sflight OCCURS 0.
DATA: file TYPE string VALUE 'Flight_details.xls'.
PARAMETERS: p_carrid TYPE sflight-carrid.
START-OF-SELECTION.
SELECT * FROM sflight
INTO TABLE it_sflight
WHERE carrid EQ p_carrid.
CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
EXPORTING
data_filename = file
data_path_flag = 'Q'
DATA_ENVIRONMENT =
data_table = it_sflight
MACRO_FILENAME =
MACRO_PATH_FLAG = 'E'
MACRO_ENVIRONMENT =
wait = 'X'
delete_file = ' '
EXCEPTIONS
no_batch = 1
excel_not_installed = 2
internal_error = 3
cancelled = 4
download_error = 5
no_authority = 6
file_not_deleted = 7
OTHERS = 8
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Hope this is helpful.
Keerthi