Skip to Content
avatar image
Former Member

function module to know file data.

Hello Experts,

Is there any function module available which can give me details of a file like no of rows and cols in a file?

My input file is EXCEL file and I want to know no of lines (i.e rows) present in file before reading it.

If there is no such FM then plz let me know any function module which will read an excel file line by line in internal table as follow :

types : begin of ty_itab,

Line type string,

End of ty_itab.

Data : gt_itab type standard table of ty_itab.

i want ot read excel file in above internal table which stores excel file dta line by line in it.

-Shweta

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Sep 26, 2008 at 08:06 AM

    Hi,

    You can use FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' to read excel to internal table. But you need to know begin row, begin column, end row, and end column. The internal table is SAP standard format, so you need to process it to your custom internal table.

    Anyway, reading data from excel is a lot more time consuming compared to reading data from tab delimited file and using FM 'GUI_UPLOAD'. Changing the source data from excel to a tab delimited file is also an easy task for user (copy paste from excel to notepad). So I recommend to change the requirement and make tab delimited file as your input.

    Regards,

    Teddy Kurniawan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 26, 2008 at 08:17 AM

    Hi Swetha,

    Try the function module: EPS_GET_FILE_ATTRIBUTES

    Regards,

    Chandra Sekhar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 26, 2008 at 08:32 AM

    HI,

    Refer to the link.

    get file info

    Regards

    Sumit Agarwal

    Add comment
    10|10000 characters needed characters exceeded