2006 Mar 13 10:26 AM
I need to upload a file to application server every 1 hour. And i have to automate this. How do i do it.
2006 Mar 13 11:30 AM
Hi Rajesh,
Let us know where the source data is residing? Accordingly, we can give a solution.
All FMs which require user interaction like selecting a file etc..will not work in background...
Regards,
Raj
I need to upload a file to application server every 1 hour. And i have to automate this. How do i do it.
2006 Mar 13 10:35 AM
1.if from front end of presentation server
not possible to schedule in background.
2. IF FROM INTERNAL TABLE
write a program,
use OPEN DATASET <DSET> FOR OUTPUT.
transfer DATASET <DEST>.
CLOSE DATASET <DESET>.
u can schedule the program in background in SA38/SE36
to run for every 1 hr.
Message was edited by: Hymavathi Oruganti
2006 Mar 13 10:39 AM
2006 Mar 13 10:42 AM
Hi ,
Use <b>SM36</b> to schedule a job..
gui_* will not work in background..
you can use only
open dataset..
regards
satesh
2006 Mar 13 10:37 AM
Hi Rajesh,
Try Program RC1TCG3Z.
Hope it helps...
Lokesh
pls. reward appropriate points
Message was edited by: Lokesh Aggarwal
2006 Mar 13 10:39 AM
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = filnam
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = record
.
open dataset dataset for output in text mode encoding DEFAULT.
loop at record.
transfer record to dataset.
endloop.
close dataset dataset.Attach a transaction code to this program and you schedule this program to run every 1 hour with Basis...
<b>If you are to upload the file in Background mode GUI_* functions will not work.</b>Then you might have to think of other alternatives...
Regards,
Wenceslaus.
2006 Mar 13 10:39 AM
Hi Rajesh,
If you mean uploading a file from a frontend to the application server using a job: it is not possible to do this, as there is no connection to your front end in the background.
The file must be in a location you have access to from the background (like a file server). You could use FTP then to copy the file to the application server.
Regards,
John.
2006 Mar 13 10:42 AM
<b>data to Application server</b>
open dataset p_fleunx for output in text mode.
loop at fltab.
transfer fltab to p_fleunx.
endloop.
close dataset p_fleunx.
set the program in background to trigger every one hour
==================================
<b>To read data from App server.</b>
open dataset p_fleunx for input in text mode.
if sy-subrc ne 0.
write: / 'Process will be aborted.'.
exit.
endif.
Load internal table
do.
read dataset p_fleunx into fltab.
if sy-subrc ne 0.
exit.
endif.
append fltab.
enddo.
2006 Mar 13 10:46 AM
Hi Rajesh,
U can Schedule your job to run in background for every one hour and u can use the dataset commands
OPEN <DataSetName>
and then looping through the internal table u can transfer the data from workarea to dataset using
TRANSFER <FName> to <DataSetName>
and close the dataset after the endloop using
CLOSE <DataSetName>.
Regards,
Phani
2006 Mar 13 11:08 AM
Thanks to all of you for responding with useful solutions
Here i observed 2 options.
1. using open dataset: In scheduling i canntot use GUI_* . So what is the alternative for me.
2. Using FTP: Please elobarate me on using FTP.
2006 Mar 13 11:24 AM
Hi,
For 2: Performing FTP Commands From ABAP
/people/thomas.jung3/blog/2004/11/15/performing-ftp-commands-from-abap
Best Regards,
Anjali
2006 Mar 13 11:23 AM
Hi,
Try this piece of code.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
LOGICAL_FILENAME = P_INFILE
IMPORTING
FILE_NAME = INPUTFILE
EXCEPTIONS
FILE_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC NE 0.
MESSAGE E899 WITH text-064 P_INFILE text-065.
ENDIF.
* Open the inputfile for reading in text mode
OPEN DATASET INPUTFILE FOR INPUT IN TEXT MODE.
IF SY-SUBRC NE 0.
MESSAGE E899 WITH text-066 INPUTFILE text-067.
ENDIF.
DO.
READ DATASET INPUTFILE INTO TEXT2 . "LENGTH LENG.
MOVE TEXT2 TO I_MATCONV.
APPEND I_MATCONV.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET INPUTFILE.Regards,
Gayathri
2006 Mar 13 11:30 AM
Hi Rajesh,
Let us know where the source data is residing? Accordingly, we can give a solution.
All FMs which require user interaction like selecting a file etc..will not work in background...
Regards,
Raj
2006 Mar 13 11:36 AM
Dear Rajasekhar,
source data is in front end in excel sheet.
Thanks
2006 Mar 13 12:01 PM
2006 Mar 13 12:05 PM
Hi Rajesh,
One way of handling this situation is,
1. Try getting the source data into a file on application server instead of frontend.
2. Use Open dataset, transfer and close dataset stmnts as suggested by all for your requirement.
Regards,
Raj
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |