You are on page 1of 2

3/20/2021 SAPTechnical.

COM - Uploading an excel file

Search

Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us

SAP Virtual/Onsite Uploading an excel file


Trainings By Deepika

For our demo purpose, we have created the following database table:
Tips Categories:

ABAPTM
ABAP-HR
ALE & IDocs
BAPI
BASIS
LSMW
SAP Script/Smart Forms
SAP® Workflow
Userexits/BADIs
XI
Others

Contribute?

What's New?
In our demo, we would upload an excel file from the presentation server and insert those records
Download ABAP Code into PDF
file
into the above database table.
Create Transport Request using
Function Module Following is the excel file structure:
Creating radio buttons on popup
window
Enable or disable a parameter
based on other parameter's value
How to restrict other users from
editing a program?
Skip transaction in LSMW
How to make a table field to store
a lowercase value?
Increase maximum number of
SAP sessions per user
Manually push an email from
SAP Outbox using SOST
Where the history of Transaction
Codes does get stored?
Enable, disable and delete input
history
Comparing two SAP script forms
Consistency check for SAP
Script forms and styles
HTML Viewer of SAP Script texts
Uploading image without any Program to upload the excel file:
distortion from original image
Increasing number of display In our program, we would use the function module “TEXT_CONVERT_XLS_TO_SAP” to upload an
pages in spool request excel file.
Unlocking the transport
request/task REPORT ZEXCEL_UPLOAD.
Creating ZIP file on
UNIX/Application server TYPE-POOLS truxs.
Forwarding spool request to your
inbox TABLES : zscarr.
Converting Smart form output in
to List Display in 1 step * Selection screen
Including all objects of a package
in the transport request PARAMETER p_file TYPE rlgrap-filename DEFAULT 'C:\TEST.xls'.

TYPES:
BEGIN OF t_tab,
What's Hot? carrid TYPE zscarr-carrid,
seats TYPE zscarr-total_seats,
Web Dynpro for ABAP Tutorials END OF t_tab.

DATA :
Join the Mailing List t_upload TYPE STANDARD TABLE OF t_tab,
wa_upload TYPE t_tab,
Enter name and email address below: it_type TYPE truxs_t_text_data.
Name:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

Email: CALL FUNCTION 'F4_FILENAME'


EXPORTING
* PROGRAM_NAME = SYST-CPROG
Subscribe Unsubscribe * DYNPRO_NUMBER = SYST-DYNNR
GO field_name = 'P_FILE'
IMPORTING
file_name = p_file.

saptechnical.com/Tips/ABAP/UploadExcel/Prg.htm 1/2
3/20/2021 SAPTechnical.COM - Uploading an excel file
START-OF-SELECTION.

* Uploading the data in the file into internal table


CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
* I_LINE_HEADER = 'X'
i_tab_raw_data = it_type
i_filename = p_file
TABLES
i_tab_converted_data = t_upload[]
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.

IF sy-subrc NE 0.
MESSAGE ID sy-msgid
TYPE sy-msgty
NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
END-OF-SELECTION.

* Uploading the data into the database table


LOOP AT T_UPLOAD INTO WA_UPLOAD.
ZSCARR-CARRID = WA_UPLOAD-CARRID.
ZSCARR-TOTAL_SEATS = WA_UPLOAD-SEATS.
MODIFY ZSCARR.
ENDLOOP.

Output:

Data inserted into the table ZSCARR:

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM


Home • Contribute • About Us • Privacy • Terms Of Use • Disclaimer • Safe • Companies: Advertise on SAPTechnical.COM | Post Job • Contact Us
©2006-2007 SAPTechnical.COM. All rights reserved.
All product names are trademarks of their respective companies. SAPTechnical.COM is in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver, and and any other SAP trademarks are registered trademarks of SAP AG in Germany and in several other countries.
Every effort is made to ensure content integrity. Use information on this site at your own risk.

Graphic Design by Round the Bend Wizards

saptechnical.com/Tips/ABAP/UploadExcel/Prg.htm 2/2

You might also like