How to read data from application server to internal table in ABAP/4

Normally, when you want to read the file from application server, you will have 5 steps:

  1. Open file in application server by statement:
    OPEN DATASET file_name FOR INPUT IN TEXT MODE.
  2. Checking the file is opened sucessfully by SY-SUBRC = 0
  3. After checking, you can read data from file by statement:
    READ DATASET file_name INTO itab.  
    Note: This statement should be in DO statement
  4. Append data to internal table
  5. Close file by statement:
    CLOSE DATASET file_name

Example


DATA: BEGIN OF i_tab OCCURS 0,
text(100),
END OF i_tab,
gv_dataset1(30) VALUE ’/temp/testfile.txt’.

OPEN DATASET gv_dataset1 FOR INPUT IN TEXT MODE.
  DO.
    IF SY-SUBRC <> 0.
      EXIT.
    ENDIF.
    READ DATASET gv_dataset1 INTO i_tab.
    APPEND i_tab.
    CLEAR i_tab.
  ENDDO.
CLOSE DATASET gv_dataset1.

how to get the data form BW to R/3.

Hi, i want to get the data from BW to R/3. i dont know how to do that. In BW datas r stored in infocube. i dont know how to get the data. PLZ help me its urgent. if u have sample code means plz send it to me

Post new comment