Application Development 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: 

i hav data in excel how to upload the data in Ztable

former_member1349771
Participant
0 Kudos

i hav data in excel how to upload the data in Ztable

Plz guide

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

vaibhav_tiwari
Contributor
0 Kudos

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.