05-01-2009 11:44 PM
Hello experts,
I'm new to ABAP and I'm looking to create a program that can copy files from the presentation server to teh application server, the files could be binary or text.
I've seen transaction CG3Y and CG3Z, but those are only availiable in our ec system and I need to create this program in crm.
Thanks for any pointers.
05-02-2009 3:17 AM
Can you try following steps
To upload a file from presentation server to application
server we have to do the following :
1. upload the file from presentation server in to an
internal table using gui_upload.
2.open dataset
3.loop the internal table
4.use transfer statement to write into application server
Niwaas.
05-02-2009 3:17 AM
Can you try following steps
To upload a file from presentation server to application
server we have to do the following :
1. upload the file from presentation server in to an
internal table using gui_upload.
2.open dataset
3.loop the internal table
4.use transfer statement to write into application server
Niwaas.
05-02-2009 7:34 AM
Hi Cody,
You can do one thing. Go to SE38 Editor. Type the keyword DATASET and press F1. You will get explanation along with the implementing example.
You can simply copy that and explore further.
In addition to this, there are lot many Wikis written on the same topic. Check the same.
Thanks,
Babu Kilari
05-02-2009 10:23 AM
Hi Cody,
Use the FM gui_upload to upload the text file to an internal table.
then with the statements open dataset , transfer the internal table data to the file in application server.
regards
kanishak
05-02-2009 11:05 AM
Hi Cody ,
First by using GUI_UPLOAD or UPLOAD function module , upload the data from
presentation server to internal table .
Then open a file in the Applocation server by by OPEN DATASET .......
If the file does not exissts in the Application server then this statement creates
file there.
After that Loop through the internal table and by TRANSFER statement file up
the file of Application server .
Check this code -
DATA : w_file(8) TYPE c VALUE 'FILE',
fs_itab(255) TYPE c,
t_itab LIKE TABLE OF fs_itab.
CALL FUNCTION 'GUI_UPLOAD' " To upload the presentation server file to internal table
exporting
.
filename = 'C:\FILE_PATH.TXT' " Specify the file path
.
tables
.
data_tab = t_itab. " Specify the internal table name
.
.
OPEN DATASET w_file1 FOR INPUT IN BINARY MODE. "Open file in application layer
LOOP AT t_itab INTO fs_itab. " Looping to internal table
TRANSFER fs_itab TO w_file1. " Transfering to Application server's file
ENDLOOP.
Regards
Pinaki