Skip to Content
0
Former Member
Jul 15, 2008 at 03:44 PM

Problem in Read Dataset

30 Views

Hi Abappers,

I have to read a text file which contains millions of records from the application server and then insert it into the database table.

For this I have used read dataset but not able to convert it into the internal table.

OPEN DATASET lv_fname FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc NE 0.

EXIT.

ELSE.

READ DATASET lv_fname INTO ls_upload1.

IF sy-subrc NE 0.

EXIT.

ELSE.

  • LOOP AT ls_upload1.

SPLIT ls_upload1 AT '|' INTO

ls_toahr-mandt

ls_toahr-sap_object

ls_toahr-object_id

ls_toahr-archiv_id

ls_toahr-arc_doc_id

ls_toahr-ar_object

ls_toahr-ar_date

ls_toahr-del_date

ls_toahr-reserve.

APPEND ls_toahr TO lt_toahr.

CLEAR ls_toahr.

  • ENDLOOP.

ENDIF.

ENDIF.

CLOSE DATASET lv_fname.

Here i am not able to use the loop as read dataset gives workarea not the internal table.

This code reads only the one record.

How to read the file into the Internal table?

Please reply.

Regards.