2006 Jun 26 6:14 AM
Hi,
Im uploading text file from one server to sap by using ws_upload function module. In the foreground it is getting upload. But in the background it cannot upload if we use partiular gui. Iam using one server IP and trying to upload in the background. But i could not. How to upload this file in the background.
rgds
p.kp
Hi,
Im uploading text file from one server to sap by using ws_upload function module. In the foreground it is getting upload. But in the background it cannot upload if we use partiular gui. Iam using one server IP and trying to upload in the background. But i could not. How to upload this file in the background.
rgds
p.kp
2006 Jun 26 6:18 AM
Hi,
WS_UPLOAD CAN NOT be used in background mode.
You will have to use OPEN DATASET statement to upload the data from file in background mode.
Hope it helps.
Regards,
Shashank
2006 Jun 26 6:20 AM
WS_UPLOAD can n't be used for upload file in back ground processing.
2006 Jun 26 6:28 AM
Hi,
I know i have to upload this file by using open dataset. But my requirement is they run that program in the back ground and i have to download the file from another IP which is located at another server. They everday upload that file periodically . They don't want the user intervention. If we use datasets, again we have to upload that file by user interaction. so what can i do.
rgds
p.kp
2006 Jun 26 6:34 AM
2006 Jun 26 6:50 AM
Hi paluri,
1. I have to download the file from another IP
In that case one approach is to use
this convention
computername\folder\filename
or
ipaddress\folder\filename
2. this u can also test using your own computer first,
from START-->RUN
regards,
amit m.
2006 Jun 26 6:23 AM
reading file from Presentation server will NOT be allowed in background. if you are running a report with this type of reading file, you have to place it in the APPLICATION server & then Use OPEN DATASET, READ DATASET statements to read the contents of the file into your program
regards
srikanth
2006 Jun 26 6:27 AM
Hi Paluri,
1.Use the transaction code 'CG3Z' to upload the file from presentation server to application server.
2.Use the command OPEN DATASET,READ DATASET and CLOSE DATASET for processing the file in the background.
Regards,
Mukesh Kumar
Message was edited by: mukesh kumar
2006 Jun 26 6:30 AM
Try using this:
OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
TRANSFER file_content TO FNAME.
CLOSE DATASET FNAME.file_content TYPE XSTRING
fname type string
fname contains the path in the app server and file_content is the content of the file.
Regards,
Ravikiran.
2006 Jun 26 7:20 AM
Hai Krishna Prasad
Go through the following Code
REPORT ZFILE_UPLOAD_APPL message-id ztraining .
----
types
----
**-- types for data to be downloaded
types: begin of tp_kna1,
KUNNR type kna1-kunnr, " customer number
LAND1 type kna1-land1, " Country Key
NAME1 type kna1-name1, " customer name
ORT01 type kna1-ort01, " city
PSTLZ type kna1-pstlz, " postal code
REGIO type kna1-regio, " region
end of tp_kna1.
----
I n t e r n a l T a b l e s
----
**-- Internal table for data to be downloaded
data: it_kna1 type standard table of tp_kna1 with header line.
----
S e l e c t i o n S c r e e n
----
selection-screen begin of block b1 with frame title text-001.
parameters: p_afile type rlgrap-filename
default 'customer.txt'.
selection-screen end of block b1.
----
----
S t a r t o f s e l e c t i o n
----
start-of-selection.
*-- Upload the data from Sales Deal file
perform upload_app_file.
end-of-selection.
perform write_data.
*&----
*& Form upload_app_file
*&----
Upload the application server file data
*----
form upload_app_file.
data: l_msg(100). " error message
open dataset p_afile for input in text mode encoding default message
l_msg.
if sy-subrc <> 0.
message i004 with l_msg.
else.
do.
read dataset p_afile into it_kna1.
if sy-subrc = 0.
append it_kna1.
clear it_kna1.
else.
exit.
endif.
enddo.
close dataset p_afile.
endif.
endform. " upload_app_file
&----
*& Form write_data
&----
text
----
--> p1 text
<-- p2 text
----
FORM write_data .
loop at it_kna1.
write:/ it_kna1-kunnr,
it_kna1-land1,
it_kna1-name1,
it_kna1-ort01,
it_kna1-pstlz,
it_kna1-regio.
endloop.
ENDFORM. " write_data
Thanks & regards
Sreenivasulu P
2006 Jun 26 7:29 AM
Hi Krishna prasad,
Check this Document this helps you a lot.it is a code sample By one of my Colleague.
Regards
vijay
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |