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

excel sheet data from application server to internal table

Former Member
0 Likes
561

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

4 REPLIES 4
Read only

Former Member
0 Likes
530

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

Read only

former_member156446
Active Contributor
0 Likes
530

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

Read only

Former Member
0 Likes
530

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.

Read only

keerthy_k
Product and Topic Expert
Product and Topic Expert
0 Likes
530

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