Tcode to upload file to SRM Server.
Hi,
We have a requirement to upload file into application server and then read the data into internal table.
In ECC we can use the tcode CG3Y/CG3Z but this Tcode is not available in SRM Server,
Can anyone suggest corresponding tcode in SRM server to upload data into application server.
Thanks in advance,
Jerin
Jerin,
Please go throgh the below link which will help for upload the contracts.
http://help.sap.com/saphelp_srm40/helpdata/en/e5/2c85403e1b6e1de10000000a1550b0/content.htm
Best Regards,
NMK
Similar Messages
-
How to upload file from Application Server?
Dear Friends,
How to upload file from Application Server?
Plz. with example...
Regards,
Dharmeshhi,
check the code for upload from application server.
tables: kna1.
types: begin of s_file,
customer type kna1-kunnr,
country type kna1-land1,
name type kna1-name1,
region type kna1-regio,
end of s_file.
*--Internal tables
data: it_file type s_file occurs 0 with header line.
*-- Selection screen
selection-screen: begin of block b1 with frame title text-001.
parameter: p_file type rlgrap-filename default 'C:/customer.txt'
obligatory.
selection-screen: end of block b1.
*-- At selection screen
at selection-screen on value-request for p_file.
perform file_help using p_file.
*-- Process File
start-of-selection.
perform upload_file using p_file.
*-- write File data to o/p
end-of-selection.
perform write_data.
*& Form file_help
form file_help using p_p_file.
data: l_filepath type ibipparms-path.
call function 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
importing
file_name = l_filepath
p_p_file = l_filepath.
endform. " file_help
*& Form upload_file
form upload_file using p_p_file.
call function 'WS_UPLOAD'
exporting
filename = p_p_file
filetype = 'DAT'
IMPORTING
FILELENGTH =
tables
data_tab = it_file
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
others = 11
if sy-subrc <> 0.
message i001.
endif.
endform. " upload_file
*& Form write_data
form write_data .
loop at it_file.
write:/ it_file-customer, it_file-country, it_file-name,
it_file-region.
endloop.
endform.
regards,
keerthi. -
Uploading Excel file in SRM server
Dear Gurus,
I am trying to upload the excel file in SRM 5.0 server. But the function modules that are present in R/3 like 'TEXT_CONVERT_XLS_TO_SAP',
'KCD_EXCEL_DATE_CONVERT' and also ALSM_EXCEL_TO_INTERNAL_TABLE but these function modules are not present on SRM server.
I need to upload a simple excel file and write an bdc on that.
Is there any way.
Thanka in advance,
Saurabh ChhatreHi,
save the internal table as a desktop file and then use CG3Z transaction to put the data from desktop to application server.
then to read the application file use the logic given below:
DATA: wa_file_data TYPE text4096,
lv_app_server_file TYPE string.
lv_app_server_file = pa_afile.
To read file from Application server
OPEN DATASET lv_app_server_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
DO.
READ DATASET lv_app_server_file INTO wa_file_data.
IF sy-subrc = 0.
APPEND wa_file_data TO gi_file_data.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET lv_app_server_file.
DATA: lv_file_separator TYPE c.
lv_file_separator = cl_abap_char_utilities=>horizontal_tab.
To upload file in other formats(CSV, Tab delimited etc)
CALL FUNCTION 'TEXT_CONVERT_TEX_TO_SAP'
EXPORTING
i_field_seperator = lv_file_separator
i_tab_raw_data = gi_file_data
TABLES
i_tab_converted_data = gi_zhralcon_file
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Hope it helps.
Regards,
Rajesh Kumar -
Uploading file to Application Server using Tcode: CG3Z
Hi Friends,
I am facing a weird problem when uploading a file(PIPE delimited format) to application server
using the transaction CG3Z. The data is getting truncated at the end of each row and the file size
doesn't match with the one i had uploaded.
Can anyone resolve this issue.
Thanks in advance.
MurthyHi Friends
I wrote the custom program to upload the file on application server.
Thanks for your time.
Murthy -
Problem while uploading file from application server to internal tab in BG
Hi all,
When i see the file in application server.data is like this
#################00\);_(#####}#-#}###############################00\);_(#####}#-#}###############################00\);_(*#####}#-#}#########
###################}###}#############A#############???#00\);_(*#################;_(@_) ########???# ########???# ########???###
#######???#########}###}#############)##############}##00\);_(*#################;_(@_) ############ ############ ##############
###################}#A#}#############:##############}##00\);_(#################;_(@_) }###}##############################00\);_(*##########
#######???#########}#-#}#############F#################00\);_(#####}###}#############@#################00\);_(#################;_(@_) #####
###################}#-#}#############3#################00\);_(#####}#U#}#############E#################00\);_(#################;_(@_) #####
Because the csv which is uploaded has dropdowns and some formattings.
when download from tcode cg3y i am getting correct file
When try to use open(binary mode) and read dataset i getting data as it is (junk).
i need to process in background.
Any help.
Rhea.upload file to string format
begin of ty_tab,
string type char200,
end of ty_tab.
loop at ty_tab into string
use statement replace string into tab deliminated fromat(particular occurance in string)
now call class to break string at tab into fields
endloop.
DATA : BEGIN OF i_data OCCURS 0,
data(200) TYPE c, "To hold Upload file data
END OF i_data.
OPEN DATASET v_str FOR INPUT
IN TEXT MODE
ENCODING DEFAULT IGNORING CONVERSION ERRORS.
IF sy-subrc EQ 0.
DO.
*Read a line from input file
READ DATASET v_str INTO i_data-data.
IF sy-subrc NE 0.
EXIT.
ENDIF.
*Append record to an internal table
APPEND i_data.
CLEAR: i_data.
ENDDO.
*Close the file
CLOSE DATASET v_str.
*---Start of inserti
LOOP AT i_data.
REPLACE ALL OCCURRENCES OF '"' IN i_data WITH '#'.
SPLIT i_data AT cl_abap_char_utilities=>horizontal_tab
INTO i_doc-pvaudt
i_doc-pvpate
i_doc-vecatc
i_doc-vhvend
i_doc-vhidt8
i_doc-vhinvn
i_doc-vhhexp
i_doc-vhiref. -
To Delete the uploaded file in Application Server
Hi Friends,
I developed an BSP Application displaying the results from ITAB though Iterator, for which , each row there is feature to upload a particular file in the Application Server, where I stored the file path into a database table field. .When I delete the the row, I am successfully get rid of the entire row including the file path.
My Question.
1. How to delete the uploaded file of the Application Server ?
Please mail me in this regard.
Regards
CSM ReddyHi,
you have the keyword and you have the documentation. What is your problem?
Search in the forums with keyword "delete dataset", there are lots of threads about this.
Example
Deletion of dataset in applicaiton server
deleting file from AL11 Tcode
Best regards
Renald -
Uploading file in application server to a transaction
Hi All,
I have a requirment where in i want to upload the transaction FF_5 using the file in the application server. Is there any way to do this. I dont want to download the file to presentation server and then upload the file in FF_5 transaction. According to the requirement i have to directly upload the application server file in the tcode FF_5. Pls let me know how to do this.
Thanks,
RajuHi,
You cannot upload the data from the applcation server. You have to upload from the presentation server.
If you have data on the application server then you need to save it to presentation server and upload to FF_5. -
Reading uploaded file from app. server
Hi All,
I am trying to upload a .csv format file to app. server thru txn CG3Z....
When i try to open the file in my code thru open dataset and read dataset ...it is giving it in the form of
30002058,1000#50055501,2000#
Now i want it to be in
30002058,1000
50055501,2000
format...
pleas suggest..
thnx
RkHi Rahul,
have you tried reading it in BINary format?
Kind regards,
Alvaro -
Problem in uploading file from Application Server
Hi everyone,
i got a problem in uplaoding a file from application server.i am having two folder (one folder name is current and another one is processed)in application server. In current folder i am having N no of files.I want to upload all the files names into one internal table and i want to process one by one file.After processing each file the file should be moved to processed folder and the files should not exist in current folder.All these process must be done everyday.Please rectify my problem asap.Ramesh,
Take authorization from basis guy.
Use the below code to get the list of files from require directory
*& Report ZDIRFILES *
REPORT ZDIRFILES .
PARAMETER: p_fdir type pfeflnamel DEFAULT '/usr/sap/tmp'.
data: begin of it_filedir occurs 10.
include structure salfldir.
data: end of it_filedir.
*START-OF-SELECTION
START-OF-SELECTION.
Get Current Directory Listing for OUT Dir
call function 'RZL_READ_DIR_LOCAL'
exporting
name = p_fdir
tables
file_tbl = it_filedir.
Now in internal table "it_filedir" will have all your files.
For moving and deleting
report zrich_0001.
Parameters: d1 type localfile default '/usr/sap/TST/SYS/fld1/Data1.txt',
d2 type localfile default '/usr/sap/TST/SYS/fld2/Data1.txt'.
data: begin of itab occurs 0,
rec(20) type c,
end of itab.
data: wa(20) type c.
start-of-selection.
open dataset d1 for input in text mode.
if sy-subrc = 0.
do.
read dataset d1 into wa.
if sy-subrc <> 0.
exit.
endif.
itab-rec = wa.
append itab.
enddo.
endif.
close dataset d1.
open dataset d2 for output in text mode.
loop at itab.
transfer itab to d2.
endloop.
close dataset d2.
delete dataset d1.
Check below FM if required
To move the file to archive directoryuse FMs 'PFL_COPY_OS_FILE'
To Delete 'EPS_DELETE_FILE'.
Don't forgot to reward if useful -
How to upload file in a server
Hi,
How to upload file to server through reporting. Plz guide me and what would be the probable code.
ThanksHi,
Try this Report Program.
*& Report ZUPLOADTAB *
*& Example of Uploading tab delimited file *
REPORT zuploadtab .
PARAMETERS: p_infile LIKE rlgrap-filename
OBLIGATORY DEFAULT '/usr/sap/'..
DATA: ld_file LIKE rlgrap-filename.
*Internal tabe to store upload data
TYPES: BEGIN OF t_record,
name1 like pa0002-VORNA,
name2 like pa0002-name2,
age type i,
END OF t_record.
DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
wa_record TYPE t_record.
*Text version of data table
TYPES: begin of t_uploadtxt,
name1(10) type c,
name2(15) type c,
age(5) type c,
end of t_uploadtxt.
DATA: wa_uploadtxt TYPE t_uploadtxt.
*String value to data in initially.
DATA: wa_string(255) type c.
constants: con_tab TYPE x VALUE '09'.
*If you have Unicode check active in program attributes then you will
*need to declare constants as follows:
*class cl_abap_char_utilities definition load.
*constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
*START-OF-SELECTION
START-OF-SELECTION.
ld_file = p_infile.
OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
ELSE.
DO.
CLEAR: wa_string, wa_uploadtxt.
READ DATASET ld_file INTO wa_string.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
wa_uploadtxt-name2
wa_uploadtxt-age.
MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
APPEND wa_upload TO it_record.
ENDIF.
ENDDO.
CLOSE DATASET ld_file.
ENDIF.
*END-OF-SELECTION
END-OF-SELECTION.
*!! Text data is now contained within the internal table IT_RECORD
Display report data for illustration purposes
loop at it_record into wa_record.
write:/ sy-vline,
(10) wa_record-name1, sy-vline,
(10) wa_record-name2, sy-vline,
(10) wa_record-age, sy-vline.
endloop.
Regards,
Padmam. -
Program for uploading file on application server...
Hi,
I have created a program to upload a file from presentation server (local desktop) to application server. But in this program I have to specify the file length. What should I do in given program so that I can upload file of any length on application server ?
*& Report Z_FILE_DOWNLOAD_TO_APP_SERVER *
* This Program can be used to move flat files to application server from presentation server.
REPORT Z_FILE_DOWNLOAD_TO_APP_SERVER.
PARAMETERS: P_FILE LIKE IBIPPARMS-PATH,
P_FILE1(20000) default 'E:CONVERSIONFLAT' lower case.
DATA: WS_FILE TYPE STRING.
DATA: BEGIN OF T_DATA OCCURS 0,
RECORD(20000),
END OF T_DATA.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = P_FILE
START-OF-SELECTION.
WS_FILE = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = WS_FILE
FILETYPE = 'ASC'
TABLES
DATA_TAB = T_DATA
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Creating the file at Appl server............................
OPEN DATASET P_FILE1 FOR OUTPUT IN TEXT MODE encoding utf-8.
if sy-subrc ne 0.
message e000(--) with 'Error in opening file'.
endif.
* Trasfer the records to file.............
loop at t_data.
transfer t_data to p_file1.
endloop.
close dataset p_file1.
if sy-subrc eq 0.
write: / 'Written the files at ', p_file1.
write:/ 'Goto AL11 Transaction and then click on SAP Directory DIR_SAPUSERS to look for the file'.
endif.
Please advice.
Regards,
RajeshTry declaring it as TYPE STRING. Not sure though.
There are two predefined types in ABAP with variable length:
STRING for character strings
XSTRING for byte strings
Thanks,
SKJ -
Uploading files a landing server using webutil
dear all,
i have the current situation and i'm looking for solution.
i'm using the webutil in order to upload files from the client side to a landing server, the situation here is :
when i use the following code
webutil_file_transfer.Client_To_AS_with_progress
(clientFile => :upload.file_name
,serverFile => 'd:\temp\'||l_bare_filename
,progressTitle => 'Upload to Application Server in progress'
,progressSubTitle => 'Please wait'
,asynchronous => false
,callbackTrigger => null
where d:\temp is alocal directory on the AS
but if i change the server file to a drive mapping i'll have the following error
WUT-132, my question here is it possible for the webutil to upload a file to another landing server other than AS?
how can i do it without making a hidden share to the folder ?
the other question if i have a firewall between the client and the AS, will it prevent the webutil uploading process ?i want to add another point, when we make hidden share to the map drive the uploading worked successfuly.
what i need here is a way to access the map drive without making hidden share to the map drive? -
Can't upload files to lighttp server
Hi *
I'm starting to have grey hairs abut this...
My sys is Archlinux (64bit), lighttpd 1.4.29-2, curl 7.22.
I'm trying to setup hhtp server with capability of upload files.
After basic setup I use following command to test functionality:
curl -T "test_file" http://192.168.1.254/test/
curl's output is following:
[root@mythtv ~]# curl -T "test_file" http://192.168.1.254/test/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 - Not Found</title>
</head>
<body>
<h1>404 - Not Found</h1>
</body>
</html>
Dir "test" exists & has 777.
All dirs upper to "test" also have 777.
lighttpd access log shows following:
192.168.1.254 192.168.1.254 - [24/Nov/2011:11:57:14 +0100] "PUT /test/test_file HTTP/1.1" 404 345 "-" "curl/7.22.0 (x86_64-unknown-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.0e zlib/1.2.5 libssh2/1.3.0"
My lighttpd.conf is following:
server.modules = (
"mod_rewrite",
"mod_access",
"mod_auth",
"mod_setenv",
"mod_fastcgi",
"mod_cgi",
"mod_webdav",
"mod_accesslog" )
server.document-root = "/var/http/"
server.errorlog-use-syslog = "enable"
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" , "mythweb.php" )
mimetype.assign = (
".pdf" => "application/pdf",
".sig" => "application/pgp-signature",
".spl" => "application/futuresplash",
".class" => "application/octet-stream",
".ps" => "application/postscript",
".torrent" => "application/x-bittorrent",
".dvi" => "application/x-dvi",
".gz" => "application/x-gzip",
".pac" => "application/x-ns-proxy-autoconfig",
".swf" => "application/x-shockwave-flash",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".tar" => "application/x-tar",
".zip" => "application/zip",
".mp3" => "audio/mpeg",
".m3u" => "audio/x-mpegurl",
".wma" => "audio/x-ms-wma",
".wax" => "audio/x-ms-wax",
".ogg" => "application/ogg",
".wav" => "audio/x-wav",
".gif" => "image/gif",
".jar" => "application/x-java-archive",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".xbm" => "image/x-xbitmap",
".xpm" => "image/x-xpixmap",
".xwd" => "image/x-xwindowdump",
".css" => "text/css",
".html" => "text/html",
".htm" => "text/html",
".js" => "text/javascript",
".asc" => "text/plain",
".c" => "text/plain",
".cpp" => "text/plain",
".log" => "text/plain",
".conf" => "text/plain",
".text" => "text/plain",
".txt" => "text/plain",
".dtd" => "text/xml",
".xml" => "text/xml",
".mpeg" => "video/mpeg",
".mpg" => "video/mpeg",
".mov" => "video/quicktime",
".qt" => "video/quicktime",
".avi" => "video/x-msvideo",
".asf" => "video/x-ms-asf",
".asx" => "video/x-ms-asf",
".wmv" => "video/x-ms-wmv",
".bz2" => "application/x-bzip",
".tbz" => "application/x-bzip-compressed-tar",
".tar.bz2" => "application/x-bzip-compressed-tar", # default mime type
"" => "application/octet-stream",
debug.log-request-handling = "enable"
accesslog.filename = "/var/log/web-access.log"
url.access-deny = ( "~", ".inc" )
$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
server.pid-file = "/var/run/lighttpd.pid"
server.reject-expect-100-with-417 = "disable"
fastcgi.server = (
".php" => ((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/var/run/mythtv-php-fcgi.socket",
"broken-scriptfilename" => "enable",
"bin-environment" => (
"db_server" => "localhost",
"db_name" => "mythconverg",
"db_login" => "mythtv",
"db_password" => "mythtv"
setenv.add-environment = (
"db_server" => "localhost",
"db_name" => "mythconverg",
"db_login" => "mythtv",
"db_password" => "mythtv"
cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl" )
url.rewrite-once = (
"^/{1,2}mythweb/(css|data|images|js|themes|skins|[a-z_]+\.(php|pl)).*" => "$0",
"^/{1,2}mythweb/(pl(/.*)?)$" => "/mythweb/mythweb.pl/$1",
"^/{1,2}mythweb/(.+)$" => "/mythweb/mythweb.php/$1",
"^/{1,2}mythweb/(.*)$" => "/mythweb/mythweb.php"
include "/etc/lighttpd/auth-inc.conf"
Can somebody hint me where issue might be ?
Thx n advance !@milomir,
Thx for replay.
While Your proposal is nice solution - this little now what I want to achieve.
In my application curl usage is automated (curl is called by user script).
My script has following entry:
/usr/local/bin/curl -s -f -T "<file>" "<server>/<path>/<file>"
Strange enough that I have setup which worked OK sometime ago.
Since that time I do few system upgrades - and recently I discover that posting files via curl isn't working.
Last days I was trying many combination including clean install of 64bit arch in VM and try to play with default settings.
No matter what I'm doing - all the time I'm getting 404.
I still think I miss something in configuration as i don't believe vanilla Arch/Lighttpd/Curl can't be used as http upload service with standard curt usage (like way it is used in my script).
So maybe my original Q should be following: why I can't upload files with standard curl/wget usage ?
-br -
How to list the uploaded files on the server with a jsp page
hi every body , iam stuck up with yhis problem . I a have use Random Access File to upload files to the web server , now i want the user can see the files he /she has uploaded or the the files uploaded by others . plese help me how to implement this .
Message was edited by:
joshiashutoshhi every body , iam stuck up with yhis problem . I a
have use Random Access File to upload files to the
web server ,Huh?
now i want the user can see the files he
/she has uploaded or the the files uploaded by others
. plese help me how to implement this .So get the directory using the File class the files are in and list the files inside, showing the result to the user... how difficult would that be? -
Can't access uploaded file in weblogic server
I uploaded a file using java network and io classes.The file at the server location got permissions as rw-r----- after upload.
But I am not able to access the file after this upload using java Runtime.
When I execute a cp command to copy the file to another location a "can't access" error is returned.
Tried running the server using sudo but same error.
Weblogic server-10.3.5
Operating system-solaris 10
JDK6
Running in development mode.Here is the zip file with all the code. MAIN VIDAQ is the top level.
Read VIDAQ Variables reads the .txt file.
Thanks,
Mark
Attachments:
SLDAQ Basic Software LV 2011 10.01.zip 1804 KB
Maybe you are looking for
-
How to swap out an image in a .fla file
Hi, I have an existing .swf movie and I aquired the .fla files to make edits. I found the image I want to swap out but I am not sure how to do it. I was planning on using Flash Pro to make the edit. Any help would be greatly appreciated. Thank you, A
-
Hi, I consider buying the Samsung UE40D8005 for the living room, and I want to use it together with my iMac 27 or maybe a new Mac Mini as a media centre, both for streaming content and for downloaded movies. The question is, can I expect good picture
-
I want to upload a home video to a site that only accepts .flv. My movies are .mov. Is there any conversion program that will convert .mov to .flv?
-
I am looking for a job and I can't join a CV to the website. How can I do ?
-
Two part q: sysman login and clearing alerts
Oracle 11.2.0.1.0 SE-One on OL 5.6 64bit Just got this configured a few days ago. Opened dbcontrol this morning and found a boat-load of messages about failed log on attempts (ie: 170 failed attempts in last 30 minutes) Checked DBA_AUDIT_LOG and see