[HELP] - BAPI_PRODORDCONF_CREATE_TT

Hello SAP Gurus,
I am using BAPI_PRODORDCONF_CREATE_TT and BAPI_PRODORDCONF_GET_TT_PROP to simulate transaction CO11N.
There is the sample code:
CALL FUNCTION 'BAPI_PRODORDCONF_GET_TT_PROP'
     EXPORTING
       PROPOSE                  = i_propose
*   IMPORTING
*     RETURN                   =
      TABLES
        TIMETICKETS              = i_timetickets
        GOODSMOVEMENTS           = i_GOODSMOVEMENTS
        LINK_CONF_GOODSMOV       = i_LINK_CONF_GOODSMOV
        DETAIL_RETURN            = i_DETAIL_RETURN.
loop at i_GOODSMOVEMENTS.
    SELECT * FROM  MARA
               WHERE  MATNR  = i_GOODSMOVEMENTS-MATERIAL
               AND    MTART  = 'ZPA1'.
        ENDSELECT.
        if sy-subrc = 0.
          i_GOODSMOVEMENTS-batch = texto_numero_serie.
          modify i_GOODSMOVEMENTS INDEX sy-tabix.
        endif.
  endloop.
CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'
    EXPORTING
       POST_WRONG_ENTRIES       = '2'
*     TESTRUN                  =
*   IMPORTING
*     RETURN                   =
      TABLES
        TIMETICKETS              = i_timetickets
        GOODSMOVEMENTS           = i_GOODSMOVEMENTS
        LINK_CONF_GOODSMOV       = i_LINK_CONF_GOODSMOV
        DETAIL_RETURN            = i_DETAIL_RETURN.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
     EXPORTING
       WAIT          = 'X'
*   IMPORTING
*     RETURN        =
I am using network orders and I am making the confirmation for the top order. The problem is in goods movements, I am getting the error M7349 "Content of order 198: T_PA_01 transferred to interface (IMSEG): MATERIAL".
Can someone help me with this? Thanks in advance.
Cheers,

Hi,
I'm having problem regarding BAPI_PRODORDCONF_CREATE_TT. I have a return error 'confirmations are incorrect'.
Please help.
Here's the sample code.
data: it_data type table of tb_data,
  wa_data type tb_data,
  v_return TYPE BAPIRET1,
  propose TYPE BAPI_PP_CONF_PROP.
>>>>>>
  clear wa_data.
  loop at it_data into wa_data.
    clear: wa_timetickets, wa_goodsmovements, wa_link_conf_goodsmov.
    wa_timetickets-orderid = wa_data-orderid.
    wa_timetickets-operation = wa_data-operation.
    wa_timetickets-fin_conf = 'X'.
    wa_timetickets-clear_res = 'X'.
    wa_timetickets-postg_date = wa_data-postg_date.
    wa_timetickets-yield = wa_data-yield.
    wa_goodsmovements-material = wa_data-material.
    wa_goodsmovements-plant = wa_data-plant.
    wa_goodsmovements-stge_loc = wa_data-stge_loc.
    wa_goodsmovements-batch = wa_data-batch.
    wa_goodsmovements-move_type = wa_data-move_type.
    wa_goodsmovements-entry_qnt = wa_data-entry_qnt.
    wa_goodsmovements-entry_uom = wa_data-entry_uom.
    wa_goodsmovements-orderid = wa_data-gd_orderid.
    wa_link_conf_goodsmov-index_confirm = wa_data-index_confirm.
    wa_link_conf_goodsmov-index_goodsmov = wa_data-index_goodsmov.
    append wa_timetickets to it_timetickets.
    append wa_goodsmovements to it_goodsmovements.
    append wa_link_conf_goodsmov to it_link_conf_goodsmov.
  endloop.
    PROPOSE-ACTIVITY = 'X'.
    v_tabix = v_tabix + 1.
    CALL FUNCTION 'BAPI_PRODORDCONF_GET_TT_PROP'
     EXPORTING
       PROPOSE                  = propose
     IMPORTING
       RETURN                   = v_return
      TABLES
       TIMETICKETS              = it_timetickets
       GOODSMOVEMENTS           = it_goodsmovements
       LINK_CONF_GOODSMOV       = it_link_conf_goodsmov
      DETAIL_RETURN            =
    MESSAGE i398(00) with 'TYPE:' v_return-type '>' v_return-message.
    CLEAR v_return.
    CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'
     EXPORTING
       POST_WRONG_ENTRIES       = '2'
       TESTRUN                  = ''
IMPORTING
   RETURN                   = v_return
      TABLES
           TIMETICKETS              = it_timetickets
           GOODSMOVEMENTS           = it_goodsmovements
           LINK_CONF_GOODSMOV       = it_link_conf_goodsmov
  DETAIL_RETURN            =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
     EXPORTING
       WAIT          = 'X'
IMPORTING
  RETURN        =
    MESSAGE i398(00) with 'TYPE:' v_return-type '>' v_return-message.

Similar Messages

  • Delivery Completed Indicator set during BAPI_PRODORDCONF_CREATE_TT

    Hi Gurus,
    I am using BAPI_PRODORDCONF_CREATE_TT to perform our production confirmation.
    I want to force a goods movement item to be "Delivery Completed". I found the field GOODSMOVEMENTS-NO_MORE_GR in the BAPI which has a component type ELIKZ. When i put an X for this item during the BAPI run, it does not change the status of the item in the production order as Final Issue.
    Is GOODSMOVEMENTS-NO_MORE_GR equal to the field "Indicator: Goods movement item completed" (ENDKZ) in the confirmation? They have the same description.
    I found another field which is GOODSMOVEMENTS-WITHDRAWN (KZEAR) but it also does not change the status of the item after BAPI run.
    Thanks in advance for all your help.
    Regards,
    john

    Hello John
    Indicator NO_MORE_GR should be used only for the goods receipt with movement 101 and it will not affect the components.
    Field WITHDRAWN is the correct field to be used to set the final issue indicator for a component, however, you must ensure that you are sending the correct reservation number and item.
    I suggest you to use BAPI BAPI_PRODORDCONF_GET_TT_PROP to get the proposed data for the confirmation, including the components, and change the values when necessary.
    BR
    Caetano

  • Unable to do goods movement when calling BAPI_PRODORDCONF_CREATE_TT

    Hi,
    I have used BAPI_PRODORDCONF_CREATE_TT as RFC.
    When I run the bapi with that of input payload seperately production order confirmation and goodsmovement  are done successfully.
    But when I run the interface then only production order confirmation is successfull while goodsmovement is unsuccessfull.
    Any help on this please?
    Thanks in advance,
    Rohan.

    Hello Rohan,
    I you are using BPM to call two RFC's seperately for prd.conf and goods movement, then, try to incorporate a Wait step in the BPM!
    Regards,
    Jilan

  • Production Order Confirmation Error  in "BAPI_PRODORDCONF_CREATE_TT"

    Dear all,
                Recently i've faced some problem regarding "BAPI_PRODORDCONF_CREATE_TT". whenever it'll create the production Order the system show me an error 'Two operation times are not in ascending order'. What's that it mean? i've only 1 operation in Routing. Can anybody please help me to figure it out.
    regards,
    sameek mazumder.

    Dear Santosh,
                          I've already do this into ascending order like START DATE: 10.02.2011
                                                                                    START TIME: 06:00:00
                                                                                    END DATE: 10.02.2011
                                                                                    END TIME: 07:00:00
    BUT THEN ALSO IT WILL SHOW THE SAME ERROR.
    REGARDS,
    SAMEEK.

  • Is there anyone who can help me out in this!!!!

    Trying this for the fourth time........
    Hi gurus,
    I have posted this thread earlier also but didnt get any response, so I was just wondering did I ask something unrealistic?
    Hi gurus,
    I am working on an interface where I will be getting the production order number and then based on this order number I need to update some fields in transaction code ... CO11N...such as Quantity produced, reason of variance, batch number and posting date. So what I believe is first I need to pass the order number to the BAPI_PRODORD_GET_DETAIL to get the details of the production order and then update the production order by using the BAPI_PRODORDCONF_CREATE_TT, but my problem is I am new to ABAP I got to know what should be the process but I am not being able to implement it. So basically the program needs to pick the data from the internal table and copy it in SAP. My internal table looks liks
    data : BEGIN OF it_input occurs 0,
    order_no like afko-aufnr, "Order Number
    opr_no like afru-vornr,
    quant like afru-lmnga,
    varian like afru-grund,
    budat(10) type c,
    matnr like caufvd-matnr, "Materials
    erfmg like cowb_comp-/cwm/erfmg,
    charg like mcha-charg,
    END OF it_input.
    So can you please help me out in this..I mean step by step or if there is any other suitable way.
    Thanks,
    Rajeev .......

    Rajeev,
    Based on your post, just may not be clear what you are asking for then.
    I think your general approach that you have described is correct.  Without knowing the source of your data for the internal table, it is hard to completely provide an answer but a typical interface might look something like this:
    1.  Selection screen with parameters for the file name (If a file is the source of your data)
    2.  Load data from the file into your internal table.
    3.  Loop at your data
    4.  Call the Get Detail BAPI
    5.  Using the data returned from the get detail BAPI and your internal table create the importing, exporting, tables parameter for your Create BAPI.
    This step might need some more clarification.  I am not sure if you are using the right BAPI for what you are trying to accomplish.  First this appears to be a Create function and not a change, second, it appears that this is for Time Ticket information against a production order.  I haven't used any BAPIs for production orders before so I can't give you a definite answer.  If you cannot find an appropriate BAPI, you might also try creating a BDC/Call transaction update.
    6.  Review the error messages/return code from your production order change
    7.  Output some type of report to the user regarding successful updates, errors, etc.
    I hope this helps provide some guidance.
    Best Regards,
    Chris H.

  • Bapi re: CO11N BAPI_PRODORDCONF_GET_TT_PROP & BAPI_PRODORDCONF_CREATE_TT

    Hi,
      I have a little problem with the bapi's
      BAPI_PRODORDCONF_CREATE_TT and BAPI_PRODORDCONF_GET_TT_PROP
    1.  in abap i call BAPI_PRODORDCONF_GET_TT_PROP first , the proposed goodsmovement is not the same as the default on co11n, it does not included the bom components of the materials, same thing if i leave the goodsmovement table on bapi BAPI_PRODORDCONF_CREATE_TT.
    2. so i manually added the bom components on the goodsmovement table, also populated the link_conf_goodsmov table, BAPI_PRODORDCONF_GET_TT_PROP confirmation was okay but now the results are  generating 2 documents.
        tried populating other fields on the goodsmovement table but with no effects
      i want to ask if there are configuration regarding the default values in bapi  BAPI_PRODORDCONF_GET_TT_PROP because its not the same as c011n
    Best regards,
    Francisco

    thanks but note for 4.6c is only help documentation
    solved BAPI_PRODORDCONF_GET_TT_PROP to generate goodsmovements for all materials + components by copying and modifying the fm and adding  TRANS_CATEGORY = 'X' to functiom module CO_RI_TIMETICKETCONF_CREATE
    still 2 matdocs are being generated instead of 1 like co11n

  • Help- Problem witth BAPI Confirmation

    Hi gurus,
    Please , i need some help with some problems i am having with BAPIs for confirmations.
    I have found this one : BAPI_PRODORDCONF_GET_TT_PROP, to get the propose data, but i i can't figured out how to fill the goodmovements table. I need to do this, because i want to know the proposal of goodmovements, just exactly that sap's does when i enter to the tx CO11N, enter the YIELD quantity and then press "goods movements" button.
    Please, is there some trick or something to make this work? ( i have already put "X" in the import "PROPOSE - GOODMOVEMENTS" , but still is not working).
    If get this, i could put this values in BAPI_PRODORDCONF_CREATE_TT and that's it... i suppose.
    Please help me
    Thanks a lot!

    Hi ,
    Before going into BAPI's , Auto goods movement happens in two ways.
    1. check whether Auto goods receipt is checked in T.code OPKP.
    2. The other way is to assign a Control Key to the operation which has a Auto GR checked.
    Please check these two and then trigger confirmation using your BAPI.
    Hope this helps.
    Best Regards.

  • Help - Problem with BAPI confirmation (co11n)

    Hi gurus,
    Please , i need some help with some problems i am having with BAPIs for confirmations.
    I have found this one : BAPI_PRODORDCONF_GET_TT_PROP, to get the propose data, but i i can't figured out how to fill the goodmovements table. I need to do this, because i want to know the proposal of goodmovements, just exactly that sap's does when i enter to the tx CO11N, enter the YIELD quantity and then press "goods movements" button.
    Please, is there some trick or something to make this work? ( i have already put "X" in the import "PROPOSE - GOODMOVEMENTS" , but still is not working).
    If get this, i could put this values in BAPI_PRODORDCONF_CREATE_TT and that's it... i suppose.
    Please help me
    Thanks a lot!

    Hi ,
    Before going into BAPI's , Auto goods movement happens in two ways.
    1. check whether Auto goods receipt is checked in T.code OPKP.
    2. The other way is to assign a Control Key to the operation which has a Auto GR checked.
    Please check these two and then trigger confirmation using your BAPI.
    Hope this helps.
    Best Regards.

  • Regarding 'BAPI_PRODORDCONF_CREATE_TT'

    hi experts,
                   do u have code sample for confirming production order with the help of bapi 'BAPI_PRODORDCONF_CREATE_TT',,,from where we will get confirmation number to pass in this FM....PLZ explain in your words........which are the compulsory fields to  pass in the tables parameters........such as in TIMETICKETS
    ,plz plz plz help me.

    Hi,
    try to change  wa_timetickets-fin_conf = '1'.   "Changed from X to 1  ans test it will work...
    wa_timetickets-orderid = wa_data-orderid.
    wa_timetickets-operation = wa_data-operation.
    wa_timetickets-fin_conf = '1'.   "Changed from X to 1
    wa_timetickets-clear_res = 'X'.
    wa_timetickets-postg_date = wa_data-postg_date.
    wa_timetickets-yield = wa_data-yield.
    Prabhudas

  • About BAPI_PRODORDCONF_CREATE_TT and releasing Reservation

    Dear Friends at SCN,
    I have the following problem when using the bapi BAPI_PRODORDCONF_CREATE_TT, that is called several times in the same program:
    the first run completes successfully, and then there is a call to BAPI_TRANSACTION_COMMIT.
    with the second, and the remaining ones, usually the BAPI returns an error saying 'Reservation xxxxx is already being processed'.
    I believe I should release the Reservation, after the first bapi call, and before the next one, but how to achieve that?
    Do you have a clue how to avoid this error appearing?
    Thanks a lot for any help or suggestion on this.
    Bye,
    Flavio

    Hi Stéphane,
    Here is the code I used, just before calling the BAPI:
      DATA: l_lock(1) TYPE c,
            l_while  TYPE i.
    * Check if Reservation is locked, if yes wait for unlocking
      l_lock = 'X'.
      l_while = 0.
      WHILE l_lock = 'X'.
        CALL FUNCTION 'ENQUEUE_EMRESB'
          EXPORTING
            mode_resb      = 'E'
            rsnum          = l_rsnum
          EXCEPTIONS
            foreign_lock  = 1
            system_failure = 2
            OTHERS        = 3.
        IF sy-subrc <> 0.
          l_lock = 'X'.
          WAIT UP TO 1 SECONDS.
          l_while = l_while + 1.
        ELSE.
          CLEAR l_lock.
          CALL FUNCTION 'DEQUEUE_EMRESB'
            EXPORTING
              mode _resb    = 'E'
              rsnum        = l_rsnum.
          EXIT.
        ENDIF.
        IF l_while = 60.
          EXIT.
        ENDIF.
      ENDWHILE.
    I hope it will help.....
    Thank you and bye,
    Flavio

  • Bapi BAPI_PRODORDCONF_CREATE_TT

    Hi people,
    I'm  trying to use BAPI_PRODORDCONF_CREATE_TT to load data into tx CO11N. I need to fill the field "production date", and couldn't find the corresponding field in this bapi. I can't fill the structure "goodsmovements" because this bapi define it automatically. If you have some tip about it, please, let me know.
    regards

    Hello
    Please have a look at OSS note 351181 below. This might help.
    Symptom
    Goods movements which have a filled the date of production (GOODSMOVEMENTS-PROD_DATE) are transferred to a BAPI for the confirmation.
    However, this date is lost in the course of processing so that the goods movements run incorrectly and must be reprocessed
    Additional key words
    BAPI_PRODORDCONF_CREATE_TT, BAPI_PRODORDCONF_CREATE_TE,
    BAPI_PRODORDCONF_CREATE_HDR, GOODSMOVEMENTS-PROD_DATE, date of production,
    Batch, shelf life expiration date, SLED
    Cause and prerequisites
    The problem is caused by a program error. The goods movements in internal table IMSEG_TAB are available to FORM routine VB_GOODS_MOVEMENTS. This FORM routine also includes the date of production in field HSDAT.
    The goods movement data is transferred with MOVE-CORRESPONDING to internal table TMP_AFFW_TAB. However, it does not have field HSDAT. The date of production is managed in field MHDAT, there.
    Solution
    Implement the program correction. The date of production is transferred from IMSEG_TAB to field MHDAT of TMP_AFFW_TAB if it does not already contain a shelf life expiration date.
    <b>Reward points if useful</b>
    Regards
    Saket Sharma
    null

  • Urgent help bapi!!

    hi all,
    The bapi BAPI_PRODORDCONF_CREATE_TT has FUCNTION moudle
    MAP2I_PP_TIMETICKET_TO_AFRUD which is gentred automaticlly. how it is possibe to generate this F.M
    please help.
    Thanks,
    sridhar

    Hello sridhar,
    I think taht this FM generated depends of your customizing or one of input parameters in BAPI.
    During the execution of BAPi, the program always uses this FM or they are some parameters to use this FM ?
    Regards
    Sebastien

  • BAPI_PRODORDCONF_CREATE_TT error in documents generated

    Hi all,
    While doing CO11N for a production order and doing goods movement I am
    able to confirm operations and goods movements occur sucessfully.In Doc
    info of material document I can see the T code which created the
    material document is CO11N.
    But when I use BAPI: BAPI_PRODORDCONF_CREATE_TT to do confirmation and
    goods movement, material document which gets created have T code as
    COGI in Doc info.
    Material documents generated through BAPI should have T code as CO11N
    in Doc. info.
    Moreover, table AFWI is getting updated for eg. with MBLNR=0000000536
    and MJAHR=000 and sometimes as MBLNR=4900011573 and MJAHR= 2011!!
    Why MBLNR=0000000536 and MJAHR=000? Is BAPI taking some time lag in
    updating this table??
    Kindly help.
    Regards

    Hi,
    goods movements in BAPI are always posted in update mode, explained in note 208477. Due to technical reasons alll goods movements posted in update mode, get tcode COGI. See FAQ note 540392 see the answer of question 10 and 13.
    For separated goods movements, that is, goods movements that are
    posted in the update program or via requests, only one transaction
    code can be specified due to technical reasons. This is always COGI.
    Therefore, this user must also have an authorization for COGI;
    otherwise the goods movements are processed incorrectly.
    Since the original transaction code (COHV, CO12, and so on) is no
    longer available when you post the separated goods movements
    (posting in the update program in a separate process) due to
    technical reasons, the system uses transaction code COGI instead by
    default.  Therefore, it is necessary that you also set up
    BR Sabine

  • BAPI_PRODORDCONF_CREATE_TT (Goods Movement Problem)

    Hello All,
    I have problem with BAPI_PRODORDCONF_CREATE_TT, when i executed the Program, the confirmation is success but the Goods Movement Failed ...and no error ..
    i check COOIS, for List : Items .....  GR Qty 0 ...
    List : Order headers      --> Conf. Qty : 60 
    REPORT  zipp_conftt.
    TABLES : afru.
    DATA: i_raw LIKE zpp_prod_ord OCCURS 0 WITH HEADER LINE.
    DATA: i_tt LIKE bapi_pp_timeticket OCCURS 0 WITH HEADER LINE.
    DATA: i_gm LIKE bapi2017_gm_item_create OCCURS 0 WITH HEADER LINE.
    DATA: i_ret LIKE bapiret1 OCCURS 0 WITH HEADER LINE.
    DATA: i_detret LIKE bapi_coru_return OCCURS 0 WITH HEADER LINE.
    DATA: i_msg LIKE bapi_coru_return OCCURS 0 WITH HEADER LINE.
    DATA: i_link LIKE bapi_link_conf_goodsmov OCCURS 0 WITH HEADER LINE.
    SELECT-OPTIONS: s_budat FOR afru-budat.
    *SELECT * INTO TABLE i_raw FROM zfi_balsheet.
    SELECT * INTO TABLE i_raw FROM zpp_prod_ord WHERE create_date IN s_budat.
    LOOP AT i_raw.
      REFRESH : i_ret, i_tt, i_gm, i_detret, i_link.
      i_tt-orderid = i_raw-prodordno.
      i_tt-sequence = i_raw-sequen.
      i_tt-operation = i_raw-oper.
      i_tt-postg_date = i_raw-pk_prod_date.
      i_tt-yield = i_raw-qty_result.
      APPEND i_tt.
      CLEAR i_tt.
      i_gm-batch = i_raw-batch.
      i_gm-move_type = i_raw-mov.
      i_gm-entry_qnt = i_raw-qty_result.
      i_gm-entry_uom = ''.
      i_gm-prod_date = i_raw-pk_prod_date.
      i_gm-quantity = i_raw-qty_result.
      i_gm-PO_PR_QNT = i_raw-qty_result.
      APPEND i_gm.
      CLEAR i_gm.
      i_link-index_confirm = '1'.
      i_link-index_goodsmov = '0'.
      APPEND i_link.
      CLEAR i_link.
      CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'
      EXPORTING
        POST_WRONG_ENTRIES       = '0'
        TESTRUN                  =
        IMPORTING
          return                   = i_ret
        TABLES
          timetickets              = i_tt
          goodsmovements           = i_gm
          link_conf_goodsmov       = i_link
          detail_return            = i_detret
      IF i_ret-type NE 'E'.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        COMMIT WORK.
        READ TABLE i_detret INDEX 1.
        IF sy-subrc EQ 0.
          MOVE-CORRESPONDING i_detret TO i_msg.
          APPEND i_msg.
        ENDIF.
      ELSE.
        ROLLBACK WORK.
      ENDIF.
    ENDLOOP.
    LOOP AT i_msg.
      WRITE:/ i_msg-type, i_msg-message.
    ENDLOOP.
    Can anyone help me with step by step solution, im using ECC6 ?
    is there configuration that have to be implemented regarding this BAPI ?
    Regards,
    Hendra

    Hi,
    Are you using auto GR?
    Have you mentioned production location in production order??
    Are you mentioning batch (If batch managed) while doing CO11N ?
    Because in case of auto GR if confirmation is done GR will automatically takes place you dont need to write any extra code for that.
    Regards,
    Vishal

  • Problem with threads and simulation: please help

    please help me figure this out..
    i have something like this:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class DrawShapes extends JApplet{
         private JButton choices[];
         private String names[]={"line", "square", "oval"};
         private JPanel buttonPanel;
         private DrawPanel drawingArea;
         private int width=300, height=200;
         public void init(){
              drawingArea=new DrawPanel(width, height);
              choices=new JButton[names.length];
              buttonPanel=new JPanel();
              buttonPanel.setLayout(new GridLayout(1, choices.length));
              ButtonHandler handler=new ButtonHandler();
              for(int i=0; i<choices.length; i++){
                   choices=new JButton(names[i]);
                   buttonPanel.add(choices[i]);
                   choices[i].addActionListener(handler);
              Container c=getContentPane();
              c.add(buttonPanel, BorderLayout.NORTH);
              c.add(drawingArea, BorderLayout.CENTER);
         }//end init
         public void setWidth(int w){
              width=(w>=0 ? w : 300);
         public void setHeight(int h){
              height=(h>=0 ? h : 200);
         /*public static void main(String args[]){
              int width, height;
              if(args.length!=2){
                   height=200; width=300;
              else{
                        width=Integer.parseInt(args[0]);
                        height=Integer.parseInt(args[1]);
              JFrame appWindow=new JFrame("An applet running as an application");
              appWindow.addWindowListener(
                   new WindowAdapter(){
                        public void windowClosing(WindowEvent e){
                             System.exit(0);
              DrawShapes appObj=new DrawShapes();
              appObj.setWidth(width);
              appObj.setHeight(height);
              appObj.init();          
              appObj.start();
              appWindow.getContentPane().add(appObj);
              appWindow.setSize(width, height);
              appWindow.show();
         }//end main*/
         private class ButtonHandler implements ActionListener{
              public void actionPerformed(ActionEvent e){
                   for(int i=0; i<choices.length; i++){
                        if(e.getSource()==choices[i]){
                             drawingArea.setCurrentChoice(i);
                             break;
    }//end class DrawShapes
    class DrawPanel extends JPanel{
         private int currentChoice=-1;
         private int width=100, height=100;
         public DrawPanel(int w, int h){
              width=(w>=0 ? w : 100);
              height=(h>=0 ? h : 100);
         public void paintComponent(Graphics g){
              super.paintComponent(g);
              switch(currentChoice){
                   case 0:     g.drawLine(randomX(), randomY(), randomX(), randomY());
                             break;
                   case 1: g.drawRect(randomX(), randomY(), randomX(), randomY());
                             break;
                   case 2: g.drawOval(randomX(), randomY(), randomX(), randomY());
                             break;
         public void setCurrentChoice(int c){
              currentChoice=c;
              repaint();          
         private int randomX(){
              return (int) (Math.random()*width);
         private int randomY(){
              return (int) (Math.random()*height);
    }//end class drawPanel
    That one's from a book. I used that code to start with my applet. Mine calls different merthod from the switch cases. Say I have:
    case 0: drawStart(g); break;
    public void drawStart(Graphics g){
      /* something here */
    drawMain(g);
    public void drawMain(graphics g){
    g.drawString("test", x, y);
    //here's where i'm trying to pause
    //i've tried placing Thread.sleep between these lines
    g.drawLine(x, y, a, b);
    //Thread.sleep here
    g.drawRect(x, y, 50, 70);
    }I also need to put delays between method calls but I need to synchronize them. Am I doing it all wrong? The application pauses or sleeps but afterwards, it still drew everything all at once. Thanks a lot!

    It is. Sorry about that. Just answer any if you want to. I'd appreciate your help. Sorry again if it caused you anything or whatever. .n_n.

Maybe you are looking for

  • How can I display FK description in a JDev9i DataEdit Component

    Hi all, I have a difficult issue here on the JDev9i. I use an XXXView_Edit.jsp where XXXView is a View Object. XXXView is actually based on a XXX entity object which in turn wraps the XXX Database Table. These .jsps have generated from the JDev9i wiz

  • My ipod is recognized by windows but not itunes

    Ok, I had trouble with my 4gb black nano when I had to install it, i used TrevorQ's tip and it worked. Now I need to update some songs on my ipod and it wont recognize it now 6.05.20 Itunes 2006-03-23 Ipod Updater I cant end the "IpodService.exe" pro

  • Huge size of ARTMAS IDOC

    Hello gurus, We are facing an issue in trasmiting generic articles(MARA-ATTYP = 01) along with all its variants via outbound ARTMAS IDOC(Transaction BD10). Some of the articles have around 40-50 variants. When such generic articles are transmitted vi

  • TS4079 Can't get siri to speak!  Siri answers in print only.  What's wrong?

    I can not get sound from Siri.  Help!

  • Insert current date?

    Numbers Question Hi, is it possible, within a cell and without manually typing it in each time, to insert the current date? i.e. so that it updates automatically. Thank you, Daniel.