2009 Feb 05 9:41 AM
Hi friends,
I want to upload a file from application layer into an internal table.Can anyone tell me, is there any funtion module to do this rather than programming?
Thanks
Kiran
2009 Feb 05 9:46 AM
Hi,
Use the OPEN DATASET, READ DATASET and CLOSE DATASET statements (See documentation for this keywords) to read a file on application server and move into an internal table.
Fm GUI_UPLOAD is to upload the data from a file on presentation server into an internal table.
Regards,
Dwaraka.S
Edited by: Dwarakanath Sankarayogi on Feb 5, 2009 10:47 AM
Hi friends,
I want to upload a file from application layer into an internal table.Can anyone tell me, is there any funtion module to do this rather than programming?
Thanks
Kiran
2009 Feb 05 9:43 AM
Hi,
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = C:\test.txt " file path
FILETYPE = 'DAT'
* HAS_FIELD_SEPARATOR = ' '
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
tables
data_tab = ITAB
* EXCEPTIONS
* FILE_OPEN_ERROR = 1
* FILE_READ_ERROR = 2
* NO_BATCH = 3
* GUI_REFUSE_FILETRANSFER = 4
* INVALID_TYPE = 5
* NO_AUTHORITY = 6
* UNKNOWN_ERROR = 7
* BAD_DATA_FORMAT = 8
* HEADER_NOT_ALLOWED = 9
* SEPARATOR_NOT_ALLOWED = 10
* HEADER_TOO_LONG = 11
* UNKNOWN_DP_ERROR = 12
* ACCESS_DENIED = 13
* DP_OUT_OF_MEMORY = 14
* DISK_FULL = 15
* DP_TIMEOUT = 16
* OTHERS = 17
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks
Arun Kayal
Edited by: Arun Kayal on Feb 5, 2009 10:43 AM
2009 Feb 05 9:43 AM
2009 Feb 05 9:44 AM
hi,
use open dataset..
close dataset..
u can get more examples in SCN.. search on above strings...
Rgds.,
subash
2009 Feb 05 9:46 AM
Hi,
Use the OPEN DATASET, READ DATASET and CLOSE DATASET statements (See documentation for this keywords) to read a file on application server and move into an internal table.
Fm GUI_UPLOAD is to upload the data from a file on presentation server into an internal table.
Regards,
Dwaraka.S
Edited by: Dwarakanath Sankarayogi on Feb 5, 2009 10:47 AM
2009 Feb 05 9:56 AM
2009 Feb 05 9:58 AM
Hi,
Try like this...
v_path = <file path>.
open dataset v_path for input in text mode encoding default.
if sy-subrc = 0.
do.
read dataset v_path into w_input-wa_string.
if sy-subrc <> 0.
exit.
endif.
append w_input to t_input.
enddo.
close dataset v_path.
endif.
Hope it will helps
2009 Feb 05 10:05 AM
Hi Kiran,
You first have to call function module GUI_UPLOAD for uploading the file into your internal table,
then to download it to the application server,you have to use statement
OPEN DATASET CLOSE DATASET.
Regrds
Mansi
2009 Feb 06 10:13 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |