2007 Dec 17 12:35 PM
Hi
Is there any FM to read data directly from an excel file in App server to Internal tables?
Hi
Is there any FM to read data directly from an excel file in App server to Internal tables?
2007 Dec 17 12:39 PM
Hi,
There r no FM to upload the data from application server u have to use dataset
refer this code
*-- Open Dataset
OPEN DATASET lv_dsn FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
File not found
MESSAGE e503.
ELSE.
Read each line from the dataset and append to an internal table.
DO.
IF sy-subrc NE 0.
No records found in the file.
MESSAGE e504.
ENDIF.
*-- Read dataset and pass it to an internal table.
READ DATASET lv_dsn INTO lv_line.
CLEAR wa_eord.
wa_eord-matnr = lv_line+0(18).
wa_eord-werks = lv_line+18(4).
wa_eord-vdatu = lv_line+22(8).
wa_eord-bdatu = lv_line+30(8).
wa_eord-lifnr = lv_line+38(10).
wa_eord-ekorg = lv_line+48(4).
wa_eord-meins = lv_line+52(3).
wa_eord-autet = lv_line+55(1).
wa_eord-feskz = lv_line+56(1).
IF NOT wa_eord IS INITIAL.
APPEND wa_eord TO pr_eord.
ENDIF.
ENDDO.
*-- Close Dataset .
CLOSE DATASET lv_dsn.
ENDIF.
Regards,
Prashant
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |