10-19-2006 12:38 PM
Hi All,
I use the subject function module to load the data into a .xls file. I find no error while I run my program directly. But when I run it in Background it throws an unknown_error. Tried to debug, while in background (by introducing a infinite loop and releasing from the loop with the exit condition). I couldn't get into the function module to debug.
Needed information on how else can I find what the error is and is there any other function module (other than ws_download and gui_download) which I could use and find no errors while running in background.
Thanks,
Aaron.
-
This is what I am doing:
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE
ENCODING DEFAULT.
if sy-subrc = 0.
Loop at te070 into se070.
Transfer se070 to p_file.
Endloop.
endif.
close dataset p_file.
This creates a file in the app server in Batch and I will have to run a program online to dowload the contents from the server. My requirement is that I need to download the contents in Batch to my local file. Is this possible by any means? (Can we create a windows executable file (.EXE) and use it in a windows batch file (.BAT)?)
Message was edited by: Aaron Anthony
10-19-2006 12:40 PM
10-19-2006 12:40 PM
10-19-2006 12:42 PM
GUI_DOWNLOAD Function module can't be used in Background. When the program is executed in background, store all the data in Application server, write a sample program to take that data from application server and writes to presentation server and execute that program online.
Regards,
Prakash.
10-19-2006 12:55 PM
gui_download cannot work in background.
There is a tedious workaround which may help you.
But just think if it is worth the effort.
This link has the workaround:
Regards,
Ravi
10-19-2006 12:55 PM
Hi Max/Prakash,
Is there not a way where I could realize this in background process (move data to a .xls file)?
Thanks,
Aaron.
10-19-2006 12:58 PM
Hi
U can only download the file in a path of application server and then move that file from application to your pc or other destination of presentation server.
If your file has a simple structure, you can download a file in CSV format.
Max
10-19-2006 1:04 PM
GUI_DOWNLOAD doesnt work in background mode.
If you want to do transfer in background mode, u need to transfer that file to application server and then read from there by transfering it to presentation server.
ABAP/4 provides following statements for handling files on application server:
OPEN DATASET
CLOSE DATASET
DELETE DATASET
READ DATASET
TRANSFER
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
10-25-2006 7:40 AM
Hi Vibha,
OPEN DATASET
CLOSE DATASET
DELETE DATASET
READ DATASET
TRANSFER
Helps me write in the application server. I will have to write an online program to download its contents locally. Is there any way where I can download locally using Batch? (Is it possible for me to create an (windows) .exe file for my ABAP program? and then run this using the .BAT file?)
Thanks for your help.
10-25-2006 7:43 AM
Open Dataset
catch system-exceptions DATASET_CANT_OPEN = 8.
open dataset UNIX_FILE for output in text mode encoding default.
endcatch.
Write to Dataset
loop at IT_STR into IS_STR.
catch system-exceptions DATASET_NOT_OPEN = 0 .
transfer IS_STR-STR to UNIX_FILE.
endcatch.
endloop.
if SY-SUBRC eq 0.
message S138(ZSM) with 'Data Downloaded to Unix File'.
endif.
Close Dataset
close dataset UNIX_FILE.
Regards
- Gopi
10-25-2006 7:50 AM
Hi Gopi,
This is what I am doing:
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE
ENCODING DEFAULT.
if sy-subrc = 0.
Loop at te070 into se070.
Transfer se070 to p_file.
Endloop.
endif.
close dataset p_file.
This creates a file in the app server in Batch and I will have to run a program online to dowload the contents from the server. My requirement is that I need to download the contents in Batch to my local file. Is this possible by any means? (Can we create a windows executable file?)
Thanks for your help.
10-25-2006 8:27 AM
I think it can be done, but shud be a part of the BASIS team. Talk to ur basis people, might help u or give in some inputs.
Regards
- Gopi