10-08-2008 3:21 AM
Hi experts,
Is it possible to upload data from local drive(presentation server) to sap in background mode.
As I know ,in the background mode we can upload files from application server only.
but here my functional consultant saying they did upload data from local drive to sap in background mode.
please suggest.
thanks in advance.
sastry.
10-08-2008 3:31 AM
hey,
Yes it can be made possible,
The only way to access files in a background job is to have them on the application server and opened via OPEN DATASET or similar.
*--Local Variables
DATA : l_file TYPE string,
l_line TYPE string,
l_index TYPE sy-tabix.
*--Clear
CLEAR : l_file.
l_file = p_ipfile.
*--Read the data from application server file.
OPEN DATASET l_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
*--Error in opening file
MESSAGE i368(00) WITH text-005.
ENDIF.
*--Get all the records from the specified location.
DO.
READ DATASET l_file INTO l_line.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT l_line AT cl_abap_char_utilities=>horizontal_tab
INTO st_ipfile-vbeln
st_ipfile-posnr
st_ipfile-edatu
st_ipfile-wmeng.
APPEND st_ipfile TO it_ipfile.
ENDIF.
ENDDO.
Regards,
Midhun Abraham
Edited by: Midhun Abraham on Oct 8, 2008 4:36 AM
10-08-2008 3:31 AM
hey,
Yes it can be made possible,
The only way to access files in a background job is to have them on the application server and opened via OPEN DATASET or similar.
*--Local Variables
DATA : l_file TYPE string,
l_line TYPE string,
l_index TYPE sy-tabix.
*--Clear
CLEAR : l_file.
l_file = p_ipfile.
*--Read the data from application server file.
OPEN DATASET l_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
*--Error in opening file
MESSAGE i368(00) WITH text-005.
ENDIF.
*--Get all the records from the specified location.
DO.
READ DATASET l_file INTO l_line.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT l_line AT cl_abap_char_utilities=>horizontal_tab
INTO st_ipfile-vbeln
st_ipfile-posnr
st_ipfile-edatu
st_ipfile-wmeng.
APPEND st_ipfile TO it_ipfile.
ENDIF.
ENDDO.
Regards,
Midhun Abraham
Edited by: Midhun Abraham on Oct 8, 2008 4:36 AM
10-08-2008 3:45 AM
Hi Midhun ,
Thanks for your reply,
I know that the files placed on application server can be accessed in back ground mode .,
but my question is ,is it possible to access files present in the local drives in the background mode?
please confirm.
sastry.
10-08-2008 3:52 AM
10-08-2008 4:46 AM
Hi Aparna,
Thankss for your reply.
I wanted to know is there any other way to accesss presentation server files in background mode .
10-08-2008 5:38 AM
Hi
There is no way u can access files on presentation server or desktop using Background mode..
We tried for weeks, but it did not work.
So, storing it in the application server and then processing it is the only option.
Regards,
Vishwa.
10-08-2008 7:10 AM
hi vishwa,
thanks for your response.
can you tell me how to store excel file on the application server.
sastry.
10-08-2008 7:14 AM
10-14-2008 4:00 AM
Hi Aparna,
I got problems in creating rfc as mentioned in the document.
can you suggest the steps how to upload presentation server file in background .
sastry.
01-03-2009 9:20 PM
Hi Sastry,
Were you able to find a solution to the same? I am at a point where the program needs to upload a file from the presentation server.
The only way by which I can achieve this is by transferring the fle from the presentation server to the application server and reading it from there.
However I am unable to proceed with the transfer of file from the presentation to the application server
I have tried using these two Function Modules. None of them seem to be working
ARCHIVFILE_CLIENT_TO_SERVER
FTP_SERVER_TO_R3
Any pointers towards how you achieved this would be helpful.
Thanks and Best Regards,
Puja.
01-05-2009 9:58 PM
Hi,
You can only read the file from application server in background. There is no way to read the file from presentation or desktop in background.
Also, to read the excel file from application server, you can save it as CSV file and then while reading the file use SPLIT command to store in the internal table.
Finally, you can use FTP command to FTP from your desktop to application server only if there are proper connections and accesses.
There are standard programs, to read the file from desktop and transfer to application server and vice versa. You can use these programs only if you have proper access.
Once you have the access, you need to still run this program manually and then schedule the job to run the actual step.
Hope this helps.
Regards,
Bharati
01-08-2009 5:05 AM
Hi,
Yes, You fix file path in code and place a flat file in same path and shedule it in background.
Regards
Md.MahaboobKhan
01-06-2009 8:59 AM
Hi,
In background there is no support to read the file from presentation server or desktop.in background u can read the files from application server only.
Note that if ur file is in XL format (on application server), you will have to save it as CSV file.
01-06-2009 9:07 AM
No it is not at all possible to read the files in presentation server in background mode.
Regards,
Hakim
01-08-2009 5:45 AM
Hi,
you can read the file from application server in background. There is no way to read the file from presentation or desktop in background.
and read the excel file from application server, you can save it as CSV file and then while reading the file use SPLIT command to store in the internal table.
Regards,
Madhu