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 advance
Chiru,
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
Similar Messages
-
Problem with Dataset While downloading file to Application server
Hi friends,
My report downloading some data to Application server in Unix Environment. When i am seeing that dataset, contents of the last field getting truncated. I specified length of the file which is greater than the record length, but still values are truncated. Its very urgent please send me the solution ASAP.
Thanks & Regrads,
Ramesh.Please provide me a solution
-
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. -
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 with the Maximum lenght string on application server file
Hi,
I have one internal table which cotains aroung 200 fields. The total lenght of the all fields is around 2000 charr.
I am using open data, transfer and close data set to put my file on application server.
I am looping at my internal table and then transfering the data on server file.
The problem is that after generating the file on application server i couldnt see all the fields. i can see only around 500 char.
not all the data.
Does there is maximum limit on the number of char on application serevr.
or there is complete record but we cant see,
kindly help.Hi Sachin,
As Rainer said you cannot see the full length of row in AL11. The visible length is restricted. If you want to re-confirm whether all data are in. Then download the file from application server to your local system and see the contents. It will be to 2000 characters which you passed.
Hope this helps. -
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 -
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 -
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 -
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 -
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 -
Problem with the Creative Setup Files.
Hey,
I've got the Creative SB X-Fi? Xtreme Audio. When installing from the disk I get several errors, the main one is Error I-00 - and the install.log says:
[Creative Console Launcher]
GUID={888347B3-AEC5-4BB5-8BAB-78D72A57C73}
[Console Launcher]
Error=I-00 C:\Program Files (x86)\Creative\Sound Blaster X-Fi\Console Launcher\ACMixer.dll not found.
I cannot find an ACMixer.dll anywhere, not on the cd, not on the downloaded installation file, not on google.
What can I do?
Kind Regards
DaveHi Rams,
I don't think it is possible to do updates to the APEX_APPLICATION_FILES table. What you will need to do is create a process that selects the required information about your uploaded files, and then inserts it into a custom table inside you schema.
Then modify your report, and form so the select and update statements run off the custom table and not the APEX_APPLICATION_FILES table.
Its a bit of a long winded way of doing it, but there is examples in the HowTo's at the following URL:
http://download-uk.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm#CIHHEHCJ
Hope this helps,
Cj -
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 -
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. -
How to know the first placed file in Application server directory
Hi All ,
i want to Know the First plased file in a application server directory . i have tried with
FM EPS_GET_FILE_ATTRIBUTES but it is giving the file size. Can anybody give some idea to get the file lastmodify property.
Thanks & Regards
Prithvi.Hi Prithvi!
Use the methods of class CL_GUI_FRONTEND_SERVICES (if your release is at least 620, sorry otherwise).
Method DIRECTORY_LIST_FILES will give you all files of a directory, then you can check with method FILE_GET_ATTRIBUTES for some date info.
But maybe you can agree about a timestamp in the filename - this has to be set by the sender, but is much easier and reliable, too.
Regards,
Christian
Maybe you are looking for
-
Calendar Analytics application won't install with MS Office 2013 on PC
I use Calendar Analytics, a Microsoft approved application, to analyze Outlook Calendars for utilization rates within my facility. It has worked well for me for several years. Since I upgraded to Microsoft Office 2013, I cannot get Calendar Analytics
-
Please help, I reset my Apple Id and my iMessage is working properly on my iPhone but now all of the conversations on my Macbook say "offline"
-
Was with o2 who Sky took over. Didn't want to go with Sky so decided to go with Bt Infinity +Calls+Bt TV. Signed up online on 25th July and phone went live on 13th August. By 15 Aug not heard about Infinity so rang (after holding on for about an hour
-
Query Builder dynamicly change the request
Hello, I use VS2010 with ODT 11.2.0.1.1 and I have strange behaviour with the "Query Builder"... When I enter this request: SELECT ARTICLE_PCH.AP_CODE ....ARTICLE_SAP.AS_USAGE_UNIQUE FROM ARTICLE_SAP, ARTICLE_PCH WHERE ARTICLE_SAP.AS_NUMERO = ARTICLE
-
How to get a a contact book pic into my camera roll?
So, I take a picture with my iphone by going into the contact book and choosing take picture in edit mode, but the picture is only used in the contact book. How do I copy the picture into my camera roll?