‎2008 Apr 12 8:12 AM
Hi All.
i have to download dataa from application serer to internal table ,as the program has to be run in background we cannot use function module download.what to do in this case.
‎2008 Apr 12 8:15 AM
hi Abhishek,
You can OPEN DATASET, READ DATASET, CLOSE DATASET to download data from application server to internal table.
Thanks,
Arun
‎2008 Apr 12 9:21 AM
Hi,
OPEN DATASET FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
MESSAGE s107(yaero_ps) DISPLAY LIKE c_e.
message e008.
ELSE.
DO.
CLEAR: l_string.
READ DATASET FNAME INTO l_string LENGTH l_wllength.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT l_string AT con_tab INTO wa_data_file-ebeln
wa_data_file-ebelp.
APPEND wa_data_file TO fp_flatfile.
ENDIF.
ENDDO.
CLOSE DATASET FNAME.
and to get the file name use FM
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
LOGICAL_FILENAME = FP_FILE
OPERATING_SYSTEM = SY-OPSYS
IMPORTING
FILE_NAME = FNAME
EXCEPTIONS
FILE_NOT_FOUND = 1
OTHERS = 2.
Regards,
KIRAN
‎2008 Apr 12 10:44 AM
Hi Abhishek Kumar,
Check the following program to interact with application server. How to send data to Application server and how to get from there . comments are included wherever those are neeeded.
Once it is executed in SE38 go to AL11 to check the file specified in the program .
I hope that it helps you .
Regards,
Venkat.O
REPORT ovtest.
DATA:
fname(60) VALUE 'myfile',
num TYPE i.
OPEN DATASET fname FOR OUTPUT.
"opens the file for writing(OUTPUT)
DO 10 TIMES.
num = num + 1.
TRANSFER num TO fname.
"This statement passes the content of data object(num) to the file specified in fname.
ENDDO.
CLOSE DATASET fname.
"This statement closes the file specified in fname.
OPEN DATASET fname FOR INPUT.
"The addition FOR INPUT opens the file for reading.
DO.
READ DATASET fname INTO num.
"This statement exports data from the file specified in fname into the data object num
IF sy-subrc <> 0.
EXIT.
ENDIF.
WRITE / num.
ENDDO.
‎2008 Apr 12 11:08 AM
Hi,
Files on application server are sequential files. Three steps are involved in sequential file handling
OPEN
PROCESS
CLOSE
Here processing is reading a file or writing on to a file.
syntax:
Open dataset filename for input in text mode.
Do.
read dataset filename into workarea.
if sy-subrc <> 0.
exit.
else.
append workarea to itab.
endif.
enddo.
close dataset filename.
The function modules ws_download and gui_download ws_upload, gui_upload are used to process the presentation server files.
Reward.