Please optimise des Codes
I am working with some Account Tables BSIS,BSAS ,BSEC . I have to select data from these table on the basis of Region ( Not a primary key in BSEC) ,Fiscal year and Company code.here is my code:
SELECT BELNR GJAHR BUZEI NAME1 INTO ITAB1 FROM BSEC WHERE
BUKRS = CC " Company Code
AND GJAHR = FY " Fiscal yr
AND REGIO = RR " Region
AND XCPDK = 'X'." One time Customer
APPEND ITAB1.
CLEAR ITAB1.
ENDSELECT.
But its taking Lotz time im going mad now....
Plz help me ...My objective is to collect BELNR and compare it to BSAS and BSIS table BELNR to check whther Document is Clear or Not.
or if any one knws any table where REGIO wud be a Primary Key.
Hi,
Regio has a check table T005S
check that out
and try to use even belnr in where condition...
Hi if i see BSEC its s item Table why done u first get the details from BKPF and then write a for all entries
santhosh
Message was edited by:
Kaluvala Santhosh
Similar Messages
-
Error " In case of evaluated receipt settlement, please maintain tax code", during VI01
Dear Team
We have a scenario in our environment where for a delivery made for STO Purchase Order, we are trying to post shipping cost document for Shipping document.
When we try to save the document, the system returns the error " In case of evaluated receipt settlement, please maintain tax code".
We have checked in the system. The vendor to whom the PO has been raised is not maintained for Evaluated Receipt Settlement, and as this is a STO , no vendor info record has been maintained for the same.
The issue has started to come for a new plant and transportation route, for other routes and plants we are still able to proceed successfully for creation of shipment costs
Can this be an issue of master data maintanence that we may have missed during plant creation or transportation route creation
Else, Kindly guide.Hi Tarunveer,
Which Vendor are you mentioning: Plant Vendor of STO or Forwarding Agent.
I am suggesting to check in LFM2 for Forwarding Agent.
Same way, in the case of Invoice Tab in PO, (Which PO are you mentioning: STO or PO for Forwarding Agent?)
Regards,
MJ. -
I AM TRYING TO REPLICATE THE ADDRESS OF EQUIPMENT FROM ECC TO CRM.
I AM ABLE TO REPLICATE THE IDENTIFICATION NUMBER.
WHILE USING THE SAME FUNCTION MODULE FOR ADDRESS, THE ADDRESS IS NOT GETTING REPLICATED.
PLEASE CHECK THE CODE AND TELL ME WHAT PRE-REQUISITES MUST BE TAKEN INTO CONSIDERATION AND IS THERE ANY MISTAKE FROM ME.
FULL POINTS WILL BE REWARDED.
ITS VERY VERY URGENT.
METHOD IF_EX_CRM_EQUI_LOAD~ENLARGE_COMPONENT_DATA.
**Data declarations
DATA:
ls_equi type crmt_equi_mess,
ls_comp type ibap_dat1,
ls_comp_det1 TYPE IBAP_COMP3,
ls_address_data type ADDR1_DATA,
ls_object type comt_product_maintain_api,
ls_object1 type comt_product,
lv_object_id type IB_DEVICEID,
lv_object_guid type IB_OBJNR_GUID16.
**Map Sort field from ECC to CRM
Read table it_equi_dmbdoc-equi into ls_equi index 1.
lv_object_id = ls_equi-equnr.
move is_object to ls_object.
move ls_object-com_product to ls_object1.
lv_object_guid = ls_object1-product_guid.
move is_component to ls_comp.
ls_comp_det1-deviceid = lv_object_id.
ls_comp_det1-object_guid = lv_object_guid.
ls_comp_det1-EXTOBJTYP = 'CRM_OBJECT'.
ls_comp_det1-ibase = ls_comp-ibase.
ls_address_data-roomnumber = '1000'.
ls_address_data-floor = '10'.
ls_address_data-country = 'US'.
CALL FUNCTION 'CRM_IBASE_COMP_CHANGE'
EXPORTING
i_comp = ls_comp
I_COMP_DET = ls_comp_det1
I_ADDRESS_DATA = ls_address_data
I_ADDRESS_ADMIN =
I_PARTNER =
I_DATE =
I_TIME =
EXCEPTIONS
DATA_NOT_CONSISTENT = 1
IBASE_LOCKED = 2
NOT_SUCCESFUL = 3
OTHERS = 4
*IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
ENDMETHOD.Hi S B,
May I the procedure for the replication of serialnumber into device ID that is Identification field In Ibase.
And one more thing need this to be codded in the standard badi or needed an copy of the implementation .
plz help me as u already have done the requirement.
u will be twice rewarded.
Thanking u in advance for the reply.
Sree. -
Can anyone please explain this code to me?
I am a new (junior)programmer?Can anyone please explain this code to me in lame terms? I am working at a client location and found this code in a project.
_file name is AtccJndiTemplate.java_
Why do we use the Context class?
Why do we use the properties class?
package org.atcc.common.utils;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.springframework.jndi.JndiTemplate;
public class AtccJndiTemplate extends JndiTemplate
private static Logger logger = Logger.getLogger(AtccJndiTemplate.class.getName());
private String jndiProperties;
protected Context createInitialContext()
throws NamingException
Context context = null;
InputStream in = null;
Properties env = new Properties();
logger.info("Load JNDI properties from classpath file " + this.jndiProperties);
try
in = AtccJndiTemplate.class.getResourceAsStream(this.jndiProperties);
env.load(in);
in.close();
catch (NullPointerException e) {
logger.warning("Did not read JNDI properties file, using existing properties");
env = System.getProperties();
} catch (IOException e) {
logger.warning("Caught IOException for file [" + this.jndiProperties + "]");
throw new NamingException(e.getMessage());
logger.config("ENV: java.naming.factory.initial = " + env.getProperty
("java.naming.factory.initial"));
logger.config("ENV: java.naming.factory.url.pkgs = " + env.getProperty
("java.naming.factory.url.pkgs"));
logger.info("ENV: java.naming.provider.url = " + env.getProperty
("java.naming.provider.url") + " timeout=" + env.getProperty("jnp.timeout"));
context = new InitialContext(env);
return context;
public String getJndiProperties()
return this.jndiProperties;
public void setJndiProperties(String jndiProperties)
this.jndiProperties = jndiProperties;
}Hi,
JNDI needs some property such as the
java.naming.factory.initial
java.naming.provider.url
which are needed by the
InitialContext(env);
where env is a properties object
Now if you can not find the physical property file on the class path
by AtccJndiTemplate.class.getResourceAsStream(this.jndiProperties);
where the String "jndiProperties" get injected by certain IOC ( inverse of control container ) such as Spring framework
if not found then it will take the property from the system which will come from the evniromental variables which are set during the application start up i.e through the command line
java -Djava.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory -Danother=value etc..
I hope this could help
Regards,
Alan Mehio
London,UK -
Please check the Code snippet and detail the difference
Please go through the two code snippets given below...
Can some one please let me know if using generics is a better way to denote the signature and if yes, why is it so?
Thank you
Two classes:
class SimpleStr {
String name = "SimpleStr";
public SimpleStr(String name) {
this.name = name;
public String getName() {
return this.name;
public String toString() {
return getName();
class MySimpleStr extends SimpleStr {
String name = "MySimpleStr";
public MySimpleStr(String name) {
super(name);
this.name = name;
public String getName() {
return this.name;
public String toString() {
return getName();
Code Snippet 1:
class AnotherSimpleStr {
public <S extends SimpleStr>S getInfo() {
return (S)new MySimpleStr("val3");
Code Snippet 2:
class AnotherSimpleStr {
public SimpleStr getInfo() {
return new MySimpleStr("val3");
}Also, please see the code below, the getInfo() method is not taking care of Type safety right??!!!!
class AnotherSimpleStr {
public <S extends SimpleStr>S getInfo() {
return (S)new Object();
public <S extends SimpleStr>S getInfoAgain(Class<S> cls) {
return (S)new MySimpleStr("Val");
} -
My iPod touch 5th generation says: iPod is disabled, connect to iTunes. When I try to connect to iTunes it says: cannot connect, please put pass code in iPod... Please help!!!!
See Here > http://support.apple.com/kb/HT1808
You may need to try this More than Once...
Be sure to Follow ALL the Steps..
Once you have Recovered your Device...
Re-Sync your Content or Restore from the most recent Backup...
Restore from Backup > http://support.apple.com/kb/ht1766 -
What are the steps to optimise ABAP code
What are the steps to optimise ABAP code, that is how to increase the performance of a code?
Hi
Welcome to SDN forum
1) Dont use nested select statements
2) If possible use for all entries in addition
3) In the where addition make sure you give all the primary key
4) Use Index for the selection criteria.
5) You can also use inner joins
6) You can try to put the data from the first select statement into an Itab and then in order to select the data from the second table use for all entries in.
7) Use the runtime analysis SE30 and SQL Trace (ST05) to identify the performance and also to identify where the load is heavy, so that you can change the code accordingly
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5d0db4c9-0e01-0010-b68f-9b1408d5f234
ABAP performance depends upon various factors and in devicded in three parts:
1. Database
2. ABAP
3. System
Run Any program using SE30 (performance analys) to improve performance refer to tips and trics section of SE30, Always remember that ABAP perfirmance is improved when there is least load on Database.
u can get an interactive grap in SE30 regarding this with a file.
also if u find runtime of parts of codes then use :
Switch on RTA Dynamically within ABAP Code
*To turn runtim analysis on within ABAP code insert the following code
SET RUN TIME ANALYZER ON.
*To turn runtim analysis off within ABAP code insert the following code
SET RUN TIME ANALYZER OFF.
Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
Avoid for all entries in JOINS
Try to avoid joins and use FOR ALL ENTRIES.
Try to restrict the joins to 1 level only ie only for tables
Avoid using Select *.
Avoid having multiple Selects from the same table in the same object.
Try to minimize the number of variables to save memory.
The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
Avoid creation of index as far as possible
Avoid operators like <>, > , < & like % in where clause conditions
Avoid select/select single statements in loops.
Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.
Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
Avoid using ORDER BY in selects
Avoid Nested Selects
Avoid Nested Loops of Internal Tables
Try to use FIELD SYMBOLS.
Try to avoid into Corresponding Fields of
Avoid using Select Distinct, Use DELETE ADJACENT
Check the following Links
Re: performance tuning
Re: Performance tuning of program
http://www.sapgenie.com/abap/performance.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
check the below link
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
See the following link if it's any help:
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
Check also http://service.sap.com/performance
and
books like
http://www.sap-press.com/product.cfm?account=&product=H951
http://www.sap-press.com/product.cfm?account=&product=H973
http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
Performance tuning for Data Selection Statement
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
Debugger
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
Run Time Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
SQL trace
http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
CATT - Computer Aided Testing Too
http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm
Test Workbench
http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm
Coverage Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
Runtime Monitor
http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
Memory Inspector
http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
ECATT - Extended Computer Aided testing tool.
http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm
Just refer to these links...
performance
Performance
Performance Guide
performance issues...
Performance Tuning
Performance issues
performance tuning
performance tuning
You can go to the transaction SE30 to have the runtime analysis of your program.Also try the transaction SCI , which is SAP Code Inspector.
1 Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
2 Avoid for all entries in JOINS
3 Try to avoid joins and use FOR ALL ENTRIES.
4 Try to restrict the joins to 1 level only ie only for 2 tables
5 Avoid using Select *.
6 Avoid having multiple Selects from the same table in the same object.
7 Try to minimize the number of variables to save memory.
8 The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
9 Avoid creation of index as far as possible
10 Avoid operators like <>, > , < & like % in where clause conditions
11 Avoid select/select single statements in loops.
12 Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.
13 Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
14 Avoid using ORDER BY in selects
15 Avoid Nested Selects
16 Avoid Nested Loops of Internal Tables
17 Try to use FIELD SYMBOLS.
18 Try to avoid into Corresponding Fields of
19 Avoid using Select Distinct, Use DELETE ADJACENT.
<b>Reward points for useful Answers</b>
Regards
Anji -
When I edit PL/SQL packages or sql queries in SQL Developer 4.0 Early Adopter 2,
when i copy/paste SQL code, sometimes "Please amend your code to something like this: "select * from when", or "begin when; end;" appears.
Sometimes SQL Developer freezes.
Can I avoid that message (turn off some kind of checks in SQL Developer properties)?This has been raised/documented fixed in future releases here:
EA42 - Ambiguous Context Pop-up -
Créer un nuancier à l'aide des codes RVB
Bonjour,
Designer Coloriste d'un grand groupe industriel fabriquant de peinture.
Abonné à la suite Adobe CC
Nous voulons réaliser une version numérique de tout nos nuancier papier de peinture. Cela afin de travailler sur illustrator ou photoshope avec nos nuancier de façon numérique.
Nous possédons tout les codes RVB des teintes de nos nuancier sous format Excel. Nous avons essayé de rentrer manuellement via illustrator nos nuanciers mais cela prend un temps très important car il faut remplir chaque code rvb de chaque teinte, de chaque nuancier. Sans compter le risque d'erreure de saisie.
Nous voudrions donc savoir si il existe une manière plus simple, plus fiable et plus rapide de crée un nuancier de couleur compatible adobe type .AI .ASE ?
Possédez vous un logiciel ou une interface capable de créer rapidement un nuancier de couleur à l'aide des codes RVB ?
Y a t'il une solution plus simple dans illustrators pour entrer les couleurs que dans le nuancier -nouvelle teinte- ?
Vous remerciant,
Adrien Maschino
Designer Coloriste
AkzoNobelIl existe un property node qui te permet de desactiver les messages
d'alertes d'Excel.
Si tu es interessé, je peux t'envoyer un exemple.
Olivier B.
"Tecumseh" a écrit dans le message de
news:506500000008000000C3EE0000-1079395200000@exchange.ni.com...
Comment suprime-t-on une feuille excel sans message de confirmation à
partir de LabView à l'aide des ActiveX ?
J'ai essayé de suprimer une feuille excel par les ActiveX avec LabViex
7 mais un coup j'ai un message qui indique qu'il ne faut pas être sur
une feuille active ou qui me demande de confirmer la supression. En
fait, comment faut-il vraiment procéder et comment éviter un message
de confirmation afin de rester dans une procédure automatique? -
Liste des codes d'erreurs LabView
Bonjour,
Je développe actuellement sur LV8.5 et dans mon programme je dois remonter les erreurs possibles.
Certaine sont déjà prises en charge par LV mais je dois aussi prendre en compte celles de mon programme.
Pour ce faire, je retourne la source de l'erreur et un code mais j'aimerais éviter de rentrer en conflict avec des codes déjà existant.
Est ce qu'il existe une liste complète des erreurs que peut remonter LabView?
Merci,
Jull
Cordialement,
Julien V.
Solved!
Go to Solution.Hi Jull,
maybe this helps: http://zone.ni.com/reference/en-XX/help/371361B-01/lverror/error_code_ranges/
Mike -
Please specify Transaction code to load SCM ROUTE MASTER DATA (EWM Routes)
Please specify Transaction code to load SCM ROUTE MASTER DATA (EWM Routes data).
Regards
Dhirendra
Moderator message - Moved to correct forum
Edited by: Rob Burbank on Apr 21, 2009 8:58 AMRoute definition is done at 0VTC. You have define the Route with its description, Transit time, factory calender, carrier info etc. It is stored in TVRO table
Then yoiu will maintain the route determination in 0VRF.
Route Determination:
Dep zone of the shipping point + Destination zone (T-zone) of the ship-to + Transportation group + shipping conditions.
Route determination details are stored in TROLZ table. -
Please examine the code friends
hi all
hi all
please tell me what the args[0],args[1] etc
are in the program and how many of them should
be there.
this is encryption&decry codes given
to me.
i am not able to successfully encrypt a file
thanks
import java.io.*;
import java.security.*;
import javax.crypto.*;
import sun.misc.*;
public class Encrypt
public static void main(String args[]) throws Exception
if(args.length < 2)
System.out.println("Usage: java Encrypt key file text");
return;
Security.addProvider(new com.sun.crypto.provider.SunJCE());
Key key;
try
ObjectInputStream in = new ObjectInputStream(new FileInputStream(args[0]));
key = (Key)in.readObject();
in.close();
catch(Exception e)
System.out.println("Could not read private key from file" + args[0]);
System.out.println(e);
return;
Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, key);
String input = args[1];
for(int i=2; i < args.length; i++)
input += " " + args;
byte[] inputBytes = input.getBytes("UTF8");
byte[] outputBytes = cipher.doFinal(inputBytes);
BASE64Encoder encoder = new BASE64Encoder();
String base64 = encoder.encode(outputBytes);
System.out.println(base64);
Decryption
import java.io.*;
import java.security.*;
import javax.crypto.*;
import sun.misc.*;
public class Decrypt
public static void main(String args[]) throws Exception
if(args.length < 2)
System.out.println("Usage: java Decrypt key file text");
return;
Security.addProvider(new com.sun.crypto.provider.SunJCE());
Key key;
try
ObjectInputStream in = new ObjectInputStream(new FileInputStream(args[0]));
key = (Key)in.readObject();
in.close();
catch(Exception e)
System.out.println("Could not read private key from file" + args[0]);
System.out.println(e);
return;
Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, key);
BASE64Decoder decoder = new BASE64Decoder();
System.out.println(args[0]);
byte[] inputBytes = decoder.decodeBuffer(args[1]);
byte[] outputBytes = cipher.doFinal(inputBytes);
String result = new String(outputBytes, "UTF8");
System.out.println(result);Hello,
args[] are String that are passed at the run time. There are no limits. It acts as a Array of String. args[1] means first argument and so on.
Ex :: java MyClass Welcome 23
Here MyClass is class name
Welcome is args[0]
23 args[0]
If you are using these arguments as an int or float , you have to parse it into the Specific format.
Ex:: int x=Integer.parseInt(args[1]);
gives an int value of second argument.
(Abhishek Pandey) -
Please see my code and helpme out pls
//Making Circle here
gridx=20;
gridy=20;
num=0;
for (var i=0;i < 10;i++)
for (var j=0;j < 10;j++)
dot.duplicateMovieClip("dot"+num,num);
mc=this["dot"+num];
mc._x=gridx*i;
mc._y=gridy*j;
num++;
dot._visible=0;
// here i make plain circle, but problam is my all circle
open in fornt side, i want to that all my circle in background
//hide all selection MovieClip
for(i=1; i<=100; i++){
this.createEmptyMovieClip("test_mc"+i,
this.getNextHighestDepth());
this["test"+i]._visible = false;
// here i make fill circle mc, all hide with this code, but
problam is all circle come in background
//selection area
_root.onMouseDown = function() {
sel = this.createEmptyMovieClip("sel", 1);
sel.startx = _xmouse; // we need to reference these later,
so add them as properties of the selection clip
sel.starty = _ymouse;
this.onEnterFrame = function() {
with(sel){
clear();
lineStyle( 1, 000000, 100 );
moveTo(sel.startx, sel.starty);
lineTo(_xmouse, starty);
lineTo(_xmouse, _ymouse);
lineTo(sel.startx, _ymouse);
lineTo(sel.startx, sel.starty);
_root.onMouseUp = function() {
_root.select(sel.startx,sel.starty,sel._xmouse,sel._ymouse);
// call the selection function
removeMovieClip(sel);
this.onEnterFrame = undefined;
_root.select =
function(x1:Number,y1:Number,x2:Number,y2:Number){
// in case you dragged the selection box from right to left
or bottom to top, we need
// to work out the top left and bottom right coordinates..
var sx = Math.min(x1,x2);
var ex = Math.max(x1,x2);
var sy = Math.min(y1,y2);
var ey = Math.max(y1,y2);
for(var item in this){ // loop through all items in the
_root
if(typeof(this[item])=="movieclip"){ // if the current item
is a movieclip..
this[item]._visible = isInside(this[item],sx,sy,ex,ey);
function
isInside(mc:MovieClip,x1:Number,y1:Number,x2:Number,y2:Number):Boolean{
// check whether the selection coordinates enclose the mc
coordinates
return (x1<=mc._x && x2>=mc._x+mc._width
&& y1<=mc._y && y2>=mc._y+mc._height);
// here u can find selection option, selection option is
wroking, but same problam, it work in background, & hide my all
MC (that Plain Circle also) and highlight only which we select
// Some brif here:
i want to create plain circle in background, after that some
one want to slecte that palin circle highlight that circle only
with fill circle ( for better explaination see my fla file which is
attach here
Please see this
Pls pls help me out
thanks
praful damaniafor better explaination pls see my fla file which is attache
there & I have some quation about it as under
1) here i make fill circle mc, all hide with this code, but
problam is all circle come in background
2) here i make fill circle mc, all hide with this code, but
problam is all circle come in background
3) here u can find selection option, selection option is
wroking, but same problam, it work in background, & hide my all
MC (that Plain Circle also) and highlight only which we select
i want to create plain circle in background, after that some
one want to slecte that palin circle highlight that circle only
with fill circle
thanks for reply
Praful Damania -
Please help! Code 4: Unexpected Error on Subscribed Calendars
Hi there,
I am trying to subscribe to an iCal feed that I created in Yahoo Pipes. When I do so in iCal, I get this error: Code 4: Unexpected Error on Subscribed Calendars
http://tinyurl.com/3zpgrg (screenshot)
This is the ical feel that I am trying to subscribe to:
http://pipes.yahoo.com/pipes/pipe.run?id=BIpsYf9q3RGvUZDNBR50VA&render=ical
I've tested that the feed is functional because I have no problem subscribing to it in Google Calendar.
Does anyone have any suggestions about what I may be doing wrong? I have been pulling my hair out trying to get this to work for some time now -- and the alternative (using Google Calendar) is not pleasant!
This is with all updates installed including OS X 10.5.5
Thanks so much,
Tyler
[email protected]Does anyone have any ideas? This is driving me nuts!
Thanks=) -
Could someone please check my code
I really do not know whether this code is booking the appointment or not!
The table in the database is apptNo INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT, doctorNo INTEGER NOT NULL, time INTEGER NOT NULL, date DATE NOT NULL, patient_userID INTEGER NOT NULL,
dateBooked TIMESTAMP NOT NULL);
Is this completely wrong, its supposed to check the date and time entered in the form, and if they equal a date and time already stored in the database then it should return false, however i am unaware of how to write this code so u can check against different doctor's availabilities.
Does this mean i need an availability table?
BOOKAPPT.JSP
<%@ page language="java"
import="java.sql.*, java.io.*, java.util.*, connection.*"
errorPage="error.jsp" %>
<jsp:useBean id="myconn" class="connection.cmhconn"/>
<html>
<head>
<title>Appointment Booked</title>
</head>
<body>
<% if(date == "date")&&(time == "time")
return false;
%>
<p><b><font size="4">Unable to book Appointment please choose another, date and time!</font></b></p>
<%
}else
myconn.connect();
String date = request.getParameter("apptdate");
int time = Integer.parseInt(request.getParameter("appttime"));
myconn.BookAppt(date, time);
myconn.disconnect();
myconn.connect();
int doctorNo = Integer.parseInt(request.getParameter("doctorNo"));
String dateBooked = request.getParameter("date");
myconn.addAppointment(doctorNo, dateBooked);
myconn.disconnect();
%>
Your Appointment has been booked!
<%
%>
</body>
</html>
The bean methods are here:
public ResultSet viewAppointment() throws SQLException, Exception
ResultSet result = null;
try
String queryString = ("SELECT * FROM appointment;");
Statement statement = con.createStatement();
result =statement.executeQuery(queryString);
catch (SQLException sqle)
error = "SQLException: Could not execute query.";
throw new SQLException(error);
catch (Exception e)
error = "Exception: An Exception occured while retrieving user data.";
throw new Exception(error);
return result;
public void addAppointment(int apptNo, int doctorNo, int time, String date, int patient_userID, String dateBooked)
throws SQLException, Exception
if (con != null)
try
PreparedStatement updateAppointment;
updateAppointment = con.prepareStatement("insert into appointment values('', ?, ?, ?, ?, ?);");
updateAppointment.setInt(1, apptNo);
updateAppointment.setInt(2, doctorNo);
updateAppointment.setInt(3, time);
updateAppointment.setString(4, date);
updateAppointment.setString(5, dateBooked);
updateAppointment.setInt(6, patient_userID);
updateAppointment.execute();
catch (SQLException sqle)
error = "SQLException: Update failed, possible duplicate entry";
throw new SQLException(error);
}else
error = "Exception: Connection to databse was lost!";
throw new Exception(error);
public ResultSet viewBookAppt() throws SQLException, Exception
ResultSet result = null;
try
String queryString = ("SELECT date, time FROM appointment;");
Statement statement = con.createStatement();
result =statement.executeQuery(queryString);
catch (SQLException sqle)
error = "SQLException: Could not execute query.";
throw new SQLException(error);
catch (Exception e)
error = "Exception: An Exception occured while retrieving user data.";
throw new Exception(error);
return result;
Thanks in advancedthey are declared in the bean,
public ResultSet viewBookAppt() throws SQLException, Exception
ResultSet result = null;
try
String queryString = ("SELECT date, time FROM appointment;");
Statement statement = con.createStatement();
result =statement.executeQuery(queryString);
catch (SQLException sqle)
error = "SQLException: Could not execute query.";
throw new SQLException(error);
catch (Exception e)
error = "Exception: An Exception occured while retrieving user data.";
throw new Exception(error);
return result;
If this is wrong please tell me how to fix the erro
Thanks again
Maybe you are looking for
-
Can't see video on my web page, just click to play button...
Hello! I just made my first video tutorial and created a Quicktime video. I also made it web ready, which created a folder with the "how to," a poster image, etc. I read the directions and viewed the code for adding it to my web site, but I am new to
-
How do you reduce the size of a file
PLEASE HELP I'm so new to Premiere Pro I don't know what I'm doing. I received a file on a DVD (10 GB ) in a vob format and all I wanted to do was create a small 1 minute clip. When I got the sequence I wanted I tried to export the file and it ended
-
I've got a strange one. I've been able to network my imac to a dell laptop and they can see each other's shared directories. Tried to access an Excel file from the laptop and it didn't show the most recent file, but one that was nearly three weeks ol
-
I am currently developing an application that will create a process. The process itself will be cmd.exe with parameters. The application is Swing based and so I don't lock the event dispatch thread, I created a thread that will create the process. I
-
Does anyone know how FDM generates the folder names when a batch run is executed? For example, when there are files in the OpenBatch folder and a batch is executed it renames the folder to something like '40169_7402777778' and then recreates the Open