How to Run Batch files from inside Reports.
Hi All,
I have 2 questions.
1) How to change the direction of the reports with Arabic orientation i.e Right to left Change without changing the registry.
2) How to execute a batch file from report or before execution of the report i.e before opening the report.
I want to set few environmental variables before opening the report. How do i achieve this?
Request the forum community to discuss and help me out on this issue.
Thanks in advance
Thanks Inol
Though my report is running NLS variable values given in the batch file is not getting picked.
Here is my batch file contents. My NLS Variables are not getting picked in the reports. I want that to be picked up and the reports orientation should change automatically as per the NLS variables given in the batch file.
Please go through my batch file code.
set NLS_LANG = AMERICAN_AMERICA.UTF8
set NLS_CALENDAR = GREGORIAN
set NLS_DATE_FORMAT = dd/MON/yyyy
set FORMS60_PATH = <Enter Relevant Path>
set REPORTS60_PATH = <Enter Relevant Path>
set PATH=%PATH%;c:\forms6i\bin
set ORACLE_HOME = c:\forms6i
set TNS_ADMIN = c:\forms6i\NET80\ADMIN\TNSNAMES.ORA
rwrun60.exe d:\DOTNETORION17_bin\elist_rg1.rdf userid=scott/tiger@thai P1=10Please help me out in getting this value picked and run the report.
Similar Messages
-
How to run batch file from oracle forms 9i
Hi everyone.
i have a data in csv file. i want to upload it to my database. i am using sql loader for it.
i have made a batch file which run the sql loader and transfer my data to database.
How to run batch file from oracle forms 9i.
when i press the button, nothing uploads in my database. (when i simply run the batch file it works).
here is my code
Begin
HOST('C:\temp\batchfile.bat');
message('done');
end;
Thanks in advance
regards
sajidthis is my log file, when i run manually.
SQL*Loader: Release 10.2.0.1.0 - Production on Thu Jul 1 23:27:53 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: file_to_upload.ctl
There are 2 data files:
Data File: sk.csv
Bad File: sk.bad
Discard File: none specified
(Allow all discards)
Data File: sk1.csv
Bad File: sk1.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table KHAN, loaded from every logical record.
Insert option in effect for this table: APPEND
Column Name Position Len Term Encl Datatype
SR FIRST * , O(") CHARACTER
DATES NEXT * , O(") CHARACTER
AGENT NEXT * , O(") CHARACTER
COUNTRY NEXT * , O(") CHARACTER
TRANSACTIONS NEXT * , O(") CHARACTER
PKR NEXT * , O(") CHARACTER
USD NEXT * , O(") CHARACTER
BANK NEXT * , O(") CHARACTER
Table KHAN:
11088 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Space allocated for bind array: 132096 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 11088
Total logical records rejected: 0
Total logical records discarded: 0
Run began on Thu Jul 01 23:27:53 2010
Run ended on Thu Jul 01 23:27:54 2010
Elapsed time was: 00:00:00.63
CPU time was: 00:00:00.17 -
How to run exe file from inside java
I wan to run an exe file from inside java code. How can I do it?
ThanksHi Oakam
This is very simple. Just go through the given code below
in place of FILEANDPATHNAME just give the exe's path and name
Note :- adding ".exe " is not necessary
public class exep
public static void main(String args[])
Runtime r = Runtime.getRuntime();
Process p = null;
try{
p = r.exec("FILEANDPATHNAME");
catch(Exception e)
Give ur feedback
Thanx
Ottran -
Error running batch files from java source file???
Dear Friends,
hi,
this is with response to a doubt i had earlier ,
i want to run batch files from the java source file ,i tried using this code (here batrun is the batch file name that contains commands to run other java files)
try
String [] command = {"c:\\vishal\\finalmain\\batrun"};
Runtime.getRuntime().exec(command);
catch(Exception e)
but i got the following error.
java.io.IOException: CreateProcess: gnagarrun error= 2
plz. help me, i tried all combination w/o success,
in anticipation(if possible give the code after testing)
Vishal.hello there,
i solved the prob. by using
cmd /c start filename ,but i need to pass parameters ie
cmd /c start java "c:/vishal/runfile a b" where a and b are the parameters. but it is not accepting this in Runtime.getRuntime.exec(),
any solutions ?????????
regards,
Vishal -
How to execute batch file from JSP
hi frens !
i wanna know how to execute batch file from my JSP.i am using exec() method to get call the batch file. but its not working ....plz help
here mine code:-
File F = new File("C:/var.bat");
try{
if (F.exists())
Runtime rt = Runtime.getRuntime();
String url=F.getAbsolutePath();
Process proc = rt.exec(url);
proc.waitFor();
proc.destroy();
catch(Exception IOEx){
System.out.println(IOEx);
}Thanks and Regards
AllwynYou might improve your chances of getting help if you do two things:
1) Explain what "not working" means.
2) ChangeSystem.out.println(IOEx); to IOEx.printStackTrace(); (in the eventhat is in fact related to "not working"). -
Running batch files from Java using exec method
Hi,
I want to run a batch file from my Java program like this:
try {
Process proc = Runtime.getRuntime().exec("C:\\Refresh.bat");
catch (Exception e) {
MessageBox.show(e.getMessage());
Refresh.bat file contains two commands.
First one unzips certain zip file.
Second one refreshes a SQL Server database using osql utility.
Problem is that when program is run it executes only the first command and hangs on the second one.
Please help.
TIA
RavinderFrom the FAQ:
2. How do you launch an external program on a Microsoft Windows platform from a program developed on the Java [tm] programming language?
The following will launch notepad in Microsoft Windows NT:
Runtime.getRuntime().exec("cmd /c notepad.exe");
To launch a program in Microsoft Windows 95/98 use:
Runtime.getRuntime().exec("c:\\windows\\notepad.exe");
The Runtime class allows interaction between a program and its environment. The first string command instructs the command line interpretor, cmd to open up the calculator application.
The exec() methods do not use a shell; any arguments must have the full pathname to the shell as well as the command itself.
For example, to run a shell on the UNIX� platform, type:
Runtime rt = Runtime.getRuntime();
Process p = rt.exec("/usr/bin/sh -c date");
To run a batch file under Microsoft Windows 95/98:
Process p = rt.exec("command.com /c c:\\mydir\\myfile.bat");
To run a batch file under Microsoft Windows NT:
Process p = rt.exec("cmd /c c:\\mydir\\myfile.bat");
where 'cmd' and 'command.com' are the command-line interpreters for Microsoft Windows machines.
The Runtime.exec() methods might not work effectively for some processes on certain platforms. Special care should be taken with native windowing, daemon, WIN16/DOS process or some shell scripts.
regards,
jarshe -
How to run .cmd file from a Powershell script
Hi,
I would like to know how I run commands from a powershell script? how to use the invoke-command?
This powershell script doesnt work for me
Invoke-Command C:\setup.cmd -ArgumentList install-setupforcedTo run a batch file from powershell, just type its name with arguments. I'd recommend explicitly including the .CMD file type and, if it is located in the current folder, powershell rules require you to explicitly say so, i.e.:
./mybatch.cmd inputfile.txt outputfile.txt
To run a single cmd.exe command, just prefix it with cmd.exe /c as Mike says:
cmd.exe /c color 48
to run a series of "&"- separated cmd.exe commands you need to enclose the complete command string in double quotes:
cmd.exe /c "color 37 & dir"
Beyond that it can get complicated due to various characters that are special to powershell and those special to cmd.exe. If you need to run a series of cmd.exe commands, your best short term bet is to put them in a batch file. The best long-term bet is
to move more completely to the powershell way of doing things...
Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate. -
How to create .csv file from ABAP report
Hi
We have a requirement to generate .csv file from abap report.
Currently user saves data from abap report to spreadsheet(.xls format) in desktop. Then opens excel file and save as .csv format. Need option to save directly in .csv format instead of .xls format.
Please let me know, if there is any standard function module available to create .csv file.
Regards
UmaI tried with your code it's going to dump
REPORT ZTEMP101 message-id 00.
tables: lfa1.
types: begin of t_lfa1,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
end of t_lfa1.
data: i_lfa1 type standard table of t_lfa1,
wa_lfa1 type t_lfa1.
types truxs_t_text_data(4096) type c occurs 0.
data: csv_converted_table type table of TRUXS_T_TEXT_DATA.
select-options: s_lifnr for lfa1-lifnr.
select lifnr name1 from lfa1 into table i_lfa1
where lifnr in s_lifnr.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = ';'
I_LINE_HEADER =
I_FILENAME =
I_APPL_KEEP = ' '
TABLES
I_TAB_SAP_DATA = I_LFA1
CHANGING
I_TAB_CONVERTED_DATA = csv_converted_table
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.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = ' '
CODEPAGE = ' '
FILENAME =
'C:\Documents and Settings\ps12\Desktop\Test folder\exl.cvs'
FILETYPE = 'DAT'
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = csv_converted_table
FIELDNAMES =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
my version is 4.6c -
How to run SQL files from Java?
Hi,
Can someone point me towards a link on how to run sql files in Java? Thanks.
P.S...if I've been completely blind please go easy on me!Sorry forgot the formating code thingy
public static boolean executeScript(File script, Connection conn){
boolean success = true;
success = script.exists();
if(success){
DEBUG.print("ES::READING SCRIPT:" + script.getAbsolutePath());
StringBuffer buffer = new StringBuffer();
success=readScript(script,buffer);
if(success){
try{
String creationScript = buffer.toString();
Statement st = conn.createStatement();
int start = 0;
int end = 0;
while (end != -1 && start < creationScript.length()) {
end = creationScript.indexOf("GO", start);
if (end != -1) {
DEBUG.print(creationScript.substring(start, end));
st.executeUpdate(creationScript.substring(start, end));
start = end + 2; //2 is the length of "GO"
st.close();
}catch(Exception e){
success=false;
DEBUG.printStackTrace(e);
}else{
DEBUG.print("ES::SCRIPT FILE DOES NOT EXISTS");
success=false;
return success;
public static boolean readScript(File script, StringBuffer buffer){
boolean success = true;
DEBUG.print("RS:: reading file :" + script.getAbsolutePath());
try{
InputStreamReader isr = new InputStreamReader(new FileInputStream(script),"UTF16");
int ch;
while ( (ch = isr.read()) > -1) {
buffer.append( (char) ch);
if (isr != null)
isr.close();
}catch(Exception e){
success=false;
DEBUG.printStackTrace(e);
return success;
} -
How to run batch file using trigger?
Hi, i am trying run a batch file using a trigger on a table.
say i have a table XYZ(col_1 varchar2 primary key, col_2 varchar2)
the values of col_2 keeps changing and col_1 are constant
whenever the value of col_2 in any row changes from "on" to "off" i want to run a batch file C:\Users\ABC\Desktop\test.bat
i did some searching but couldn't find any solution. Thanks in advance
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production>
the script will be started around 60-70 times a day
>
No - as marwim said the script will be executed every time the trigger is fired. And that trigger, depending on how it is written, might be fired several times for the same transaction.
And if the trigger is fired the script will be executed even if the transaction that caused the trigger to fire issues a ROLLBACK.
Triggers are non-transactional. You need to clearly define the business rules for when the script should run. Should it run only when the transaction is COMMITTED? Or should it run if the transaction executes even if the transaction performs a ROLLBACK?
A trigger is the wrong solution for your problem.
Please clarify what the business rules are that should control the execution of the script. -
How to run .html file from .java file..?
Hi All,
I was just trying as mentioned in the subject of how to run an html file from a java file.We have runtime class which inturn is having exec method which returns process but it supports only .exe as an argument .Is there any way to do this???
Thanks in advance.viswa07 wrote:
You mean to say Desktop class in java...???I'm so sorry, I thought you knew enough Java to look up the API.
[This link|http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html] might be more at your level.
db -
How to run batch files in the backround ??????
please anyone tell me how to run the batch files in the background i dont want anyone to interfere the batch file..The batch file has to run for a long time even days so it will be safe if the batch file is running in the bachgroung somewhere ..
please help me in this regards
Thanking u
Regards
SanthoshThe easiest way is to write a native application which starts the batch file in hidden mode (the target batch file could be an argument).
Under Windows it would be done with the API call
ShellExecute(NULL, "open", "C:\mybatch.bat", NULL, NULL, SW_HIDE);
Then compile the native tool as windows application with no user interface. Now you are able to execute applications in invisible mode. -
How to run perl file from java file..???
Hi All,
How to run a perl file from java file.I know that there is one JPL(Java-Perl Library) preprocessor which can be used to do this,but no idea of how to do it..
Any help is appreciated.
Thanks in advance.viswa07 wrote:
Ok and any idea regarding JPL..????I don't know it and the first few posts that I found mentioned it using Java 1.1-style JNI calls, which hints at a dead project. And you don't want to use a dead project. -
How to run Sync RFC from a report prog
Hi Everybody,
COuld you guys pls tell me how to execute Sync RFC using a report. I have written this code but it gives error.
data wa type c.
CALL FUNCTION 'Z_HR_NO_ALTINN_TX' DESTINATION 'Q3A2X7A'
exporting
PASSWORD = 'k'
importing
status = wa.
commit work.
Pls guide.
Regards,
AshishThanks Michal for your reply.
To answer your questions:
I tried with commit work.
data wa type c.
CALL FUNCTION 'Z_HR_NO_ALTINN_TX' DESTINATION 'Q3A2X7A'
exporting
PASSWORD = 'k'
importing
status = wa.
2) Yes my RFC Destination is working.
3) Sorry I didn't get your third question. Could you pls elaborate a bit more.
This is the error i get when i execute the above report.
<b>ShrtText</b>
"call to messaging system failed: com.sap.aii.af.ra.ms.api.DeliveryEx
<b>What happened?</b>
Error in ABAP application program.
The current ABAP program "Z_ALTINN_TEST" had to be terminated because
the
statements could not be executed.
This is probably due to an error in the ABAP program.
The error occurred in an RFC call to another system.
The target system has also written a short dump.
Consult this short dump for more precise information about
the cause of the error.
<b>Error analysis</b>
An error occurred when executing a REMOTE FUNCTION CALL.
It was logged under the name "RFC_EXTERNAL_ABORT"
on the called page.
Ashish -
How to excute a batch file from Analyzer Report
Hello, I trid to use the service launch executable and in the browse i used a batch script which doesn't execute when i click on the button.
If only the forum were searchable! If only those anwers in the past could be found! Friend, we will walk through the desert for 100s of years but this day will come.
Maybe you are looking for
-
Quicktime not playing the the complete mpeg2 file
I have QT pro with the mpeg2 component so I can play back mpeg2 files. However, when I get about 13 minutes on to the movie the frames stop but the slid bar continues to advance. I have checked to make sure that the movie and file is complete. I can
-
CD rom does not appear in boot menu in lenovo G500 windows 8
Hello I want to format my lenovo G500 windows 8 and install windows 7 but I can't because the CD rom does not appear in the boot menu Solved! Go to Solution.
-
Mobile Business Intelligence - Study
Hi everyone! I'm studying Information Management at Tilburg University, The Netherlands and I'm conducting a mobile business intelligence (BI) research to earn my master degree. This research aims to measure mobile BI success by examining the net ben
-
Dependent Demand not genarated
Hi Experts, My client product structure starts from 1*****, 2***** and so on to 7****** that is we have 6 level BOM. Final FG is 1*** and 7*** is raw material. 1 will be procured from vendor1 by providing component 2 to vendor1. 2 will be procured fr
-
Revision: 10959 Author: [email protected] Date: 2009-10-09 13:38:19 -0700 (Fri, 09 Oct 2009) Log Message: Adding support for FXG 2.0 additional blend modes that do not have a SWF equivalent. For the optimized FXG case, we now generate an Actio