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

Upload the excel file

Former Member
0 Likes
1,211

HI,

In my requirement i want to upload excel file and then i have to validate the belnr value present in the excel.How to do it.Can somebody help me with a sample code

HI,

In my requirement i want to upload excel file and then i have to validate the belnr value present in the excel.How to do it.Can somebody help me with a sample code

7 REPLIES 7
Read only

viquar_iqbal
Active Contributor
0 Likes
1,183

HI

check this [WIKI|http://wiki.sdn.sap.com/wiki/x/xOw]

Once uploaded , you can check the value of belnr from the data .

Thanks

Viquar Iqbal

Read only

viquar_iqbal
Active Contributor
0 Likes
1,183

This message was moderated.

Read only

Former Member
0 Likes
1,183

Hi,

This is simple..

1.Declare the intrenal table having same structure as table .

2.Use the FM 'TEXT_CONVERT_XLS_TO_SAP'/GUI_UPLOAD(if file is saved a stab deliminator) in the intrenal table

3.Then with in th eloop on the internal table simply verify the data for BELNR.

PS:Search the forum before posting...you'll definetly get good post on this.

Hope this might help you.

Pooja

Read only

Former Member
0 Likes
1,183

Hi,

Use following FM

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = p_infile " Location of file.

i_begin_col = c_begin_col

i_begin_row = c_begin_row

i_end_col = c_end_col

i_end_row = c_end_row

TABLES

intern = ig_file1

EXCEPTIONS

inconsistent_parameters = 1

upload_ole = 2

OTHERS = 3.

Do the validations as required with data in internal table.

Regards

Milan Shah

Edited by: Milan Shah on Jul 15, 2009 11:15 AM

Read only

Former Member
0 Likes
1,183

Hi,

Please use following FM,

TYPES : BEGIN OF t_text,

field(255) TYPE c,

END OF t_text.

DATA : lt_table TYPE TABLE OF t_text,

ls_table TYPE t_text,

p_file1 TYPE string.

PARAMETERS : p_file LIKE ibipparms-path OBLIGATORY.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'F4_FILENAME'

  • EXPORTING

  • PROGRAM_NAME = SYST-CPROG

  • DYNPRO_NUMBER = SYST-DYNNR

  • FIELD_NAME = ' '

IMPORTING

file_name = p_file

.

START-OF-SELECTION.

p_file1 = p_file.

CONDENSE p_file1.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = p_file1 " File Path Name

filetype = 'ASC'

TABLES

data_tab = lt_table.

Thanks & Regards,

ShreeMohan

Read only

Former Member
0 Likes
1,183

check the following link

/people/alvaro.tejadagalindo/blog/2009/02/05/excel-ole-and-abap--create-fancy-reports

Read only

Former Member
0 Likes
1,183

Hi,

Save you excel file as .CSV.

Then in your program

use FM GUI_UPLOAD.

Hope this will help you.

Regards,

Vijay