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,
Raju
Hi,
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.
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. -
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 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 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 -
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. -
Issue in Uploading file to application server
Hi folks,
I need to transfer data to excel file on application server but i am facing issues while doing so.
I am working on ECC6.0 system.
I am trying with this code and it giving dump error on transfer command.
w_file = '/usr/data/020//varun.xls'.
OPEN DATASET w_file for input in text mode encoding non-unicode.
LOOP AT T_MARD.
TRANSFER string to w_file.
endloop.
CLOSE DATASET w_file.
Please help.
Is there any other way to do so please let me knowHi Got the solution :-
If the data to be transferred is having all characters then we can use this:-
OPEN DATASET w_file for output in text mode encoding non-unicode.
if sy-subrc eq 0.
LOOP AT T_MARD into wa_mard.
TRANSFER wa_mard to w_file.
endloop.
endif.
CLOSE DATASET w_file.
If all the data is not in char then - declare a char strinf of the table length.
Data: loc_string(300) type c.
OPEN DATASET w_file for output in text mode encoding non-unicode.
if sy-subrc eq 0.
LOOP AT T_MARD into wa_mard.
CALL FUNCTION 'HR_99S_COPY_STRUC1_STRUC2'
EXPORTING
p_struct1 = wa_mard
IMPORTING
p_struct2 = loc_string.
TRANSFER loc_string to w_file.
endloop.
endif.
CLOSE DATASET w_file.
Thanks for the help -
How to upload file on Application Server with Forms 6i?
Please, I need to upload .csv file from local to Application Server, I think to use .jsp application, but I don't know where I had to put it...Apache can't read .jsp file without Tomcat? If I launch my .jsp file from Apache/htdocs directory can't view .jsp code (Method Not Allowed)...method is POST...any idea? Thanks in advance!
Hi,
You could write a java bean to get the file from the client and to upload to App Server. And, you simply use it in Forms 6i.
Also, you could use d2kwutil (not tried though. you could search this forum and get an idea of that).
Of course, For your information, You could use WebUtil (in Forms 10g / 10.1.2) which has the functionality.
HTH.
Regards,
Arun -
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 -
Error in uploading file from Application server
Hi
My scenario is file->XI->Idoc.I am using a senedre file adpator
My adaptar cofiguration is
transport protocol NFS
message protocol file
Adaptor engine integration server
source directory .\ (application server path of XI)
file name invoice.xml
quality of servise exactly once
poll interval 10 sec
proceesing mode test
processing seq by namefile type text
But the problem is adaptor monitoring it is showng that it it polled succesfully with green signal
but in the message montoring it is showing "Canceled with errors"
in the detail list it is showing the error category is XI_J2EE_MESSAGING_SYSTEM
and the error code is CALL_CUSTOMER_ERROR
Any one can help me in this matter?
Thanks
Debraj RoyDebraj,
in SXMB_MONI, go through the "Trace" header section of the message and find the exact point in which the exception occurs. Paste it here.
At a glance, it seems an RFC call that fails inside the mapping... Do you use JCo & UDF in the mapping to do some lookup/check in R/3?
Let me know.
Alex -
Problem with the # in upload file of application server.
Hi All,
I have a to upload a unix file which have # after every field.
i tried " OPEN DATASET x_file FOR INPUT IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORS."
but its not working
.would appreciate if you can reply to this on immediate basis.
Thanks in advanceChiru,
You should be ok with somethign like this as long as the # is a true delimiter and not part of the data.
FORM retrieve_file.
data: wk_rec(30000) TYPE c.
CLEAR t_error.
OPEN DATASET zfile IN TEXT MODE MESSAGE t_mesg.
IF sy-subrc NE 0.
MOVE 'X' TO t_error.
MESSAGE e100(z0) WITH 'Error opening file:' t_mesg.
EXIT.
ENDIF.
DO.
READ DATASET zfile INTO wk_rec.
IF sy-subrc NE 0.
EXIT.
ENDIF.
SPLIT wk_rec AT '#' " <== your delimter
INTO in_rec-field1
in_rec-field2
in_rec-field3
in_rec-field4
in_rec-field5.
APPEND in_rec TO it_input.
ENDDO.
CLOSE DATASET zfile.
Edited by: Paul Chapman on Apr 14, 2008 3:27 PM -
Payment advice(F110) to be saved as file in application server
Hi Experts
my requirement is i have to send the payment advice created from F110 to respective vendors as mail in Alias name and i am able to send it succes fully with BTE2040. but the client came up with new requirement that we have to save this payment advice form send to vendor in applicattion server in the same format ( i.e., PDF form). i tried searching for any user exit (or) BTE but couldnot get so, can you please give my your suggetion, how to achive this task.1.You can send and save the pdf form in the same BTE EVENT 2040.
2.How to save the PDF-BASED form to application server.
Transaction CG3Z for uploading file to application server
Transaction CG3Y for downloading file from application server
I think you can use BDC to revord CG3Z and then use it in code of BTE2040. -
Error in Reading the file from Application Server
Hi,
This Error is regarding one of my interface, the issue is that , the interface reads data from file in bunch suppose 100 records at a time , then processes those records and once finished go for next 100 records .
Noe the error is that , the process takes place till 500 records correctly but when it went to fetch for next 100 i.e fom 501 to 600 it selects only 501 to 583 .
this records has been processed successfully but the job finished there only
but the file contains 788 records
When the same file has been run in other server it ran successfully without such error .
Can you please suggest how to resolve the issueHi,
Try to manually download the file from application server using standard transactions, and than check how many records are you able to download from app. server.
I guess there might be something wrong with the format of 583rd record, which makes sap assume that the file has come to an end.
Hope this will help you.
Regards,
Vinit... -
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,
JerinJerin,
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 -
How best store files on application server: Tables vs File system
Hi Experts,
We want to let users to upload files to application server. The number of files can potencially grow over time (1000 files every month) though I whould like to limit size of each file not more than 1-2 MB.
Also files should be classified (having custom attributes) so later on we need to search, select files according to attributes.
So what are the best options in long run (for performance, reliability etc)?
We have NW system 7.0 with MaxDB
I can think of the following options:
1. Store files in TRANSPARENT table in RAWSTRING. Easiest variant (to select files etc) Here I have concerns how this table and database behave after some period of time and what will happen if size will grow to let say 50 GB. Will it work? What are normal size limits for transparent tables?
2. Store files in CLUSTER table in RAWSTRING. Less convenient to work with (joins are not allowed etc). Will cluster table help to handle big size of table? What are practical size limits for cluster tables?
3. Store files on file system (on application server) and write info (attributes etc) into ztable. Select from ztable and read content file from file system (dataset commands?). So files will be written to one directory just one after another.
What are the best option to follow? I would personally prefer option 1 as easiest but have servious concerns regarding size of one transparent table.
What do you recommend?
Regards,
Dmitry.
Edited by: Dmitry Kalmykov on Jul 28, 2009 8:58 AMHi,
I too feel that option 1 would be best choice.
For your ref: Check the Transp.table REPOSRC and the field name DATA
Also Check the technical settings (Size category).
Maybe you are looking for
-
Workflow for Sales Order Release via Status Profile
Dear all, i want to make a workflow for sales order which have 4 User Status in One status profile. Once Event triggered for sales order 1. Mail should go to main authority with sales order number. 2. Once authority will do some changes in the req
-
Would really appreciate some help on this one. I've had a good search around... it's not clear to me where to get the 64 bit version of the driver install files.
-
Adobe Patching / Versioning / sanity checks...
All right... Psyche... Unlike the title, it seems Adobe knows nothing of these things... Am about to lose the plot with Adobe nothing anywhere, ever, should be as tiresome and soul sucking as not only over-frequent patching cycles, but the seeming
-
Dear all, I am trying to create a form with an option to strike through either one the words "Yes" or "NO" as shown below". I cannot find anyway to do so, but I do see some forms download from the internet can do it. Please help. Q1. Are you a xxxx?.
-
Drop zone content fills entire screen for some reason. Help!
Hi, everyone. I've used iDVD for years, but have not had this problem before. I'm trying to use the 4:3 template called "Projector". There is only one drop zone, which should show what the projector is playing. However, when I right click the area an