2007 Jul 12 9:57 PM
hello experts,
I am getting a file to upload the data.... This file is containing one header record one trailor record and remaining data records...
how to read all the data into one internal table along with header and tralor record.
Because i have to control record validation. In the trailer record the amount what they were giving is the total number of records along with header and trailor
can anyone guide me how to do that
SRI
2007 Jul 13 10:48 PM
If thats an excel file then you can use function module
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_fnam
i_begin_col = 1
i_begin_row = 1
i_end_col = 100
i_end_row = 30000
TABLES
intern = iexcel
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE: / 'EXCEL UPLOAD FAILED ', p_fnam, sy-subrc.
STOP.
ENDIF.
Instead of passing 1 in i_begin_row you, if you know how many lines the header is going to be then you can ignore those lines and pass the number of the row which has the first data record. You can hard code the header because this is giong to constant.
Just a suggestion. Hope this works for you.
Thanks.
Message was edited by:
mg s