2007 Feb 21 5:09 PM
Hi, All
in our application server ther is a file in
tmp\sap\legacy\filename_yyyymmddhhmmss.txt this file gets generated every day night so when i run my program i need to get the data in the file to my internal table.
i have to use data sets to do this
can any one send me the code for this please
thanks,sri
2007 Feb 21 5:17 PM
Type READ on your ABAP editor then put cursor on top of READ and press F1 key. Select the READ DATASET option. The Help has sample code.
Regards
Nic
Hi, All
in our application server ther is a file in
tmp\sap\legacy\filename_yyyymmddhhmmss.txt this file gets generated every day night so when i run my program i need to get the data in the file to my internal table.
i have to use data sets to do this
can any one send me the code for this please
thanks,sri
2007 Feb 21 5:13 PM
Hi,
PARAMETERS: p_file(100).
DATA: BEGIN OF itab OCCURS 0,
f1(10),
f2(20),
*******Give the field names accordingly to the length of each column..
END OF itab.
START-OF-SELECTION.
OPEN DATASET p_file.
IF sy-subrc = 0.
DO.
READ DATASET p_file INTO itab.
IF sy-subrc <> 0.
EXIT.
ELSE.
APPEND itab.
CLEAR itab.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET p_file.
Thanks,
Naren
2007 Feb 21 5:16 PM
Thanks naren
and where do i give the file name which i have in the application server because a new file will be created every night
thanks
2007 Feb 21 5:17 PM
Type READ on your ABAP editor then put cursor on top of READ and press F1 key. Select the READ DATASET option. The Help has sample code.
Regards
Nic
2007 Feb 21 5:24 PM
Hi,
If the file is created once in a day..Why do you have time in the filename..
To solve this issue..
you can create a logical file name in the FILE transaction..
You can give parameter in the filename..
Then use the function module FILE_GET_NAME by passing the logical file name and SY-DATUM in the PARAMETER_1 parameter...
It will give the physical filename..
Thanks,
Naren
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |