2009 Jul 15 10:05 AM
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
2009 Jul 15 10:09 AM
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
2009 Jul 15 10:09 AM
2009 Jul 15 10:13 AM
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
2009 Jul 15 10:14 AM
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
2009 Jul 15 10:22 AM
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
2009 Jul 15 1:01 PM
check the following link
/people/alvaro.tejadagalindo/blog/2009/02/05/excel-ole-and-abap--create-fancy-reports
2009 Jul 15 1:10 PM
Hi,
Save you excel file as .CSV.
Then in your program
use FM GUI_UPLOAD.
Hope this will help you.
Regards,
Vijay
| User | Count |
|---|---|
| 8 | |
| 4 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |