Can we make ABAP program as executable file
Hi All,
I have query related to abap program.
<b>Can we make ABAP program as .exe file or .bat file.</b>.
<b>If yes then what is the procedure to do the same.</b>
I would really appreciate if anyone can suggest something on this.
Regards
Prabhat
No you can not. Why? Because ABAP is a proprietary language developed by SAP which only runs in the ABAP runtime environment.
Regards,
Rich Heilman
PS.
Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
Spread the wor(l)d!
Message was edited by: Rich Heilman
Similar Messages
-
Can we make ABAP programs Unicode enable after SAP sys is converted to uni
Hello Experts,
Can we convert the Non Unicode ABAP programs to Unicode after upgrading non unicode SAP system to Unicode?
Is there any serious problem?
If Non Unicode SAP is upgraded to Unicode without converting all non unicode ABAP programs to Unicode.
Thanks in advance.
HariHi
There is no need of correcting the programs from Non unicode to Unicode
After migrating the system from non Unicode to Unicode you have to run certain Notes (which will be done by Basis) to take care of this.
<b>Reward points for useful Answers</b>
Regards
Anji -
How can I make my program Run forever?
I would like to know how can I make my program execute some method while the GUI still open. I have something like this.
public static void main(String args[]) {
System.out.println("****************************");
System.out.println(" PACKET READER CONSOLE ");
System.out.println("****************************");
IPDetector window = new IPDetector(); // IPDetector is the JFrame
window.setTitle("IPDetector Analyzer");
window.pack();
window.show();
PortListener pl = new PortListener();// Is my portlistener class
PacketReader c = new PacketReader();
while(JFrame still open){// I dont know how to put a statemente here
pl.start();// this method reads from a port and returns a string
String cc = pl.data;// gets the string from the port listener
while(!cc.equals("")){
c.portWriter(cc);// writes the string into a file
}I want that my portlistener keeps reading all the time, and if is something in the socket information.
Should I use a thread? Any ideas? thanks.
ChrisI still not understanding how to make it thread. My main class is this one IPDetector. and it looks like this.
public class IPDetector extends JFrame {
// Declaration of the instance variables
private static ArrayofDisplay ad = new ArrayofDisplay();
private ArrayofCreators database = new ArrayofCreators();
JLabel sourceLabel;//etc..
public IPDetector() {
IPDetectorLayout customLayout = new IPDetectorLayout();
getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
getContentPane().setLayout(customLayout);
sourceLabel = new JLabel("Source IP Add.");
getContentPane().add(sourceLabel);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
// I get confused here...
private boolean alive; // Do I need to declared here?
public void setAlive(boolean val) { // This one also?
alive = val;
// IPDetector Methods...
public void displayCaller(ArrayofDisplay aD){ }
public void setAndReplace(String text) { }
public void refresh(){ }
public boolean action(Event evt, Object arg){ }
//etc...
public static void main(String args[]) {
System.out.println("***********************************************");
IPDetector window = new IPDetector();
window.setTitle("IPDetector");
window.pack();
window.show();
PortListener pl = new PortListener();
PacketReader c = new PacketReader();
while (alive) {// Is this correct here?
pl.start();
String cc = pl.data;
while(!cc.equals("")){
c.portWriter(cc);
window.refresh();
cc = "";
class IPDetectorLayout implements LayoutManager {
public IPDetectorLayout() { }
public void addLayoutComponent(String name, Component comp) { }
public void layoutContainer(Container parent) { }
} -
SXPG_COMMAND_EXECUTE Can't exec external program (No such file or directory
Hi Experts,
I need to launch or terminate an external application (i.e. command prompt, notepad, etc.) in background job by using FM SXPG_COMMAND_EXECUTE. However, I am unable to proceed because of the following error occured after executing the command in SM69.
Can't exec external program (No such file or directory)
External program terminated with exit code 1
I was using the following sample code. Can someone tell me what might be the cause of the problem?
DATA: lv_status TYPE extcmdexex-status,
lt_output TYPE TABLE OF btcxpm,
lv_opsys TYPE sy-opsys.
lv_opsys = 'WINDOWS NT'.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
commandname = 'ZIEXPLORE'
additional_parameters = '/c'
operatingsystem = lv_opsys
IMPORTING
status = lv_status
TABLES
exec_protocol = lt_output
EXCEPTIONS
no_permission = 1
command_not_found = 2
parameters_too_long = 3
security_risk = 4
wrong_check_call_interface = 5
program_start_error = 6
program_termination_error = 7
x_error = 8
parameter_expected = 9
too_many_parameters = 10
illegal_command = 11
wrong_asynchronous_parameters = 12
cant_enq_tbtco_entry = 13
jobcount_generation_error = 14
OTHERS = 15.
ZIEXPLORE command
Operating system command: cmd
Parameters for operating system command: taskkill /f /im iexplore.exe
Thanks and Regards,
LouieHi Louie,
I am not able to assume the reason of the problem, If you say that its not getting executed in SM49 then the problem lies there.
So I am providing you a link which might be helpful, just go through it and cross check. There is a parameter called "trace" in the fm mentioned.
Secton Microsoft Windows NT - [Prerequisites for Running External Commands and External Programs|http://help.sap.com/saphelp_nw70/helpdata/en/c4/3a7fbb505211d189550000e829fbbd/content.htm]
[Analyzing Problems with External Commands and Programs|http://help.sap.com/saphelp_nw70/helpdata/en/c4/3a80c4505211d189550000e829fbbd/content.htm]
May be you can post this question in [SAP AS General|SAP NetWeaver Application Server; also. -
How can I make the "Enable to sink files" warning to go away?
How can I make the "Enable to sink files" warning to go away?
Hi Airmiranda
The following doc should help: http://helpx.adobe.com/creative-cloud/kb/creative-cloud-files-wont-connect.html
"If you are using Creative Cloud Connection preview, you will either see “Unable to sync file(s)” or “Unable to connect...” errors. To disable these error alerts, you can Turn Sync Off or Quit Creative Cloud Connection."
Thanks
Bev -
Can i make a program for calender
can i make a program for calender actually i have to run a calender logic and select the date and modify them with some value.
I just need to ask is there any function module that runs a calender logic by picking the input date .
Eg if i put a input date say 03.04.2005 the program then automatically run for all the date of that month and year, i mean i can get the all the dates for that month and year...
Please helpHi Mave ,
If you want an internal table with the dates of the month
just try this -- . Instead of sy-datum you can pass any date and see the output .
parameters Pdate like sy-datum.
data : begin of itab occurs 0 ,
date like sy-datum,
end of itab.
Data Month(2) type N.
itab-date = pdate.
itab-date+6(02) = 01.
month = itab+4(2).
do .
if itab+4(2) NE month.
exit.
endif.
append itab .
itab-date = itab-date + 1.
enddo.
loop at itab.
write :/ itab-date.
endloop. -
Can i make a program to make keyboard and mouse idle for 10 seconds?
can i make a program to make keyboard and mouse idle or not responding for 10 seconds?
please how can i do that874557 wrote:
no i don't think at all ..That much is obvious. Though I expect you meant to say +"No, I don't think *so* at all"+ - in which case you'd be wrong.
..i think some one is rudeYes, we (now) know you are, thanks to Darryl's pointers.
See also How To Ask Questions The Smart Way - On Not Reacting Like A Loser. In fact, read the entire document. -
How can I make my external loaded .SWF file smoothly disappear after 15 seconds?
Hi,
How can I make my external loaded .SWF file smoothly disappear after 15 seconds? The following is the code to load an external .SWF file:
var K:Loader=new Loader();
addChild(K);
K.load(new URLRequest("clock.swf"));
K.x = 165;
K.y = 247;
K.contentLoaderInfo.addEventListener(Event.INIT, growLoader);
function growLoader(evt:Event):void {
K.width = 130;
K.height = 130;
I want to make clock.swf file disappear from the page after 15 seconds using some smooth disappear effect.
Please help.
Thanks.Something even better:
http://www.greensock.com/
Check out TimelineMax I LOVE it...
The guy that made this (and gives it away for free!) is a saint. -
How can i make simple program to match colors ?(photos taken by camera)
how can i make simple program to match colors ?(photos taken by camera)
Hi khaledyr,
use a "random number" and compare for ">0.5" to get a (1 or 0) signal
What exactly are you searching for?
- Hints for choosing hardware?
- How to output voltage or relais signals?
- Help on using DAQ(mx)?
- Help on generating (boolean) waveforms?
Message Edited by GerdW on 04-16-2010 08:15 AM
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
File to File and then Call ABAP Program and pass file name and location
Hi
I am new to PI and am working on the following requirement and some guidance would help:
A file is picked up from a third party server using FTP and is put in an SAP server in a specific location. After I have put in the file successfully, I need to call an ABAP program and provide the name and location of the file for further processing by the ABAP program.
Although I am familiar with File to File, how can I add in the ABAP call with the filename and location? I do not want to pass any other information to the ABAP program.
Thanks for your help.
ManojI think I get what you're saying. This additional file would have the file and the path in it's content. I would then use this as a source (FCC?) for Mapping with the RFC. Right?
Exactly and yes, FCC would be helpful
Would you have a sample OS script to do the above?
Actually it depends on the operating system on which your PI system is standing. For instance for Windows, you might try with the following as a start point (but I was not able to test it, so I can't guarantee it will do the job):
cmd.exe /C "%f %F > C:\target_directory\%DATE%_%TIME%.txt"
In case you needed more, try googling on "windows batch script" or similar.
Hope this helps,
Greg -
ABAP program to execute shell script !
Hi Friends,
I have created some shell scripts and need to be executed through ABAP prog in order to automate some process. can any one tell me how to execute these scripts through ABAP program? i know that we have to setup those scripts through SM69 but i dont have clear idea about this.can some one tell me step by step how to do this. ur help will be awarded in terms of points.
ThanksDefine the scripts as commands in SM69. Test them in SM69/SM49 to see if they work.
Next, go to SE37, run FM SXPG_COMMAND_EXECUTE, and specify your command there. Does it work?
If yes, you can just code a 'CALL FUNCTION' to this FM in your ABAP program, and you are ready to invoke your script from your ABAP.
For a list of functions that work with commands (defined in SM69), do a drop-down on SXPG_COMMAND* in SE37.
A sample code may look like this
concatenate zsys_id z_infile z_extfile into parm
separated by space.
*C_FTP_COMMAND is a script defined in SM49
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
COMMANDNAME = C_FTP_COMMAND
ADDITIONAL_PARAMETERS = parm
OPERATINGSYSTEM = SY-OPSYS
TABLES
EXEC_PROTOCOL = PROT
EXCEPTIONS
NO_PERMISSION = 1
COMMAND_NOT_FOUND = 2
PARAMETERS_TOO_LONG = 3
SECURITY_RISK = 4
WRONG_CHECK_CALL_INTERFACE = 5
PROGRAM_START_ERROR = 6
PROGRAM_TERMINATION_ERROR = 7
X_ERROR = 8
PARAMETER_EXPECTED = 9
TOO_MANY_PARAMETERS = 10
ILLEGAL_COMMAND = 11
WRONG_ASYNCHRONOUS_PARAMETERS = 12
CANT_ENQ_TBTCO_ENTRY = 13
JOBCOUNT_GENERATION_ERROR = 14
OTHERS = 15.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
write: /, 'FTP Function module executed with no errors.'.
ENDIF. -
Read ABAP Program from Transport File
Hi Guys,
I have a transport log file which contains an abap program, i want to read that program before inporting that to my system, when i open the file the program sources come in not readable format we are on ECC.6 and transport file is also generated out of ECC.6 system.
Does anyone have any idea how can i read the source of and any editor where i can get that converted in readable format.
AtulHi,
I think it is downloaded in binary format.
Use the method of uploading binary data files from PC to Internal tables by function module.
GUI_UPLOAD
As filetype - BIN -
How can I run a Local PC executable file from Enterprise Portal?
I want to run local PC executable files from inside the portal. To be more specific I want to be able to open the Outlook and some powerbuilder executable applications.
How can I do it?If you absolutely want to do it, you can use vbscript for it (though there are a lot of security contstraints)
See Re: Displaying office programs -
Can anyone make my program short? tnx
i'm new in java programming and have limited knowledge in OOP.. please help me make my code short please please... tnx guys...
i want to split my program in 2 or more files/classes..
and can you help me with my looping .. thank you so much...
my program works fine.. all i want is to make ot shorter coz it almost reach 4k lines...
here is my code..
package TXNCNT;
//imports
import java.io.*;
import java.util.*;
import java.text.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.enterprisedt.net.ftp.FTPClient;
import com.enterprisedt.net.ftp.FTPException;
import org.apache.log4j.*;
public class TxnCntMain extends JFrame {
private static final String DATASOURCECONFIG = "datasource.properties";
private static String FTP_IPADDRESS = "";
private static String FTP_USERNAME = "";
private static String FTP_PASSWORD = "";
private static String FTP_FOLDER = "";
private static String FTP_FILE = "";
private static String JDBC_DRIVER = "";
private static String JDBC_URL = "";
private static String JDBC_USER = "";
private static String JDBC_PWD = "";
private static String BRANCHES = "";
protected static Category log = Category.getInstance(TxnCntMain.class);
static {
try {
InputStream ins = (TxnCntMain.class).getResourceAsStream(
DATASOURCECONFIG);
Properties props = new Properties();
props.load(ins);
FTP_IPADDRESS = props.getProperty("FTP_IPADDRESS");
FTP_USERNAME = props.getProperty("FTP_USERNAME");
FTP_PASSWORD = props.getProperty("FTP_PASSWORD");
FTP_FOLDER = props.getProperty("FTP_FOLDER");
FTP_FILE = props.getProperty("FTP_FILE");
} catch (IOException ex) {
ex.printStackTrace();
TxnCntMain.log.error("Unable to load: " + DATASOURCECONFIG);
/* Load properties file for JDBC settings */
static {
InputStream ins = (TxnCntMain.class).getResourceAsStream(DATASOURCECONFIG);
Properties props = new Properties();
try {
props.load(ins);
} catch (IOException ex) {
log.error("Unable to load: " + DATASOURCECONFIG);
throw new RuntimeException("Unable to load: " + DATASOURCECONFIG);
JDBC_DRIVER = props.getProperty("JDBC_DRIVER");
JDBC_URL = props.getProperty("JDBC_URL");
JDBC_USER = props.getProperty("JDBC_USER");
JDBC_PWD = props.getProperty("JDBC_PWD");
BRANCHES = props.getProperty("BRANCHES");
private static BufferedReader stdin = new BufferedReader( new InputStreamReader( System.in ) );
private Connection connect;
private ControlPanel cp;
private JTextArea output;
private JScrollPane textpane;
private String fromDate = "";
private String toDate = "";
private String fDate = "";
private String tDate = "";
private Object fromD, fromM, fromY, toD, toM, toY;
private int FD, TD;
////variable used in ControlPanel Class
private JButton saveButton;
DecimalFormat dateFormat = new DecimalFormat("00");
DecimalFormat bCodeFormat = new DecimalFormat("000");
private int iBCode;
int rGDep = 0; int rGWith = 0; int rGBP = 0; int rGAO = 0;
int rGCT = 0;int rGFX = 0;int rGTD = 0;int rTotal = 0;
public TxnCntMain() {
super( "MIS REPORT - Branch Transaction Count" );
Container c = getContentPane();
output = new JTextArea( 6, 30 );
output.setEditable(false);
c.setLayout( new BorderLayout() );
textpane = new JScrollPane( output );
c.add( textpane, BorderLayout.CENTER);
//////// Set up database connection
try {
Class.forName(JDBC_DRIVER);
connect = DriverManager.getConnection( JDBC_URL, JDBC_USER, JDBC_PWD );
output.append("Connection successful\n"
+ "Welcome to MIS Report - Branch Transaction Count\n");
log.info("Connection successful: Welcome to MIS Report - Branch Transaction Count");
catch ( ClassNotFoundException cnfex ) {
// process ClassNotFoundExceptions here
cnfex.printStackTrace();
output.append("Connection unsuccessful\n" +
cnfex.toString() + "\n" );
log.info("Connection unsuccessful: " + cnfex.toString());
catch ( SQLException sqlex ) {
// process SQLExceptions here
sqlex.printStackTrace();
output.append( "Connection unsuccessful\n" +
sqlex.toString() + "\n" );
log.info("Connection unsuccessful: " + sqlex.toString());
catch ( Exception ex ) {
// process remaining Exceptions here
ex.printStackTrace();
output.append( ex.toString() + "\n" );
log.info(ex.toString());
// Complete screen layout
cp = new ControlPanel( connect, output);
c.add( cp, BorderLayout.NORTH );
setSize( 650, 450 );
show();
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
////Inner Class ControLPanel//////////////////////////////////////////////////
class ControlPanel extends JPanel {
private JLabel fromDateLabel, fromMonthLabel, fromYearLabel,
toDateLabel, toMonthLabel, toYearLabel, from, to;
private JComboBox fromDateCombo, fromMonthCombo, fromYearCombo,
toDateCombo, toMonthCombo, toYearCombo;
private String days[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9",
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
"21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" };
private String monthNames[] = { "January", "February", "March",
"April", "May", "June", "July", "August", "September",
"October", "November", "December" };
private String years[] = { "1990", "1991", "1992", "1993", "1994",
"1995", "1996", "1997", "1998", "1999", "2000", "2001",
"2002", "2003", "2004", "2005", "2006", "2007", "2008",
"2009", "2010", "2011", "2012", "2013", "2014", "2015",
"2016", "2017", "2018", "2019", "2020", "2021", "2022",
"2023", "2024", "2025", "2026", "2027", "2028", "2029",
"2030", "2031", "2032", "2033", "2034", "2035", "2036",
"2037", "2038", "2039", "2040", "2041", "2042", "2043",
"2044", "2045", "2046", "2047", "2048", "2049", "2050" };
public ControlPanel( Connection c, JTextArea t) {
output = t;
setLayout( new GridLayout(3,7) );
////////////FROM (1st row) /////////////////////////////////////////////////////
from = new JLabel(" FROM: ");
add(from);
fromMonthLabel = new JLabel("Choose Month ",SwingConstants.RIGHT);
add(fromMonthLabel);
fromMonthCombo = new JComboBox(monthNames);
fromMonthCombo.setMaximumRowCount(12);
fromMonthCombo.setSelectedIndex(0); //january
fromM = fromMonthCombo.getSelectedItem();
fromMonthCombo.addItemListener(
new ItemListener() {
public void itemStateChanged(ItemEvent e) {
fromM = fromMonthCombo.getSelectedItem();
add(fromMonthCombo);
fromDateLabel = new JLabel("Choose Date ", SwingConstants.RIGHT);
add(fromDateLabel);
fromDateCombo = new JComboBox(days);
fromDateCombo.setMaximumRowCount(10);
fromD = fromDateCombo.getSelectedItem();
fromDateCombo.addItemListener(
new ItemListener() {
public void itemStateChanged(ItemEvent e) {
fromD = fromDateCombo.getSelectedItem();
add(fromDateCombo);
fromYearLabel = new JLabel("Choose Year ", SwingConstants.RIGHT);
add(fromYearLabel);
fromYearCombo = new JComboBox(years);
fromYearCombo.setMaximumRowCount(10);
fromYearCombo.setSelectedIndex(17); //default selected value is 2007
fromY = fromYearCombo.getSelectedItem();
fromYearCombo.addItemListener(
new ItemListener() {
public void itemStateChanged(ItemEvent e) {
fromY = fromYearCombo.getSelectedItem();
add(fromYearCombo);
////////////TO (2nd row) ///////////////////////////////////////////////////////
to = new JLabel(" TO: ");
add(to);
toMonthLabel = new JLabel("Choose Month ",SwingConstants.RIGHT);
add(toMonthLabel);
toMonthCombo = new JComboBox(monthNames);
toMonthCombo.setMaximumRowCount(12);
toMonthCombo.setSelectedIndex(0); //january
toM = toMonthCombo.getSelectedItem();
toMonthCombo.addItemListener(
new ItemListener() {
public void itemStateChanged(ItemEvent e) {
toM = toMonthCombo.getSelectedItem();
add(toMonthCombo);
toDateLabel = new JLabel("Choose Date ", SwingConstants.RIGHT);
add(toDateLabel);
toDateCombo = new JComboBox(days);
toDateCombo.setMaximumRowCount(10);
toDateCombo.setSelectedIndex(31 - 1); //default selected day is 31
toD = toDateCombo.getSelectedItem();
toDateCombo.addItemListener(
new ItemListener() {
public void itemStateChanged(ItemEvent e) {
toD = toDateCombo.getSelectedItem();
add(toDateCombo);
toYearLabel = new JLabel("Choose Year ", SwingConstants.RIGHT);
add(toYearLabel);
toYearCombo = new JComboBox(years);
toYearCombo.setMaximumRowCount(10);
toYearCombo.setSelectedIndex(17); //default selected year is 2007
toY = toYearCombo.getSelectedItem();
toYearCombo.addItemListener(
new ItemListener() {
public void itemStateChanged(ItemEvent e) {
toY = toYearCombo.getSelectedItem();
add(toYearCombo);
////////////3rd row ////////////////////////////////////////////////////////////
JLabel l1 = new JLabel(" ");
add(l1);
JLabel l2 = new JLabel(" ");
add(l2);
JLabel l3 = new JLabel(" ");
add(l3);
JLabel l4 = new JLabel(" ");
add(l4);
JLabel l5 = new JLabel(" ");
add(l5);
JLabel l6 = new JLabel(" ");
add(l6);
////////////create an instance of inner class ButtonHandler
/////////////to use for button event handling
ButtonHandler handler = new ButtonHandler();
saveButton = new JButton("Save File");
saveButton.addActionListener(handler);
saveButton.setToolTipText("Generate CSV File");
add(saveButton);
////////inner class for button event handling
private class ButtonHandler implements ActionListener {
public void actionPerformed(ActionEvent e) {
fromDate = dateFormat.format((fromMonthCombo.getSelectedIndex() + 1))
+ dateFormat.format((fromDateCombo.getSelectedIndex() + 1))
+ fromY.toString();
toDate = dateFormat.format((toMonthCombo.getSelectedIndex() + 1))
+ dateFormat.format((toDateCombo.getSelectedIndex() + 1))
+ toY.toString();
fDate = fromY.toString()
+ dateFormat.format((fromMonthCombo.getSelectedIndex() + 1))
+ dateFormat.format((fromDateCombo.getSelectedIndex() + 1));
tDate = toY.toString()
+ dateFormat.format((toMonthCombo.getSelectedIndex() + 1))
+ dateFormat.format((toDateCombo.getSelectedIndex() + 1));
FD = Integer.parseInt(fDate);
TD = Integer.parseInt(tDate);
if (FD > TD) { //check if from date is greater than to date
JOptionPane.showMessageDialog(null,
"Unable to process... Please check date.",
"Error on Date", JOptionPane.ERROR_MESSAGE);
output.append("\nUnable to process... Please check date.");
log.info("Unable to process... Please check date.");
} else {
writeToFile();
////write to file:
public void writeToFile() {
String FILENAME_SUMMARY = "C:/TXNCNT/TotalNoOfTransactionsProcessedPerBranch"
+ "_From" + fromD + fromM + fromY
+ "To" + toD + toM + toY + ".csv";
int grandDeposit = 0;
int grandWithdrawal = 0;
int grandBP = 0;
int grandAO = 0;
int grandCT = 0;
int grandFX = 0;
int grandTD = 0;
int regionalGrandTotal = 0;
try {
FileOutputStream outputFile_Summary = new FileOutputStream(FILENAME_SUMMARY, false);
PrintStream r = null;
r = new PrintStream(outputFile_Summary);
r.println("MIS REPORT - Branch Transaction Count");
r.println(" ");
r.println("TOTAL # OF TRANSACTIONS PROCESSED PER BRANCH");
r.println("From: " + fromD + fromM + fromY + " To: " + toD + toM + toY);
r.println(" "
+ " "
+ " TOTAL NUMBER OF TRANSACTIONS");
r.println("#,BRANCH NAME,DEPOSIT,WITHDRAWALS,BILLS PAYMENT,ACCOUNT OPENING,"
+ "CASH TURNOVER,FX SALE,TD OPENING,TOTAL");
r.println("Region 1 GMA 1");
String FILENAME_REGION = "C:/TXNCNT/" + "Region1_GMA1"
+ "_NoOfprocessedTransactionPerBranchPerTeller"
+ "_From" + fromD + fromM + fromY
+ "To" + toD + toM + toY + ".csv";
FileOutputStream outputFile_Region = new FileOutputStream(FILENAME_REGION, false);
PrintStream p = null;
p = new PrintStream(outputFile_Region);
p.println("MIS REPORT - Branch Transaction Count");
p.println("# OF PROCESSED TRANSACTION PER BRANCH PER TELLER");
p.println("From: " + fromD + fromM + fromY
+ " To: " + toD + toM + toY);
p.println("Region 1 GMA 1");
String sBCode = BRANCHES.substring(0,BRANCHES.indexOf(","));
int i = BRANCHES.indexOf(",");
String sTemp = BRANCHES;
final Vector branches = new Vector(325, 1);
while (i != sTemp.length()) {
branches.addElement(sBCode);
sTemp = sTemp.substring(i+1);
i = sTemp.indexOf(",");
if(i==-1){
sBCode = sTemp;
branches.addElement(sBCode);
i = sTemp.length();
}else{
sBCode = sTemp.substring(0,sTemp.indexOf(","));
int iDeposit, iWithdrawals, iBP, iAO, iCT, iFX, iTD, grandTotal;
for (int b = 0; b < branches.size(); b++) {
iBCode = Integer.parseInt(branches.get(b).toString());
String code = bCodeFormat.format(iBCode);
int gDeposit, gWithdrawal, gBP, gAO, gCT, gFX, gTD;
String sTxn = "";
grandTotal = 0;
final Vector Teller = new Vector(25, 1);
gDeposit = 0; gWithdrawal = 0; gBP = 0; gAO = 0; gCT = 0; gFX = 0; gTD = 0;
String sBranchName = "";
//select branchname from um_branch
String sSQL = "SELECT branchname FROM um_branch WHERE "
+ "branchcode = " + "'" + code + "'";
Statement stmt = connect.createStatement();
ResultSet rsQuery = null;
rsQuery = stmt.executeQuery(sSQL);
if (rsQuery.next()) {
sBranchName = rsQuery.getString(1);
rsQuery.close();
stmt.close();
p.println();
p.println("Branch Code: " + code + ",Branch Name: " + sBranchName);
//retrieve userid's
sSQL = "SELECT distinct(userid) FROM bdsarchive.txnjournal WHERE "
+ "branchno = '" + code + "' AND "
+ "txndate >= '" + fromDate
+ "' AND txndate <= '" + toDate + "'";
ResultSet rsQuery1 = null;
Statement stmt1 = connect.createStatement();
rsQuery1 = stmt1.executeQuery(sSQL);
int u = 0;
String tel = "";
String teller = "";
String space = "";
while (rsQuery1.next()) {
tel = rsQuery1.getString(1);
teller += "," + tel;
Teller.addElement(tel);
space += ",";
u++;
rsQuery1.close();
stmt1.close();
p.println("Transaction Type,Transaction ID" + teller + ",Total");
int tellerTotal[];
tellerTotal = new int[u];
//DEPOSITS
//txnid 1101//
int t = 0;
sTxn = "";
iDeposit = 0;
while (t < u) {
sSQL = "SELECT count(txnid) FROM bdsarchive.txnjournal WHERE "
+ "txnid = '1101' AND userid = '" + Teller.get(t) + "' "
+ "AND branchno = '" + code + "' "
+ "AND txndate >= '" + fromDate + "' "
+ "AND txndate <= '" + toDate + "'";
ResultSet rsQuery2 = null;
Statement stmt2 = connect.createStatement();
rsQuery2 = stmt2.executeQuery(sSQL);
while (rsQuery2.next()) {
sTxn = sTxn + rsQuery2.getString(1) + ",";
iDeposit = iDeposit + Integer.parseInt(rsQuery2.getString(1));
tellerTotal[t] += Integer.parseInt(rsQuery2.getString(1));
rsQuery2.close();
stmt2.close();
t++;
p.println("DEPOSIT,1101 - Peso (SV) Cash with Book," + sTxn + iDeposit);
gDeposit += iDeposit;
rGDep += iDeposit;
//txnid 1102//
t = 0;
sTxn = "";
iDeposit = 0;
while (t < u) {
sSQL = "SELECT count(txnid) FROM bdsarchive.txnjournal WHERE "
+ "txnid = '1102' AND userid = '" + Teller.get(t) + "' "
+ "AND branchno = '" + code + "' "
+ "AND txndate >= '" + fromDate + "' "
+ "AND txndate <= '" + toDate + "'";
ResultSet rsQuery2 = null;
Statement stmt2 = connect.createStatement();
rsQuery2 = stmt2.executeQuery(sSQL);
while (rsQuery2.next()) {
sTxn = sTxn + rsQuery2.getString(1) + ",";
iDeposit = iDeposit + Integer.parseInt(rsQuery2.getString(1));
tellerTotal[t] += Integer.parseInt(rsQuery2.getString(1));
rsQuery2.close();
stmt2.close();
t++;
p.println(",1102 - Peso (SV) OBCK with Book," + sTxn + iDeposit);
gDeposit += iDeposit;
rGDep += iDeposit;
//txnid 1103//
t = 0;
sTxn = "";
iDeposit = 0;
while (t < u) {
sSQL = "SELECT count(txnid) FROM bdsarchive.txnjournal WHERE "
+ "txnid = '1103' AND userid = '" + Teller.get(t) + "' "
+ "AND branchno = '" + code + "' "
+ "AND txndate >= '" + fromDate + "' "
+ "AND txndate <= '" + toDate + "'";
ResultSet rsQuery2 = null;
Statement stmt2 = connect.createStatement();
rsQuery2 = stmt2.executeQuery(sSQL);
while (rsQuery2.next()) {
sTxn = sTxn + rsQuery2.getString(1) + ",";
iDeposit = iDeposit + Integer.parseInt(rsQuery2.getString(1));
tellerTotal[t] += Integer.parseInt(rsQuery2.getString(1));
rsQuery2.close();
stmt2.close();
t++;
p.println(",1103 - Peso (SV) DDMC with Book," + sTxn + iDeposit);
gDeposit += iDeposit;
rGDep += iDeposit;
//txnid 1104//
t = 0;
sTxn = "";
iDeposit = 0;
while (t < u) {
sSQL = "SELECT count(txnid) FROM bdsarchive.txnjournal WHERE "
+ "txnid = '1104' AND userid = '" + Teller.get(t) + "' "
+ "AND branchno = '" + code + "' "
+ "AND txndate >= '" + fromDate + "' "
+ "AND txndate <= '" + toDate + "'";
ResultSet rsQuery2 = null;
Statement stmt2 = connect.createStatement();
rsQuery2 = stmt2.executeQuery(sSQL);
while (rsQuery2.next()) {
sTxn = sTxn + rsQuery2.getString(1) + ",";
iDeposit = iDeposit + Integer.parseInt(rsQuery2.getString(1));
tellerTotal[t] += Integer.parseInt(rsQuery2.getString(1));
rsQuery2.close();
stmt2.close();
t++;
p.println(",1104 - Peso (SV) PNBC with Book," + sTxn + iDeposit);
gDeposit += iDeposit;
rGDep += iDeposit;
//txnid 1105//
t = 0;
sTxn = "";
iDeposit = 0;
while (t < u) {
sSQL = "SELECT count(txnid) FROM bdsarchive.txnjournal WHERE "
+ "txnid = '1105' AND userid = '" + Teller.get(t) + "' "
+ "AND branchno = '" + code + "' "
+ "AND txndate >= '" + fromDate + "' "
+ "AND txndate <= '" + toDate + "'";
ResultSet rsQuery2 = null;
Statement stmt2 = connect.createStatement();
rsQuery2 = stmt2.executeQuery(sSQL);
while (rsQuery2.next()) {
sTxn = sTxn + rsQuery2.getString(1) + ",";
iDeposit = iDeposit + Integer.parseInt(rsQuery2.getString(1));
tellerTotal[t] += Integer.parseInt(rsQuery2.getString(1));
rsQuery2.close();
stmt2.close();
t++;
p.println(",1105 - Peso (SV) FDR with Book," + sTxn + iDeposit);
gDeposit += iDeposit;
rGDep += iDeposit;
//txnid 1106//
t = 0;
sTxn = "";
iDeposit = 0;
while (t < u) {
sSQL = "SELECT count(txnid) FROM bdsarchive.txnjournal WHERE "
+ "txnid = '1106' AND userid = '" + Teller.get(t) + "' "
+ "AND branchno = '" + code + "' "
+ "AND txndate >= '" + fromDate + "' "
+ "AND txndate <= '" + toDate + "'";
ResultSet rsQuery2 = null;
Statement stmt2 = connect.createStatement();
rsQuery2 = stmt2.executeQuery(sSQL);
while (rsQuery2.next()) {
sTxn = sTxn + rsQuery2.getString(1) + ",";
iDeposit = iDeposit + Integer.parseInt(rsQuery2.getString(1));
tellerTotal[t] += Integer.parseInt(rsQuery2.getString(1));
rsQuery2.close();
stmt2.close();
t++;
p.println(",1106 - Peso (SV) PNBC Cross Check with Book," + sTxn + iDeposit);
gDeposit += iDeposit;
rGDep += iDeposit;
//txnid 1107//
t = 0;
sTxn = "";
iDeposit = 0;
while (t < u) {
sSQL = "SELECT count(txnid) FROM bdsarchive.txnjournal WHERE "
+ "txnid = '1107' AND userid = '" + Teller.get(t) + "' "
+ "AND branchno = '" + code + "' "
+ "AND txndate >= '" + fromDate + "' "
+ "AND txndate <= '" + toDate + "'";
ResultSet rsQuery2 = null;
Statement stmt2 = connect.createStatement();
rsQuery2 = stmt2.executeQuery(sSQL);
while (rsQuery2.next()) {
sTxn = sTxn + rsQuery2.getString(1) + ",";
iDeposit = iDeposit + Integer.parseInt(rsQuery2.getString(1));
tellerTotal[t] += Integer.parseInt(rsQuery2.getString(1));
rsQuery2.close();
stmt2.close();
t++;
p.println(",1107 - Peso (SV) Credit Memo with Book," + sTxn + iDeposit);
gDeposit += iDeposit;
rGDep += iDeposit;
//txnid 1110//
t = 0;
sTxn = "";
iDeposit = 0;
while (t < u) {
sSQL = "SELECT count(txnid) FROM bdsarchive.txnjournal WHERE "
+ "txnid = '1110' AND userid = '" + Teller.get(t) + "' "
+ "AND branchno = '" + code + "' "
+ "AND txndate >= '" + fromDate + "' "
+ "AND txndate <= '" + toDate + "'";
ResultSet rsQuery2 = null;
Statement stmt2 = connect.createStatement();
rsQuery2 = stmt2.executeQuery(sSQL);
while (rsQuery2.next()) {
sTxn = sTxn + rsQuery2.getString(1) + ",";
iDeposit = iDeposit + Integer.parseInt(rsQuery2.getString(1));
tellerTotal[t] += Integer.parseInt(rsQuery2.getString(1));
rsQuery2.close();
stmt2.close();
t++;
p.println(",1110 - Peso (SV) Cash no Book," + sTxn + iDeposit);
gDeposit += iDeposit;
rGDep += iDeposit;
//txnid 1111//
t = 0;
sTxn = "";
iDeposit = 0;
while (t < u) {
sSQL = "SELECT count(txnid) FROM bdsarchive.txnjournal WHERE "
+ "txnid = '1111' AND userid = '" + Teller.get(t) + "' "
+ "AND branchno = '" + code + "' "
+ "AND txndate >= '" + fromDate + "' "
+ "AND txndate <= '" + toDate + "'";
ResultSet rsQuery2 = null;
Statement stmt2 = connect.createStatement();
rsQuery2 = stmt2.executeQuery(sSQL);
while (rsQuery2.next()) {
sTxn = sTxn + rsQuery2.getString(1) + ",";
iDeposit = iDeposit + Integer.parseInt(rsQuery2.getString(1));
tellerTotal[t] += Integer.parseInt(rsQuery2.getString(1));
rsQuery2.close();
stmt2.close();
t++;
p.println(",1111 - Peso (SV) OBCK no Book," + sTxn + iDeposit);
gDeposit += iDeposit;
rGDep += iDeposit;
//txnid 1112//
t = 0;
sTxn = "";
iDeposit = 0;
while (t < u) {
sSQL = "SELECT count(txnid) FROM bdsarchive.txnjournal WHERE "
+ "txnid = '1112' AND userid = '" + Teller.get(t)Well expanding on before.
All this can be ripped out and put in a different method
t = 0;
sTxn = "";
iDeposit = 0;
while (t < u) {
sSQL = "SELECT count(txnid) FROM bdsarchive.txnjournal WHERE "
+ "txnid = '1104' AND userid = '" + Teller.get(t) + "' "
+ "AND branchno = '" + code + "' "
+ "AND txndate >= '" + fromDate + "' "
+ "AND txndate <= '" + toDate + "'";
ResultSet rsQuery2 = null;
Statement stmt2 = connect.createStatement();
rsQuery2 = stmt2.executeQuery(sSQL);
while (rsQuery2.next()) {
sTxn = sTxn + rsQuery2.getString(1) + ",";
iDeposit = iDeposit + Integer.parseInt(rsQuery2.getString(1));
tellerTotal[t] += Integer.parseInt(rsQuery2.getString(1));
rsQuery2.close();
stmt2.close();
t++;
p.println(",1104 - Peso (SV) PNBC with Book," + sTxn + iDeposit);
gDeposit += iDeposit;
rGDep += iDeposit;Then just call the method with the txnid value. So perhaps a List ( ArrayList) of txnid values and a for loop.
Boom. There's a great chunk of repetitive code gone.
Then the next step in refactoring to different classes is to seperate out all the pieces.
Put the FTP bits in to one class.
Put the database and processing stuff into another class.
Put the report writing into another class.
That would be a good start. -
How can i make sure all of the files in my music file are on my itunes??
I copied all of my itunes music via usb drive (crappy process) onto my mac in my music folder.. but it too several times due to the small size of the usb drive.. anyways..
When you add music to your music folder.. it doesn't go onto your itunes playlist until you choose that specific song..
can itunes perform a search to make sure you have a copy of every music file on your itunes?iTunes menu File -> Add to library and select the \Music\iTunes\iTunes music\ folder.
FYI: If you are using iTunes 9, go to \Music\iTunes\iTunes media\ folder.
Make an alias on the desktop of the *Automatically add to iTunes* folder. Then drag songs to the is folder and they will automatically get added to iTunes and moved to the correct folder.
Maybe you are looking for
-
Multiprovider on multiprovider ?
Hello BW Experts, Multiprovider on Multiprovider possible ? Thanks, BWer
-
How do i remove an existing email account
Long story short, i bought the tour for my son, he didnt like it so i traded him my droid for the blackberry. His email was already in the phone so i hid hit so i wouldnt see it but for some reason it is still popping up with emails. I am trying to d
-
Facing one issue with only DA client , it connects to Direct access for few seconds and then get disconnected. Looking at error on Event viewer I see below error Any help appreciated certificate looks ok on client not sure why IPSEC is still failing.
-
I recently acquired the new MacBook Air for my performance rig and have discovered that there is no way to connect it to either of my audio interfaces [both have FireWire 400 ports only. Is there an adaptor for this? I can't seem to find one.
-
Is it possible to return a data grid in sql developer from package?
Hi, I am in need of some help in returning a datagrid rather than just a list from a package. This is my package: CREATE OR REPLACE PACKAGE BODY C_1 as PROCEDURE COUNTING1 (C_YEARFROM IN NUMBER, C_TABLE_NAME IN VARCHAR2) is yearCount NUMBER; c_sql lo