Sceduling -problem

Dear all
Scheduling does not happening in master recipe
i have checked following point
Resource -formula
planned scheduling parameter
process order scheduling paramete
I have used same resource and material in routing  there scheduling working fine.
Kindly help

Dear,
Please check the scheduling type in OPUZ and OPU5 it should be Backward scheduling with automatic scheduling
In resource in capacity tap check the have you define the,
Factory calendar ID  01
Active version       1
Base unit of meas.   H
Start                00:00:00
Finish               24:00:00
Length of breaks     00:00:00
Relevant to finite scheduling Tick mark.
Control key should mark for scheduling and check formula also.
In master reciepe you have option for scheduling. go to transaction C202, and from menu you would find the option to schedule the recipe.
Regards,
R.Brahmankar

Similar Messages

  • Rescue and Recovery - problem with sceduled backups

    hello,
    I use XP on a T61, with all latest updates...
    It seems R&R does not complete sceduled backups or does not list the generated backup.
    today (sceduled every 1st of month) it started and works, may be 1 hour, but no new entry in the list of backups was generated ? during run no messages were displayed except because of some files which were not able to save by r&r. 
    It seems, same problem was on 1 of january - no backup or/and no entry in list.
    So I started another backup manually. this was ok and a now an new entry is in the list.
    Does anybody have an idea ?
    Could it be a problem with Norton Antivirus Protection ?
    thank you for any help!
    Hans

    sorry i forget to mention that i an using  thinkpad T400. 

  • Problem with job sceduling

    Hi experts,
    i have schedule a job, but it could not executed because the system was down.
    like i schedule my job at 1:00 PM, but system is shutdown at that time, so the job could not executed,
    so i want to execute the same job again on some event like at system start etc.
    how can i do this, please suggest
    regards,

    I believe that the link below will solve your problem ..
    http://help.sap.com/saphelp_nw70/helpdata/en/c4/3a7f87505211d189550000e829fbbd/frameset.htm
    For further reference you can use the book
    *Job scheduling for SAP by Sap press ... *
    Really good book ..
    If your issue is that you want the job to happen if not at the scheduled time then at startup you can simply schedule the job twice both at the particular time as well as on Startup ..
    Hope this helps ..
    Regards
    Manthan

  • Performance problem for mass transactions after upgrade from 4.7 to ECC6.0

    Hi All,
    After upgrade from 4.7 to ECC 6.0 (IS-U), mass transactions such as FPY1, FPVA, FP04M are taking very long time to complete. for example, before upgrade the jobs sceduled for FPVA transaction take around 5k-6k seconds. Whereas after upgrade the jobs for FPVA with the same variant takes around 9k-10k seconds. I am unable to figure out the cause for exponential increase in the duration of several mass-jobs (after the upgrade). Are there any SAP notes or do we need to do any customizing setting to solve this problem? Does anyone face this kind of problem?
    Thanks in advance
    Taj

    Hi,
    This is normal after upgrade to 6.0, I have faced the same in all upgrades I've done and some others that I have involved also. If you did not requests and going live upgrade check I strongly recomend to schedule an Early Watch Check to minimize the impact. Times won´t be the same but can be very close if the system is tuned well. We have tuned systems that now run with good performance after this services.

  • Problem in Scheduling agreement in MM

    Hi Guys,
    I was trying to create Sch. agreement in the MM side.
    Step1. Created S.Agreement with the transaction code ME31L.
    Step 2. Maintained S.Agreement schedule lines using transaction code ME38.
    Then when open up Me38 and see,  there is a open  target qty is '0'.
    So what could be problem here, do I missing anything please explain me.
    Even I tried to create MIGO the error message is "Document XXXXXXXX does not contain any selectable items.
    So please some one explain me what could be the reason by getting open target qty is '0'.
    If you need any further information please let me know.
    Thanks
    ANGKS

    Dear
    Check weather material type what you are using.
    Check if you have release stretagy for that Pur docu Type.
    If yes  then
    ME35L - Release  by giving relese code.
    ME38 - Maintain   the Scheduling agreement.
    Check delivery Scheedule History for that  Scedule agreement for GR.
    with regards
    Shrinivas gangoor

  • Scedule for triggering XI(BPM)

    Hi,
    My Scenario Database(JDBC)-- XI3.0--
    SAP(RFC(synchronous))
    Everyday Night once XI Trigger and fetch the data from JDBC and sends via RFC call to SAP and take the response and put the the Database via XI .So Here  I planned to use the BPM
    I readed some below blogs and i found there is two ways to trigger the BPM in XI.,
    /people/community.user/blog/2006/11/16/step-by-step-realize-your-bpm-scheduling-capability                -BPM Sceduling
    /people/ganesh.karicharla2/blog/2008/02/08/periodic-scheduling-of-data-between-oracle-db-r3-system                -Periodic scheduled in JDBC
    One way is for JDBC Adapter is sceduling dialy and another way is for call the client proxy and pass the dummy data to trigger the BPM( this is a BPM sceduling).
    I am using XI 3.0 and Service Pack 20.Here my confusion is which way is going to do better way in the case of Future also.
    In the blogs writes , If i done JDBC adpter schedule,in the future any Patches are updated any problems comes under this Schedule process?
    Kindly suggest me your valuble updates it would be help me lot.
    Thank you very much.
    Sateesh

    In the blogs writes , If i done JDBC adpter schedule,in the future any Patches are updated any problems comes under this
    Schedule process?
    You have to re-schedule in such a case.......i think (not sure) there is even a SAP note mentioning the same..if i get hold of it will post the same.
    Is it possible to stop the during weekends and holidays via Adapter Sceduling?
    Holidays not possible....weekends can be done...can take reference from my replies here: Re: Communication Channel Scheduling only on certain days
    Regards,
    Abhishek.

  • Why my BPM related job goes to sceduled state in sxmb_moni?

    Hi Gurus,
            I am facing a unique problem in a sample BPM scenario. When I run this scenario my corresponding request in sxmb_moni goes to sceduled state. I have to go to QRFC monitor to unlock it. After this my BPM request runs to success. I am not able to understand why this is happening. Why it does not run in one go without getting locked in QRFC?
    My BPM scenario is like this: I am sending a customer number from a ABAP program from SAP R/3 system to XI system via outbound Async interface. This inturn sends customer number to BPM via abstract interface. The BPM then gets customer data from MSSQL server via JDBC adapter and inbound interface.
    This scenario is Async-Sync type.
    I don't see any problem with the mapping, interface etc.
    The scenario runs successfully once I unlock the request in QRFC monitor.
    Can somebody help me identify the reason why my BPM request goes to sceduled state in sxmb_moni?

    Can you try activating/registering your queues .
    sxmb_adm -> manage queues -> activate queues / SXMB_ADM -> Manage Queues -> Register Queues.
    Also in SMQ2 activate individual queues if any.
    ShabZ

  • Problem with BPM

    Hi,
    My BPM Scenarios are working earlier. Suddenly all the  scenarios are not working.All the messages are showing sceduled.
    My scenarios are
    IDOC-Webservice-IDOC  ( Asynch-scnch scenario)
    File-RFC-File ( Async-synch scenario)
    other scenarios other than BPM are working fine.
    What will be the problem.
    Regards,
    Jayasimha Jangam

    Hi,
    Can u check:
    1) SXMB_MONI trace.
    2) SMXB_MONI_BPE tcode
    3) SXI_CACHE and check the status of BPM it shud be 0 if its not then try to activate the BPM.
    chirag

  • DTW batch import problem

    Hi all,
    I've got a problem when trying to batch import from sql statement via odbc:
    "Can not connect to ODBC data source" and then "Can not get SQL handler"
    Manual import is working well with this odbc connection !
    The statement looks like: SELECT ItemCode AS 'Record Key', ItemCode, 'Y' AS 'Properties1' FROM OITM WHERE ItemCode = '4711'
    While manually importing I saved the xml and after that call: dtw.exe -s config.xml
    I used a SQL (Server 2005) Native Client DSN and only set db auth (sa...) and left other properties as default
    Anybody knows this behavior? Is the statement wrong? Or the odbc connection?
    (DTW Version 2005.0.0.29)
    Thanks in advance
    Marco
    Edited by: Marco Willems on Jun 29, 2010 6:34 PM

    Hi Marco,
    I checked this issue using the 2007A DTW (version 2005.0.30) and the 8.8 DTW (version 88.0.11). I haven't had success.
    The 8.8 version runs without error but did'nt update my test item. If you run it manually, the DTW reports one updated value. If I run it by a command (DTW -S <File>) it runs fine and reports zero successful update.
    I don't know if the DTW is able to run sceduled ODBC updates or not and would hope for an answer to this thread!
    All the best
    Torsten

  • Messages with Status "Scheduled" or "Sceduled for Outbound Processing"

    Hi All,
    When i run my interface, sxmb_moni shows the status of messages as "Scheduled" or "Sceduled for Outbound Processing".
    I know the reason and the problem gets resolved when I unlock the queues.
    But, is there a solution that I can resolve this completely? Reason being, everytime the interface is triggered, I have to unlock the queues. And if it is ccBPM scenario, I have to unlock multiple times, to acheive the flow completion
    Thanks,
    Swapna

    Hi,
    Check if u have set the value for monitor parameter QRFC_RESTART_ALLOWED to 1. default is 0.Also if your queues are registered in SMQR.Also checvk these reports
    · RSARFCSE: Restart an LUW (background job)
    · RSARFCEX: Restart tRFC LUWs (background job)
    · RSQOWKEX: Restart QOUT qRFC LUWs
    · RSQIWKEX: Restart QIN qRFC LUWs
    Thanks!
    Edited by: sudhir tiwari on Oct 10, 2008 12:19 PM

  • Capacity problem in production order

    Hi Friends
    I am facing a serious problem in capacity evaluation. After MRP run with scedulling as 2. After this I am able to see the capacity in respective work centers for the planned orders. But when converted to production order I am not able to see. When I checked the order it is showing as "Order 60003310 has no requirements in the eval.period, so there is no display".
    I dont have any clue as whats happening since the capacity is there till it is a planned order. Any suggestion?
    Thanks & regds

    Hi,
    Your problem is with Evaluation period as system not displaying the capacity so first check whther is nay capacity requirement is there in this period you can check with CM01 also.
    In OPD2.
    Assuming you want to create a time profile for 2 months.
                                            Entry Type    Start Date     End Date
    Database Read Period            J                -3                   3
    The database read period specifies the period in which capacity requirements are read  from the database. All requirements are accessed which are partially or completely 
    within the database read period.
    Evaluation Period          G              -1           60
    The evaluation period specifies the period over which data is formatted and displayed. 
    The evaluation period must lie within the database read period.
    Planning Period            G              -1           60
    The planning period defines the period in which the SAP system can carry out planning. 
    The planning period is smaller than or equal to the evaluation period. You cannot move  operations outside the planning period. Equally, when automatic finite scheduling is 
    carried out for an operation the system only searches for a new date .
    Please check and come back.
    Regards,
    R.Brahmankar

  • Problem related to delivery

    After sales order created and saved
    trying to do delivery (vlo1n). it is telling that 'no schedule line due for delivery upto the selected date'. What might be the problem.?

    Hi Rajesh,
    the error u are receiving means that the material u wana deliver can not be delivered today. Scedule line is nothing but your matl quantity with the delivery date. you must deliver the goods on the delivery date that the system has proposed for you(which depends upon your material master and sales document controls settings) or at a lter date that that.
    So, you need to do PGI in the delivery(vl02n) on the date which is proposed by system in va01>item>scedule lines; or after that date.
    So do the PGI on that date in vl02n n your problem will be solved.
    Hope it clears your doubts.
    Prashant
    Message was edited by:
            prashant m

  • Problem launching Resource planning tool

    Hi all,
           I have some problem in launching the resouce planning tool,T-Code:CRM_DWP.
    We have a freshly installed CRM 5.0 sytem,It is throwing me the following errors:
    <b>1)Internal error in Business Object Layer, method: GET_TIMESPEC_TYPES</b>
    <b>2)Serious internal error occurred that cannot be described in more detail</b>
    Are there any pre requisite settings that are required before launching this tool?
    please provide directions to solve this.
    Thanks in advance,
    Sethu.

    Hi Vick,
    If you want to use service resource planning tool, you basically have to
    decide the following:
    1.   Whether you want to use SAP's Scheduling Engine (WFM Core), or an
           external scheduling engine.
    2.   Whether or not you want to work with SAP R/3 HR integration. HR
           integration in this context means that employee data from the SAP
           R/3 HR component is transferred to SAP CRM using ALE. The
           availability information is transferred either to the WFM Core, or
           to the external scheduling engine.
    You can not use resource planning tool without  WFM Core, which is the scheduling engine for RPT
    The scheduling engine can be any thing SAP's WFM core or External Sceduling engine(Non-SAP).
    Let us assume that you are going with WFM Core. Again WFM core can be used in two ways.
    1. If you want to use the WFM Core in an APO system, you have to set up a  RFC   connection to the WFM Core
    2. If you want to use the WFM Core in a SAP CRM add-on, you have to leave the relevant field empty in 'Select RFC Connection'. (This Customizing setting i have already mentioned in my last posting)
    Once you have decided whether you want to use WFM core either with APO system or as a CRM add-on then you need to decide on R/3 HR Integration.
    1. Without SAP R/3 HR Integration
    If you do not use HR integration, use the 'CRM_LRP_FILL_RES' report to
    transfer the service employees, which are stored in the system in the
    role 'Employee', from SAP CRM to the WFM Core.
    2. With SAP R/3 HR Integration
    If you do use HR integration, employee data and availability information
    is transferred from the HR system to the WFM Core using the 'RPTWFMIF'
    report.
    So finally after setting up all these things related WFM core you can run your resource planning tool. There is no RPT without WFM core.
    Before doing all these you ned to install Software component 'WFMCORE'  with version 2.0 which comes along with CRM installation DVD.
    Still if you have any doubt please reply to this post.
    Please reward points if it helps.
    Murali

  • PROBLEM OF MULTI-THREAD?????

    Hi I'm writing a program like Multi-tap (the text entry before T9 introduced) on mobilephone.
    I'm having problem with some of the KEYs. They do not work properly.
    As indicated in the code
    HERE HERE [3] suppose to function as space button....However whenever the key is pressed before the 'time out' (I use sceduler to implement the time out) it will print half of the previous character instead of space. this key is not related to the scheduler. so i suspect it is something related to multi-thread programming.
    HERE HERE [1] function as the caps lock. it can even show the indicator properly.... so i need to settle this b4 i continue.
    HEREHERE [2] function as clear button. it doest work too
    Someone please help me....
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package textEntry;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.*;
    import java.util.*;
    * @author Ed's
    public class MyCanvas extends GameCanvas {
        public static final String[] keys =
        {".?!,@`-_:;()&\'\"~10�$��+x*/\\|[]=<>#","abc", "def", "ghi", "jkl",
        "mno", "pqrs", "tuv", "wxyz"};
        public static final String[] capitalKey =
        {".?!,@`-_:;()&\'\"~10�$��+x*/\\|[]=<>#","ABC", "DEF", "GHI", "JKL",
        "MNO", "PQRS", "TUV", "WXYZ"};
        StringBuffer width = new StringBuffer();
        Timer keyTimer;
        textEntryMain main;
        public static char ch;
        public boolean keypress=false;
        public boolean capital;
        public boolean diffrentKey;
        String currentIndicator="abc";
        int countPress=0;
        //int previndex=0;
        public int counter=-1;
        int index=-1;
        int print=0;
        int white_space=6;
        public StringBuffer sms;
        int baseline=10;
        int y_axis=12;
        int line=1;
        char last;
        boolean dontPrint=true; //dont print if timer printed or it is at begining
        Font font;
        Graphics g;
        public long time;
        int poundHit=0;
        String justPressed;
        String prevPressed=null;
        char prevChar;
        //Sms class
        Form smsfrm;
        TextField smsField ;
        //Char Selection speed
        public boolean first;
        int selection_speed=1500;
        //font color (blue)
        public int red=0,green=0,blue=255;
        //Background color (white)
        public int back_red=250,back_green=250,back_blue=250;
        Form menu;
        public MyCanvas(textEntryMain main){
            super(false);
            first=true;
            this.main=main;
            sms=new StringBuffer();
            g=getGraphics();
            font=Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_BOLD,Font.SIZE_LARGE);
            keyTimer = new Timer ();
            keyTimer.schedule (new task (this), selection_speed, selection_speed);
            drawIndicator(currentIndicator);
        public void drawIndicator(String indicator){
            Font f = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_ITALIC, Font.SIZE_SMALL);
            Graphics g = getGraphics();
            g.setFont(f);
            int x= getWidth()-20;
            g.setColor(back_red,back_green,back_blue);
            g.fillRect(x,2,15,10);
            g.setColor(20,20,20);
            g.drawString(indicator, x, 2, g.TOP|g.LEFT);
        public void callPaint(char ch){
            drawIndicator(currentIndicator);
            Graphics g= getGraphics();
            g.setColor(back_red,back_green,back_blue);
            if(first){
                g.fillRect(0,0,getWidth(),getHeight());
                reset();
                redrawAll();
                first=false;
            //baseline -1 so that i can cover the pointer
            g.fillRect(baseline-1,y_axis,font.charWidth(this.last)+3,font.getHeight());
            g.setColor(red,green,blue);
            g.setFont(font);
            g.drawChar(ch,baseline,line*24,g.LEFT|g.BASELINE);
            flushGraphics();
        public void showPointer(){
            Graphics g = getGraphics();
            g.setColor(0,0,0);
            g.drawLine(baseline,y_axis,baseline,2*line*12);
            flushGraphics();
        //pointer appear //pointer disappear-use white line so that it cover the pointer line
        public void hidePointer(){
            Graphics g = getGraphics();
            g.setColor(back_red,back_green,back_blue);
            g.drawLine(baseline,y_axis,baseline,2*line*12);
            flushGraphics();
        //draw the selected
        public void ConfirmPaint(char ch){
            Graphics g = getGraphics();
            sms.append(ch);
            g.setColor(red,green,blue);
            g.setFont(font);
            g.drawChar(ch,baseline,line*24,g.LEFT|g.BASELINE); //draw the selected
            baseline+=font.charWidth(ch); // so that the nect letter won't be drawn on the same position
            if(baseline>getWidth()-30){     //move to the next line
                width.append((char)baseline);
                baseline=10;y_axis+=24;
                line+=1;
            flushGraphics();
        public synchronized void deleteChar(){
            if(sms.charAt(sms.length()-1)==' '){
                baseline-=white_space;
                Graphics g= getGraphics();
                g.setColor(back_red,back_green,back_blue);
                g.fillRect(baseline,y_axis,font.charWidth(sms.charAt(sms.length()-1))+2,font.getHeight());
                sms.deleteCharAt(sms.length()-1);
            else{
                baseline-=font.charWidth(sms.charAt(sms.length()-1));
                Graphics g= getGraphics();
                g.setColor(back_red,back_green,back_blue);
                g.fillRect(baseline,y_axis,font.charWidth(sms.charAt(sms.length()-1))+2,font.getHeight());
                sms.deleteCharAt(sms.length()-1);
            flushGraphics();
        public void redraw(char ch ){
            Graphics g= getGraphics();
            g.setColor(red,green,blue);
            g.setFont(font);
            g.drawChar(ch,baseline,line*24,g.LEFT|g.BASELINE);
            baseline+=font.charWidth(ch);
            if(baseline>getWidth()-30){
                width.append((char)baseline);
                baseline=10;y_axis+=24;
                line+=1;
            flushGraphics();
        public void reset(){
            if(width.length() >0)
            width.delete(0,width.length()-1);
            line=1;
            baseline=10;y_axis=12;
        public void redrawAll(){
            Graphics g=getGraphics();
            g.setColor(back_red,back_green,back_blue);
            g.fillRect(0,0,getWidth(),getHeight());
            reset();
            for(int a=0;a<sms.length();a++)
            redraw(sms.charAt(a));
        /*public synchronized void keyRepeated (int keyCode) {
            int one=1;
        /*    if(keyCode != KEY_POUND && keyCode != KEY_STAR){       
                ConfirmPaint((char)keyCode);
            if (keyCode == 1){
            ConfirmPaint((char)one);
        public synchronized void keyPressed (int keyCode) {
            justPressed=getKeyName(keyCode);
            time=System.currentTimeMillis(); // record the time when the keypress is pressed
            if(justPressed.equals("NUM0")){ //caps lock show indicator .............HERE HERE HERE HERE [1]
                if(poundHit == 0){
                    currentIndicator="ABC";
                    poundHit++;
                    drawIndicator(currentIndicator);
                    //set the string buffer to another one
                if(poundHit == 1){
                    currentIndicator="123";
                    poundHit++;
                    drawIndicator(currentIndicator);
                if(poundHit == 2){
                    currentIndicator="abc";
                    poundHit=0;
                    drawIndicator(currentIndicator);
            if(justPressed.equalsIgnoreCase("SEND")){ //send button allocated as clear button   ................. HERE HERE HERE [2]
                if(sms.length()>0){
                    hidePointer();
                    if(baseline<=10){
                        System.out.println(baseline);
                        line-=2;
                        baseline=(int)width.charAt(line);
                        line++;
                        y_axis-=24;
                    deleteChar();
            if(justPressed.equals("STAR")){//space  ........................................    HERE HERE HERE HERE HERE [3]
                    hidePointer();
                    sms.append(" ");
                    baseline+=white_space;
                    showPointer();
                    prevPressed=justPressed;
            else{
                if(justPressed.equals("NUM1")){index=0;}       
                if(justPressed.equals("NUM2")){index=1;}
                if(justPressed.equals("NUM3")){index=2;}       
                if(justPressed.equals("NUM4")){index=3;}       
                if(justPressed.equals("NUM5")){index=4;}
                if(justPressed.equals("NUM6")){index=5;}
                if(justPressed.equals("NUM7")){index=6;}
                if(justPressed.equals("NUM8")){index=7;}
                if(justPressed.equals("NUM9")){index=8;}
                if(index==0){
                    keypress=true;
                    if(justPressed.equalsIgnoreCase(prevPressed) || dontPrint){
                        if(dontPrint){countPress=35;}
                        if(countPress<34){
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                        else{
                            countPress=0;  
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                        dontPrint=false;
                    else{   //this is executed when the key is not repeated (prev!=)
                            ConfirmPaint(last);
                            countPress=0;  
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                    last=MyCanvas.ch;
                    prevPressed=justPressed;
                if(index==1 || index==2 || index == 3 || index == 4
                || index ==5 || index==7){
                    keypress=true;
                    if(justPressed.equalsIgnoreCase(prevPressed) || dontPrint){
                        if(dontPrint){countPress=4;}
                        if(countPress<3){
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                        else{
                            countPress=0;  
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                        dontPrint = false;
                    else{   //this is executed when the key is not repeated
                            ConfirmPaint(last);
                            countPress=0;  
                            MyCanvas.ch=keys[index].charAt(countPress);                  
                            callPaint(MyCanvas.ch);
                            countPress++;
                    last=MyCanvas.ch;
                    prevPressed=justPressed;
                if(index==6 || index==8){
                    keypress=true;
                    if(justPressed.equalsIgnoreCase(prevPressed)|| dontPrint){
                        if(dontPrint){countPress=5;}
                        if(countPress<4){
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                        else{
                            countPress=0;  
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                        dontPrint=false;
                    else{   //this is executed when the key is not repeated
                            ConfirmPaint(last);
                            countPress=0;  
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                    last=MyCanvas.ch;
                    prevPressed=justPressed;
    /////////////task class for schedule on constructor
    class task extends TimerTask {
        public static boolean bool;
        MyCanvas canvas;
        public task (MyCanvas canvas) {
            this.canvas=canvas;
        public void run () {
            if(canvas.keypress){
                if(System.currentTimeMillis()-canvas.time>150){ //compare the time with the time out
                    canvas.ConfirmPaint(MyCanvas.ch);
                    canvas.counter=-1;
                    canvas.keypress=false;
                    canvas.dontPrint=true;
                    canvas.showPointer();
    }

    Hi I'm writing a program like Multi-tap (the text entry before T9 introduced) on mobilephone.
    I'm having problem with some of the KEYs. They do not work properly.
    As indicated in the code
    HERE HERE [3] suppose to function as space button....However whenever the key is pressed before the 'time out' (I use sceduler to implement the time out) it will print half of the previous character instead of space. this key is not related to the scheduler. so i suspect it is something related to multi-thread programming.
    HERE HERE [1] function as the caps lock. it can even show the indicator properly.... so i need to settle this b4 i continue.
    HEREHERE [2] function as clear button. it doest work too
    Someone please help me....
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package textEntry;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.*;
    import java.util.*;
    * @author Ed's
    public class MyCanvas extends GameCanvas {
        public static final String[] keys =
        {".?!,@`-_:;()&\'\"~10�$��+x*/\\|[]=<>#","abc", "def", "ghi", "jkl",
        "mno", "pqrs", "tuv", "wxyz"};
        public static final String[] capitalKey =
        {".?!,@`-_:;()&\'\"~10�$��+x*/\\|[]=<>#","ABC", "DEF", "GHI", "JKL",
        "MNO", "PQRS", "TUV", "WXYZ"};
        StringBuffer width = new StringBuffer();
        Timer keyTimer;
        textEntryMain main;
        public static char ch;
        public boolean keypress=false;
        public boolean capital;
        public boolean diffrentKey;
        String currentIndicator="abc";
        int countPress=0;
        //int previndex=0;
        public int counter=-1;
        int index=-1;
        int print=0;
        int white_space=6;
        public StringBuffer sms;
        int baseline=10;
        int y_axis=12;
        int line=1;
        char last;
        boolean dontPrint=true; //dont print if timer printed or it is at begining
        Font font;
        Graphics g;
        public long time;
        int poundHit=0;
        String justPressed;
        String prevPressed=null;
        char prevChar;
        //Sms class
        Form smsfrm;
        TextField smsField ;
        //Char Selection speed
        public boolean first;
        int selection_speed=1500;
        //font color (blue)
        public int red=0,green=0,blue=255;
        //Background color (white)
        public int back_red=250,back_green=250,back_blue=250;
        Form menu;
        public MyCanvas(textEntryMain main){
            super(false);
            first=true;
            this.main=main;
            sms=new StringBuffer();
            g=getGraphics();
            font=Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_BOLD,Font.SIZE_LARGE);
            keyTimer = new Timer ();
            keyTimer.schedule (new task (this), selection_speed, selection_speed);
            drawIndicator(currentIndicator);
        public void drawIndicator(String indicator){
            Font f = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_ITALIC, Font.SIZE_SMALL);
            Graphics g = getGraphics();
            g.setFont(f);
            int x= getWidth()-20;
            g.setColor(back_red,back_green,back_blue);
            g.fillRect(x,2,15,10);
            g.setColor(20,20,20);
            g.drawString(indicator, x, 2, g.TOP|g.LEFT);
        public void callPaint(char ch){
            drawIndicator(currentIndicator);
            Graphics g= getGraphics();
            g.setColor(back_red,back_green,back_blue);
            if(first){
                g.fillRect(0,0,getWidth(),getHeight());
                reset();
                redrawAll();
                first=false;
            //baseline -1 so that i can cover the pointer
            g.fillRect(baseline-1,y_axis,font.charWidth(this.last)+3,font.getHeight());
            g.setColor(red,green,blue);
            g.setFont(font);
            g.drawChar(ch,baseline,line*24,g.LEFT|g.BASELINE);
            flushGraphics();
        public void showPointer(){
            Graphics g = getGraphics();
            g.setColor(0,0,0);
            g.drawLine(baseline,y_axis,baseline,2*line*12);
            flushGraphics();
        //pointer appear //pointer disappear-use white line so that it cover the pointer line
        public void hidePointer(){
            Graphics g = getGraphics();
            g.setColor(back_red,back_green,back_blue);
            g.drawLine(baseline,y_axis,baseline,2*line*12);
            flushGraphics();
        //draw the selected
        public void ConfirmPaint(char ch){
            Graphics g = getGraphics();
            sms.append(ch);
            g.setColor(red,green,blue);
            g.setFont(font);
            g.drawChar(ch,baseline,line*24,g.LEFT|g.BASELINE); //draw the selected
            baseline+=font.charWidth(ch); // so that the nect letter won't be drawn on the same position
            if(baseline>getWidth()-30){     //move to the next line
                width.append((char)baseline);
                baseline=10;y_axis+=24;
                line+=1;
            flushGraphics();
        public synchronized void deleteChar(){
            if(sms.charAt(sms.length()-1)==' '){
                baseline-=white_space;
                Graphics g= getGraphics();
                g.setColor(back_red,back_green,back_blue);
                g.fillRect(baseline,y_axis,font.charWidth(sms.charAt(sms.length()-1))+2,font.getHeight());
                sms.deleteCharAt(sms.length()-1);
            else{
                baseline-=font.charWidth(sms.charAt(sms.length()-1));
                Graphics g= getGraphics();
                g.setColor(back_red,back_green,back_blue);
                g.fillRect(baseline,y_axis,font.charWidth(sms.charAt(sms.length()-1))+2,font.getHeight());
                sms.deleteCharAt(sms.length()-1);
            flushGraphics();
        public void redraw(char ch ){
            Graphics g= getGraphics();
            g.setColor(red,green,blue);
            g.setFont(font);
            g.drawChar(ch,baseline,line*24,g.LEFT|g.BASELINE);
            baseline+=font.charWidth(ch);
            if(baseline>getWidth()-30){
                width.append((char)baseline);
                baseline=10;y_axis+=24;
                line+=1;
            flushGraphics();
        public void reset(){
            if(width.length() >0)
            width.delete(0,width.length()-1);
            line=1;
            baseline=10;y_axis=12;
        public void redrawAll(){
            Graphics g=getGraphics();
            g.setColor(back_red,back_green,back_blue);
            g.fillRect(0,0,getWidth(),getHeight());
            reset();
            for(int a=0;a<sms.length();a++)
            redraw(sms.charAt(a));
        /*public synchronized void keyRepeated (int keyCode) {
            int one=1;
        /*    if(keyCode != KEY_POUND && keyCode != KEY_STAR){       
                ConfirmPaint((char)keyCode);
            if (keyCode == 1){
            ConfirmPaint((char)one);
        public synchronized void keyPressed (int keyCode) {
            justPressed=getKeyName(keyCode);
            time=System.currentTimeMillis(); // record the time when the keypress is pressed
            if(justPressed.equals("NUM0")){ //caps lock show indicator .............HERE HERE HERE HERE [1]
                if(poundHit == 0){
                    currentIndicator="ABC";
                    poundHit++;
                    drawIndicator(currentIndicator);
                    //set the string buffer to another one
                if(poundHit == 1){
                    currentIndicator="123";
                    poundHit++;
                    drawIndicator(currentIndicator);
                if(poundHit == 2){
                    currentIndicator="abc";
                    poundHit=0;
                    drawIndicator(currentIndicator);
            if(justPressed.equalsIgnoreCase("SEND")){ //send button allocated as clear button   ................. HERE HERE HERE [2]
                if(sms.length()>0){
                    hidePointer();
                    if(baseline<=10){
                        System.out.println(baseline);
                        line-=2;
                        baseline=(int)width.charAt(line);
                        line++;
                        y_axis-=24;
                    deleteChar();
            if(justPressed.equals("STAR")){//space  ........................................    HERE HERE HERE HERE HERE [3]
                    hidePointer();
                    sms.append(" ");
                    baseline+=white_space;
                    showPointer();
                    prevPressed=justPressed;
            else{
                if(justPressed.equals("NUM1")){index=0;}       
                if(justPressed.equals("NUM2")){index=1;}
                if(justPressed.equals("NUM3")){index=2;}       
                if(justPressed.equals("NUM4")){index=3;}       
                if(justPressed.equals("NUM5")){index=4;}
                if(justPressed.equals("NUM6")){index=5;}
                if(justPressed.equals("NUM7")){index=6;}
                if(justPressed.equals("NUM8")){index=7;}
                if(justPressed.equals("NUM9")){index=8;}
                if(index==0){
                    keypress=true;
                    if(justPressed.equalsIgnoreCase(prevPressed) || dontPrint){
                        if(dontPrint){countPress=35;}
                        if(countPress<34){
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                        else{
                            countPress=0;  
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                        dontPrint=false;
                    else{   //this is executed when the key is not repeated (prev!=)
                            ConfirmPaint(last);
                            countPress=0;  
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                    last=MyCanvas.ch;
                    prevPressed=justPressed;
                if(index==1 || index==2 || index == 3 || index == 4
                || index ==5 || index==7){
                    keypress=true;
                    if(justPressed.equalsIgnoreCase(prevPressed) || dontPrint){
                        if(dontPrint){countPress=4;}
                        if(countPress<3){
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                        else{
                            countPress=0;  
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                        dontPrint = false;
                    else{   //this is executed when the key is not repeated
                            ConfirmPaint(last);
                            countPress=0;  
                            MyCanvas.ch=keys[index].charAt(countPress);                  
                            callPaint(MyCanvas.ch);
                            countPress++;
                    last=MyCanvas.ch;
                    prevPressed=justPressed;
                if(index==6 || index==8){
                    keypress=true;
                    if(justPressed.equalsIgnoreCase(prevPressed)|| dontPrint){
                        if(dontPrint){countPress=5;}
                        if(countPress<4){
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                        else{
                            countPress=0;  
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                        dontPrint=false;
                    else{   //this is executed when the key is not repeated
                            ConfirmPaint(last);
                            countPress=0;  
                            MyCanvas.ch=keys[index].charAt(countPress);
                            callPaint(MyCanvas.ch);
                            countPress++;
                    last=MyCanvas.ch;
                    prevPressed=justPressed;
    /////////////task class for schedule on constructor
    class task extends TimerTask {
        public static boolean bool;
        MyCanvas canvas;
        public task (MyCanvas canvas) {
            this.canvas=canvas;
        public void run () {
            if(canvas.keypress){
                if(System.currentTimeMillis()-canvas.time>150){ //compare the time with the time out
                    canvas.ConfirmPaint(MyCanvas.ch);
                    canvas.counter=-1;
                    canvas.keypress=false;
                    canvas.dontPrint=true;
                    canvas.showPointer();
    }

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

Maybe you are looking for

  • Sudden MASSIVE battery drain on 3GS 4.0.1

    Never had any issues with battery on 4.0.1 until today. I took the phone off the charger just before 7 a.m. Central this morning. I did not have the phone hooked up to my car stereo on the way to work this morning since my car is in the shop and I'm

  • No iPod Icon After Upgrade to 3.0.1

    My iPhone (3G) just finished upgrading to 3.0.1, and now the iPod icon went missing. Its not on any other screen... Is anyone having a similar issue? Any resolutions? Thanks! Message was edited by: moosecow

  • External hard drive not showing in finder or disk utility

    1TB WD external hard drive is not showing in finder sidebar, destop, or disk utility. I have checked and all the preferences are ticked. The disk itself is showing a light and making a whirring sound during start up after being plugged into the power

  • When I Conditional Supress the page footer. It occupy space in report

    I am designing Crystal report with multiple page footers.Initially I have suppressed all page footer. Each page footer is un suppressed against a specific Test Id (db Field). I have done this with formula for each page footer. The problem is when Pag

  • Problem With Fax Modem 43R1814 CallerID

    The Caller ID Doesn't Appear when I Use The Command AT+VCID=1 and the fax replies with OK. and when I use the Command AT#CID=1 The fax Replies with ERROR,any Ideas How to Read The Caller ID