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

Excel file in app server

Former Member
0 Likes
336

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?

1 REPLY 1
Read only

former_member386202
Active Contributor
0 Likes
318

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