Rename the file in application server
Hi Experts,
I want to rename the file which is in Application Server.
E.g:- Current File in Application Server is '\user\sd\file1'
I want to change the above file name to '\user\sd\file1_old' in Application Server.
Please help me if any one aware of this.
Thanks & Regards,
Chandu
Hello,
What you want to do is execute a command on the host operating system.
This can be done with function module SXPG_COMMAND_EXECUTE.
This module will execute commands that have been predefined in SAP. To see what is available look in SM49.
If you have the autorizations you can create your own or ask for it to be created.
More general information can be found [here|http://wiki.sdn.sap.com/wiki/display/ABAP/CreationofExternalCommandswiththehelpofUNIXCodingin+SAP].
Hope this is helpful.
Similar Messages
-
How to rename a file in Application server
Hi All,
Here I have a issue with the present file which is being generated in application server.
Before the completion of the file the EDI tool is extracting the file from the app server.So here I would like to generate the file with a temp name and then rename to the actual file name which EDI recognises and fetches.
Please correct me If I am wrong and let me know how to rename the file in application server.
Thanks,
Vijay Nyou can try using unix command , if your application server is unix.
use move command
mv <source> <target>
REPORT ZUNIX line-size 400
no standard page heading.
data: unixcom like rlgrap-filename.
unixcom = 'mv file1 file2'.
data: begin of tabl occurs 500,
line(400),
end of tabl.
data: lines type i.
start-of-selection.
refresh tabl.
call 'SYSTEM' id 'COMMAND' field unixcom
id 'TAB' field tabl[].
or else you can open dataset/ read the dataset and move it to another file and delete the old file. -
Regarding Reading the file from Application Server
Hi,
I am trying to read data from Application Server but due to special characters it is getting dumped out.
US24,Q,Acero (Carbon),AA,0010,0001,01,Ver Mir para dimension#
US24,Q,Acero (Carbon),AA,0010,0002,01,Area rectificada sin da#os ra
US24,Q,Acero (Carbon),AA,0010,0003,01,Ver Mir para dimension#
US24,Q,Acero (Carbon),CD,0010,0001,01,ITPE Soken para verificacion
US24,Q,Acero (Carbon),CD,0010,0010,01,No se permite desprendimiento
US24,Q,Acero (Carbon),CD,0010,0002,01,"Vernier, cinta metrica"#
In the last line it is going into dump due to special character ".
Please suggest.
Thanks
Priyanka.Hi,
You can check the mode in which you are reading the file
from application server that is
Open Dataset in Binary or Text Mode.
Hope it helps
Regards
Mansi -
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... -
Append data into the file in application server
Hi Friends,
I have an issue where i have a job which has three different stepst for same program. If i run the job the program will create a file in the application server and append the other two steps in the same file without overwriting the file or creating a new file.
My problem is like its creating three different files in application server for that particular job since it has three steps . Its not appending into one particular file .
I am using the FM 'Z_INTERFACE_FILE_WRITE' where i have used the pi_append in the exportng parameter . ITs working when i specify the file in local system. It is appending correctly when i run the report normally to apppend into local system.
But when i schedule a job to append the file in application server its creating three different files.
Kindly help me if anyone is aware of this issue
Thanks in advance
KishoreHi,
Please use open dataset to write and append files.Please check the logic of Z FM which you are using .
To open and write into a file use
OPEN DATASET FNAME FOR OUTPUT.
To append data into existing file use
OPEN DATASET FNAME FOR APPENDING.
To write into file:
v_file = file path on application server
OPEN DATASET v_file FOR output.
IF sy-subrc NE 0.
write:/ 'error opening file'.
ELSE.
TRANSFER data TO v_file.
ENDIF.
CLOSE DATASET v_file.
For appending :
OPEN DATASET v_file fOR APPENDING.(file is opened for appending data position is set to the end of the file).
Thanks and Regards,
P.Bharadwaj -
Problem while dowloading the file from Application Server
Dear Experts,
I am facing the Problem while downloading the file from Application server.
We done the automatic function while saving the invoice, this will create an idoc, and this idoc is written in the Application Server.
I am running the Transaction AL11 and select the record, and from menu --> List, i am downloading into TXT format.
But for some segments, the length is long, and so the last 3 to 4 fields values are not appearing in the File. Even though i am unable to view the values in the file before downloading. But i can view in IDOC.
Please help me to solve this issue.
Thanks & Regards,
Srinibut our user will use the Txn. AL11 and they will download from there
Educate the user On a serious note, tell him this is not how data from app server should be downloaded. You can ask him to talk to the basis team to provide him access to the app server folder where the file is being stored.
I can set the Variant and put this in background, But always the file name will be change, Like we use Time stamp in the File name.
You can't automate this process by scheduling in BG mode. This is because the in BG mode you can't dwld the file to presentation server.
Hope i'm clear.
BR,
Suhas -
Gui_download function to download the file in application server in bdc
Can we use gui_download function to download the file in application server in bdc?
Regards,
pandu.for downloading the file on application sever you use the concept of Dataset. GUI_DOWNLOAD is for presentaion server.
regards
Abhi -
Need a pipe delimiter after every field in the file on application server
Hi ,
i have to transport data in internal table to a file on application server.
I have done this successfully. But the problem is i have to put a pipe
delimiter after every field in the file on application server.
Could yoe plz help in this issue.
Thanks & Regards
Suresh kumar DHi Should,
I think the below code should solve your problem as i also had a similar type of requirement and this was the code i had used in my program.
FIELD-SYMBOLS: <FS> TYPE ANY.
DATA: L_FLINE TYPE STRING.
Open file for output
M_CHECK_SELSCR_FNMS O1 O.
LOOP AT I_TARGET.
Write records to file
DO.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE I_TARGET TO <FS>.
IF SY-SUBRC EQ 0.
IF SY-INDEX EQ 1.
MOVE <FS> TO L_FLINE.
ELSEIF <FS> NE C_PIPE.
CONCATENATE L_FLINE C_PIPE <FS> INTO L_FLINE.
ELSE.
CONCATENATE L_FLINE <FS> INTO L_FLINE.
ENDIF.
ELSE.
TRANSFER L_FLINE TO W_SRVR_NM_O_O1.
EXIT.
ENDIF.
ENDDO.
ENDLOOP.
Close file
CLOSE DATASET W_SRVR_NM_O_O1.
IF SY-SUBRC EQ 0.
MESSAGE S208(00) WITH TEXT-M02.
ENDIF.
Regards
Sikha -
How to provide the F4 functionality to the files on application server
Hi,
How to provide the F4 functionality to the files on application server at selection screen.as it is F4_FILENAME for files on desktop , is there any Function module for this purpose also. I did a search in R/3 but didnt get any FM .Please advise.
Regards,
sam.You can get to it using frontend class CL_GUI_FRONTEND_SERVICES if you know the host name and have the correct permissions, for example, this program works great for me in my system.
report zrich_0001 .
data: ifiletable type filetable.
data: xfiletable like line of ifiletable.
data: rc type i.
parameters: p_file1 type localfile default'\sapprdusr'.
at selection-screen on value-request for p_file1.
call method cl_gui_frontend_services=>file_open_dialog
EXPORTING
* WINDOW_TITLE =
* DEFAULT_EXTENSION =
* DEFAULT_FILENAME =
* FILE_FILTER =
INITIAL_DIRECTORY = '\sapprdusr'
* MULTISELECTION =
changing
file_table = ifiletable
rc = rc
* USER_ACTION =
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
others = 4.
read table ifiletable into xfiletable index 1.
if sy-subrc = 0.
p_file1 = xfiletable-FILENAME.
endif.
Regards,
Rich Heilman -
Regarding uploading the file from Application Server
I am trying to upload a .csv file to Application Server through CG3Z tcode.
But i am getting dump ad below..
What happened?
While a text was being converted from code page '4102' to '1100', one
the following occurred:
- an character was discovered that could not be represented in one of
the two code pages;
- the system established that this conversion is not supported.
The running ABAP program, 'SAPLC13Z' had to be terminated, since the
conversion could cause incorrect data to be generated.
1 characters could not be represented (and thus could not converted).
If 1 = 0, a second or a different error has occurred.
Please let me know..how can i resolve this??
Thanks
PriyankaCheck if your CSV file is UNICODE encoding.
If CG3Z steel not works you can check on OSS SUPPORT if a note solve your problem. -
Error Loading the file from application server
Hi Team,
I'm trying to load the .CSV file from application server and I'm getting the error message.
In the data package
Update to PSA --Green
Transfer Rule -- Green
Update Rule - error ABORT was set in the customer routine 9998
Error 1 in the update
Please help me to provide the solution.
But when I try to load the other files there are no issues. thanks.
Regards,
SenthilRaj
check the below links, which can helps to solve your issues
Flat file data load
flat file Data loading issue
Mahesh -
FM to get the file from application server to presenatation server automati
Hi!
In my upload program I am egtting the error log file onmy application server directly. Is there a function module or a way that in my abap code I can mention to bring the file or transfer the file to the presentation server . As my program is been run in the back ground so I cannot directly get the file on the presenattion server, so I need to bring it back on teh presentation server back to see teh eror log.
I would like my program to do the transfer in background itself so that I can see the error log on a daily basis from my local file .
Thanks
when 'X'. "X is application server
* TRANSLATE p_err USING '\/'." correct slash for unix
open dataset p_err2 for output in text mode encoding default.
if sy-subrc = 0.
loop at t_err into s_nts.
transfer s_nts to p_err2.
if sy-subrc ne 0.
message i010(ad) with p_err2 'Download Failed'.
endif.
endloop.
close dataset p_err2.
else.
message i010(ad) with p_err 'dataset could not be found'.
sy-subrc = -1. "Maintain error condition
endif.
* endif.
when ' '. "Blank is presenation server
translate p_err using '/\'."correct slash Dos file
call function 'DOWNLOAD'
EXPORTING
filename = p_err
filetype = 'ASC' "FTYPE set to DAT in DATA seg
TABLES
data_tab = t_err.
if sy-subrc ne 0.
message i010(ad) with 'File ' p_err 'cannot be located.'.
sy-subrc = -1. "Maintain error condition
exit.
endif.
endcase.
ENDIF.
ThanksSO , after reading all , I assume that there is no way in which when I run the background job and get a errro file on application server can be retrievd on my presenattion serevr during the background job run. I was thinking that theer might be a functionn module which will convert the application server file into presenttion server file during the program run in background and store it in the location provided.
I was trying to use FM CALL FUNCTION 'C13Z_APPL_TO_FRONT_END' and CALL FUNCTION 'ARCHIVFILE_SERVER_TO_SERVER' but using teh first one asks for source file and destination file name during teh program run and as it runs in background it cannot be provided again and again and teh second one dosent seem to work.
Thanks -
Could not open the file in application server
Hi All,
I have a Zreport which will write files on application server. When I tried to download it is showing me "Could not open the file". And when checked again with /nal11 the files does not exist. When I ran the Zreport again the file exist in application server but unable to download. And when checked again the file doesnot exist. Why it is getting archived? Please help me.
Thanks,
VenkataHi Sagar,
Below is my file path : /dv2/tmp/instl/salesdata.txt
When I checked in the below path the file exists.
/dv2/tmp/archive/salesdata.txt
Solved the issue.
Thanks,
Venkata -
Not recognizing # while reading the file from application server
Hi
I am reading a file from application server. While reading into internal table with read statement the last field in each record is filling with hash symbol in the last digit. If I write any if condition with HASH symbol its not going inside the if condition, means its not recognizing as hash may be its internally treating as some other. I need to remove the hash from that field. How I can do that.
Thanks,
kishoreI faced exact situation. Yes, internally its treated as some other special character. What i did was, becuase hash symbol was always coming at the end...i created a dummy field in my internal table so that it will not interfere with my actual data. When i see the data in my internal table, the hash always falls in the last field (dummy) which i will ignore. I could not get solution to remove this hash so i adopted this approach and it worked!!
Hope it helps,
SKJ -
How to send the file in *application server* as an email?
Hi,
I have a file in application server and I want to send that file as an email from application server.
Please let me know how to do it.Hi Suman,
look here:
Re: How to send an email from Application server?
Regards, Dieter
Maybe you are looking for
-
Applescript create folder from filename and move file stopped working
Hi, For a while I've used this script but after upgrade and a new machine it stopped working. I have Mac OS 10.8.5. This is what I have. Images (folder) 111111_00.jpg 111111_01.png 222222_01.jpg 222222_02.png 222222_03.gif I'd like to be able to cre
-
Changing Selection Criteria in Current DataSources
I am pulling in financial information from BSEG into BW. BSEG is a massive table with a lot more information than I care to pull in for my purposes. I would like to be able to select a range of GL Accounts to pull in, but I cannot find a way to mak
-
Using a .DMG versus duplicating in Disk Utility
Hi All, In Disk Utility, Help has a page for "Duplicating a CD or DVD" which utilizes creating a Disk Image and burning that image to a new DVD. As I have 2 drives, I tried to use te "restore" tab and simply drag the source and destination DVDs to th
-
XI usage in cProjects 4.0
I am trying to integrate the shopping cart in cProjects 4.0 with SRM via XI. Can you let me know which communications method is used? If message type is used, what is the IDOC name? Is RFC or BAPI used for this message flowing? Thanks YK
-
Could not enlist XAResource!
Hello All, I am using JBoss.3.2.X and we have more than one database in application. We are getting this exception. We are not facing any probelms when we getting the connection for the first database , but when i am trying to get the connection for