Pick in 3djava

Hi guys I am working on an application in 3D
i want to get the values x , y , z for mouse clicked
i implemented a pick class
package game_3d_31_03_08;
import javax.vecmath.*;
import javax.media.j3d.*;
import com.sun.j3d.utils.picking.*;import com.sun.j3d.utils.picking.behaviors.PickMouseBehavior;
public class Pick extends PickMouseBehavior
    public Pick(Canvas3D canvas, BranchGroup bg, Bounds bounds)
        super(canvas, bg, bounds);
        pickCanvas.setMode(PickTool.GEOMETRY_INTERSECT_INFO);
    public void updateScene(int xpos, int ypos)
        pickCanvas.setShapeLocation(xpos, ypos);
        Point3d eyePos = pickCanvas.getStartPosition();
        PickResult pickresult = null;
        pickresult = pickCanvas.pickClosest();
        if(pickresult != null)
            PickIntersection pi = pickresult.getClosestIntersection(eyePos);
            Point3d intercept = pi.getPointCoordinatesVW();
            System.out.println(xpos+"   "+ypos);
} below there is is the main class of the project
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.*;
import java.awt.*;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;
import javax.media.j3d.*;
import javax.vecmath.*;
import com.sun.j3d.utils.behaviors.vp.*;
// import com.tornadolabs.j3dtree.*;    // for displaying the scene graph
import java.awt.event.ActionListener;
import java.awt.event.KeyListener;
public class WrapCheckers3D extends JPanel
        // Holds the 3D canvas where the loaded image is displayed
  private static final int PWIDTH = java.awt.Toolkit.getDefaultToolkit().getScreenSize().width-150;   // size of panel
  private static final int PHEIGHT = 400;
  private static final int BOUNDSIZE = 1100;  // larger than world
  private static final Point3d USERPOSN = new Point3d(0,5,20);
    // initial user position
  private SimpleUniverse su;
  private BranchGroup sceneBG;
  private BoundingSphere bounds;   // for environment nodes
  private float xP = 1;
  private float yP = 5;
  private float zP = 1;
  private Timer timer;
  Menu myMenu;
  MyFrame myFrame;
private boolean initMV;
  private boolean starting = MyFrame.checkStarting();
  public WrapCheckers3D()
  // A panel holding a 3D canvas: the usual way of linking Java 3D to Swing
    setLayout( new BorderLayout() );
    setOpaque( false );
    setPreferredSize( new Dimension(PWIDTH, PHEIGHT));
    GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
    Canvas3D canvas3D = new Canvas3D(config);
    add("Center", canvas3D);
    canvas3D.setFocusable(true);     // give focus to the canvas
    canvas3D.requestFocus();
    su = new SimpleUniverse(canvas3D);
    // j3dTree = new Java3dTree();   // create a display tree for the SG
    createSceneGraph(canvas3D);
    initUserPosition();        // set user's viewpoint
    orbitControls(canvas3D);   // controls for moving the viewpoint
    su.addBranchGraph( sceneBG );
  } // end of WrapCheckers3D()
  private void createSceneGraph(Canvas3D canvas3D)
  // initilise the scene
    sceneBG = new BranchGroup();
  // used for picking debugging
    sceneBG.setUserData("the sceneBG node");
    sceneBG.setCapability(BranchGroup.ENABLE_PICK_REPORTING);   
    bounds = new BoundingSphere(new Point3d(0,0,0), BOUNDSIZE);  
    lightScene();         // add the lights
    addBackground();      // add the sky
    sceneBG.addChild( new Floor().getBG() );  // add the floor
  //  sceneBG.addChild(new PhyBox().getBoxBG());
    floatingSphere(canvas3D);
  } // end of createSceneGraph()
  private void lightScene()
  /* One ambient light, 2 directional lights */
    Color3f white = new Color3f(1.0f, 1.0f, 1.0f);
    // Set up the ambient light
    AmbientLight ambientLightNode = new AmbientLight(white);
    ambientLightNode.setInfluencingBounds(bounds);
    sceneBG.addChild(ambientLightNode);
    // Set up the directional lights
    Vector3f light1Direction  = new Vector3f(-1.0f, -1.0f, -1.0f);
       // left, down, backwards
    Vector3f light2Direction  = new Vector3f(1.0f, -1.0f, 1.0f);
       // right, down, forwards
    DirectionalLight light1 =
            new DirectionalLight(white, light1Direction);
    light1.setInfluencingBounds(bounds);
    sceneBG.addChild(light1);
    DirectionalLight light2 =
        new DirectionalLight(white, light2Direction);
    light2.setInfluencingBounds(bounds);
    sceneBG.addChild(light2);
  }  // end of lightScene()
  private void addBackground()
  // A blue sky
  { Background back = new Background();
    back.setApplicationBounds( bounds );
    back.setColor(0.17f, 0.65f, 0.92f);    // sky colour
    sceneBG.addChild( back );
  }  // end of addBackground()
  private void initUserPosition()
  // Set the user's initial viewpoint using lookAt()
    ViewingPlatform vp = su.getViewingPlatform();
    TransformGroup steerTG = vp.getViewPlatformTransform();
    Transform3D t3d = new Transform3D();
    steerTG.getTransform(t3d);
    // args are: viewer posn, where looking, up direction
    t3d.lookAt( USERPOSN, new Point3d(0,0,0), new Vector3d(0,1,0));
    t3d.invert();
    steerTG.setTransform(t3d);
  }  // end of initUserPosition()
  // ---------------------- floating sphere -----------------
  private void floatingSphere(Canvas3D canvas3D)
  // A shiny blue sphere located at (0,4,0)
    // Create the blue appearance node
    Color3f black = new Color3f(0.0f, 0.0f, 0.0f);
    Color3f blue = new Color3f(0.3f, 0.3f, 0.8f);
    Color3f specular = new Color3f(0.9f, 0.9f, 0.9f);
    Material blueMat= new Material(blue, black, blue, specular, 25.0f);
       // sets ambient, emissive, diffuse, specular, shininess
    blueMat.setLightingEnable(true);
    Appearance blueApp = new Appearance();
    blueApp.setMaterial(blueMat);
    // position the sphere
    Transform3D t3d = new Transform3D();
    t3d.set( new Vector3f(xP,zP,yP));
    TransformGroup tg = new TransformGroup(t3d);
    tg.addChild(new Sphere(0.50f, blueApp));   // set its radius and appearance
    sceneBG.addChild(tg);
     Pick shootBeh =        new Pick(canvas3D, sceneBG, bounds );
    sceneBG.addChild(shootBeh);
  }  // end of floatingSphere()
  private void makeBox(float width, float height, float depth)
  /* A transparent box resting on the floor
    float xDim = width/2.0f;
    float yDim = height/2.0f;
    float zDim = depth/2.0f;
    Appearance app = new Appearance();
    // switch off face culling
    PolygonAttributes pa = new PolygonAttributes();
    pa.setCullFace(PolygonAttributes.CULL_NONE);
    app.setPolygonAttributes(pa);
    // semi-transparent appearance
    TransparencyAttributes ta = new TransparencyAttributes();
    ta.setTransparencyMode( TransparencyAttributes.BLENDED );
    ta.setTransparency(0.7f);     // 1.0f is totally transparent
    app.setTransparencyAttributes(ta);
    // position the box: centered, resting on the XZ plane
    Transform3D t3d = new Transform3D();
    t3d.set( new Vector3f(0, yDim+0.01f,0)); 
      /* the box is a bit above the floor, so it doesn't visual
         interact with the floor. */
    TransformGroup boxTG = new TransformGroup(t3d);
    boxTG.addChild( new com.sun.j3d.utils.geometry.Box(xDim, yDim, zDim, app));  
             // set the box's dimensions and appearance
    Shape3D edgesShape =  makeBoxEdges(xDim, height, zDim);  // box edges
    // collect the box and edges together under a single BranchGroup
  }  // end of makeBox()
  private Shape3D makeBoxEdges(float x, float y, float z)
  /* Only 8 edges are needed, since the four edges
     of the box resting on the floor are not highlighted.
     8 edges are 8 lines, requiring 16 points in a LineArray.
    LineArray edges = new LineArray(16, LineArray.COORDINATES |
                                        LineArray.COLOR_3);
    Point3f pts[] = new Point3f[16];
    // front edges
    pts[0] = new Point3f(-x, 0, z);   // edge 1 (left)
    pts[1] = new Point3f(-x, y, z);
    pts[2] = new Point3f(-x, y, z);   // edge 2 (top)
    pts[3] = new Point3f( x, y, z);
    pts[4] = new Point3f( x, y, z);   // edge 3 (right)
    pts[5] = new Point3f( x, 0, z);
    // back edges
    pts[6] = new Point3f(-x, 0,-z);   // edge 4 (left)
    pts[7] = new Point3f(-x, y,-z);
    pts[8] = new Point3f(-x, y,-z);   // edge 5 (top)
    pts[9] = new Point3f( x, y,-z);
    pts[10] = new Point3f( x, y,-z);   // edge 6 (right)
    pts[11] = new Point3f( x, 0,-z);
    // top edges, running front to back
    pts[12] = new Point3f(-x, y, z);   // edge 7 (left)
    pts[13] = new Point3f(-x, y,-z);
    pts[14] = new Point3f( x, y, z);   // edge 8 (right)
    pts[15] = new Point3f( x, y,-z);
    edges.setCoordinates(0, pts);
    // set the edges colour to yellow
    for(int i = 0; i < 16; i++)
      edges.setColor(i, new Color3f(1, 1, 0));
    Shape3D edgesShape = new Shape3D(edges);
    // make the edges (lines) thicker
    Appearance app = new Appearance();
    LineAttributes la = new LineAttributes();
    la.setLineWidth(4);
    app.setLineAttributes(la);
    edgesShape.setAppearance(app);
    return edgesShape;
  }  // end of makeBoxEdges()
private void orbitControls(Canvas3D c)
  /* OrbitBehaviour allows the user to rotate around the scene, and to
     zoom in and out.  */
    OrbitBehavior orbit =
          new OrbitBehavior(c, OrbitBehavior.REVERSE_ALL);
    orbit.setSchedulingBounds(bounds);
    ViewingPlatform vp = su.getViewingPlatform();
    vp.setViewPlatformBehavior(orbit);        
  }  // end of orbitControls()
} but it doesn t work
why ?
i do not understand
moreover any useful example the one that i found are helpless

Your class is referencing missing classes, so it cannot be compiled for testing.

Similar Messages

  • Use of Open and close data set in to pick up files from application server

    Hi,
    As per my earlier posts i m making a programm which will pick excel sheet from application server and make auto PR by bapi and this all process will be handle by background processing (SM36, SM37). My concer is all proces are working fine but my files are not been picked by application server , when run on my own machine everything is working fine.I never used OPENDATA SET command before , so i have no idea how it will be used , can anyone provide me details with my set of codes where it should be used ....
    sou_dir_name = 'Y:\Sucess\'.
    tar_dir_name = 'Y:\destination\'.
    Open dataset sou_dir_name for input in text mode encoding default.
    if sy-subrc eq 0.
       do.
           read dataset sou_dir_name into file_table.
       if sy-subrc ne 0.
         exit.  " end of file.
    enddo.
    endif.
    CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
      EXPORTING
        DIRECTORY  = sou_dir_name
        FILTER     = '.'
      IMPORTING
        FILE_COUNT = file_count
        DIR_COUNT  = dir_count
      TABLES
        FILE_TABLE = file_table
        DIR_TABLE  = dir_table
      EXCEPTIONS
        CNTL_ERROR = 1
        OTHERS     = 2.
    IF SY-SUBRC <> 0.
    ENDIF.
    loop at file_table into wa_file_table.
    clear  :  strr , str1 , str2 , str3 .
      strr = wa_file_table-PATHNAME .
      concatenate sou_dir_name strr into str1 .
      concatenate tar_dir_name strr into str2 . " success
      concatenate tar_dir_name1 strr into str3 .         " failed
    FILE = STR1 .
    *start-of-selection.
    *&  Function For Retrieve Data From Excel
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = FILE
        i_begin_col                   = col_start
        i_begin_row                   = row_start
        i_end_col                     = col_end
        i_end_row                     = row_end
      tables
        intern                        = excel_bdcdata
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3.
      IF sy-subrc NE 0.
    WRITE : / 'File Error'.
    EXIT.
    ENDIF.
      loop at excel_bdcdata.
        translate excel_bdcdata to upper case .
        move excel_bdcdata-col to it_index.
        assign component it_index of  structure  wa_file to <fs> .
        move excel_bdcdata-value to <fs>.
        at end of row.
          append wa_file to it_file .
            clear wa_file.
          endat.
      endloop.

    Parsing XML data:
    http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/frameset.htm
    or alternatively check out ABAP online help for "CALL TRANSFORMATION".
    For creating the material master look at BAPI_STANDARDMATERIAL_CREATE.
    Thomas

  • Report for pending shipments, PGI and Picking

    Hi All,
    We have few issues with the orders not being picked, if picked some are not being able to PGI and few are not going to the Shipments process. this is creating a backlog. I was wondering if we have any Report or transaction where i can check open shipments for the last 2 weeks or, open PGI which have been picked, or deliveries which need to be picked.
    Does sap has any standard report for this. Please help me.

    Hi,
    The mentioned reports (VL06F & VL06T) can be accessed from VL06O:
    VL06F - general delivery list / List of outbound deliveries
    VL06T - outbound deliveries for transportation planning
    Csaba

  • Can I send a family member to pick up a FiOS box?

    I just ordered a new FiOS box to get cable in one of my bedrooms, I chose the local pickup option to save on the shipping costs. The account is in my name but I have work tomorrow so I wanted to see if I could send my son to pick it up for me, is this allowed? If so does he have to bring like a note or something?

    Welcome to the Apple Community.
    Can I setup Family Sharing, add her iTunes account, and share content?
    No.

  • I am making a calendar in iPhoto, picking photos from a folder, let's call it "2011 Pics," in iPhoto. After arranging all the photos and captions I decided I wanted to insert a new photo -- one that was not in "2011 Pics." So I inserted it into the folder

    Add new photo to existing calendar folder in iPhoto
    I am making a calendar in iPhoto, picking photos from a folder, let's call it "2011 Pics," in iPhoto. After arranging all the photos and captions I decided I wanted to insert a new photo -- one that was not in "2011 Pics." So I inserted it into the folder, but the picture does not show up on the scrolling menu of pictures at the left of the calendar-making page. This happened last year and in frustration I started all over again. But surely there is a way to add a new picture to a calendar that is already laid out.

    Yes, the Old Master file has a folder for each year where I find all photos from that specific year. I am attaching a screen shot of the file.
    In the meantime i have managed to download all photos (it did not download any video files though in mpg, avi, 3gp, m4v,mp4 and mov format) to a new iphoto library. Unfortunately the photos are quite mixed and often doubled up. I ma considering to purchase iphoto library which checks all duplicates in iphoto. this will save me a lot of time. What do you think?

  • Trying to fill a shape or change text colour-it is always grey instead of the colour I picked?

    I have been working on a file and whenever I have a couple of shapes and some text. When I try to change the fill of the shape or change the text colour it is always changing to grey. It will let me pick a colour, but the box at the bottom(foreground/background box) is always grey as well. Please help.

    THANK YOU SO MUCH BARBARA! I really appreciate you taking  the time to reply to my simple problem(eventhough at the time it was so frustrating). Thanks again. Leanne

  • How can I create a Tree with Color Picker icons?

    I'm a newbie to Flex. I want to create a tree which has color
    picker icons.
    As an analogy for the Mac users out there, I envision a
    control like the Calendars section in iCal, where you can specify
    the color for each individual node. These colors are then used in
    other parts of the application.
    The Flex 3 documentation specifies four methods for setting
    node icons on a Tree control, none of which seems to suit my needs:
    -The folderOpenIcon, folderClosedIcon, and defaultLeafIcon
    properties
    -Data provider node icon fields
    -The setItemIcon() method
    -The iconFunction property
    In other words, I want to "setItemIcon" to an mx:ColorPicker,
    if that makes any sense.
    Is there a standard way of doing this? If not, how can I go
    about implementing such a control? Thanks in advance!

    well, Network UI should be used.

  • Picking of the varient pricing in scheduling agreement

    Hello Gurus
    goodmorning
    i have a small query i.e when i'm using OR as a document type for  my sales order its picking the varient price and all  are going fine but when i'm trying to do same for scheduling agreement DS in my sales order  its not picking the varient pricing plz help me out wat could  be the reason.
    in advance thank you
    venkat
    Edited by: K.Venkata Chalapathi on Jan 30, 2009 9:10 AM

    Dear Venkat,
    Price will get determine in the sales order based on two settings
    1.Pricing procedure determination
    2.Condition record maintanence.
    This may happen for two reasons
    1.Different pricing procedures are getting determined for sales order and scheduling agreement.
    One pricing procedure may have variant condition type and other pricing procedure may not have the variant condition type.
    So check same pricing procedure is getting determine in the both documents or not
    2.Condition record may not maintained for the scheduling agreement document type in VK11
    So check the condition record maintanence for the variant condition type through VK13 transaction.
    I hope this will help you,
    Regards,
    Murali.

  • What are the sources system will pick the document type while creating invo

    hi
    I would like to know how system will pickup the doucment type while creating invoice in vf01.
    i have taken off the fields  f1, f2, from the document type. in billing sub tab.  so  The moment when am creating billing system automatically displaying F2 invoice doucment creation.  What are the sources for this.
    thanks & Regards
    Rack129

    Hi,
    Hope you have maintained u2018Delivery relevant billing type F2u2019 and u2018Order relevant billing type F1u2019 in the billing tab of the Sales document type in VOV8.
    If you create delivery related billing, the system will pick F2. This is controlled in Item category (VOV7). Billing relevance in Business data of Item category decides whether this is delivery related or order related. u2018Au2019 for delivery related billing; u2018Bu2019 for order related billing and so on.
    Item category is determined by this combination: Sales document type + Item cat group + usage + higher level item cat.
    Regards,
    K Bharathi

  • In import PO, Exchange rate is not picking from PO

    Hi All
    In import PO, while doing Miro(Customs) and Migo, the system not  taking PO exchange rate But  it is taking Table Exchange rate.
    is there any thing to be done?
    Regards
    manju

    hi
    in po header delivery/invoice tab tick exchange rate fix indicator
    if u dont tick it system will pick the exchange rate what u maintain in OB08
    regards
    KI

  • In report painter GRR3 1VK  Actual Value picked up from previous year

    Dear Experts,
    In report painter GRR3 > 1VK
    1. Column of Actual Quantity to take in Basic Key Figure from Statistical Quantity
    2. The value is 4 (Actual) and Version is 0
    I found that the Actual value appeared are actually taken from the previous fiscal year. I have checked the line items and their document posting date it shown as last fiscal year.
    In this case, where should I amend to have the report pick up only actual value of this fiscal year? or Is there any value to maintain for GRR3 to pickup the current fiscal year actual posting?
    Thank you very much and Best Regards,
    Anne

    hi..
      Goto GRR3 > click on Lib 1VK it will show you all the report in 1VK library > select your report & double click on it
      It will display the report format. Then go to Edit at the top. you will find General data selection.click on it you will find available characteristics. Then goto GRR2 for making any change/selection for Fiscal year char
      If your report is a standard one you can not change. then copy the report from GRR1 and make the changes.
      You can also see the char in GR23 by selecting 1VK lib.
    kkumar
    Edited by: kkbdsp on Mar 11, 2011 9:21 AM

  • Color picker does not work, " program error when I click, photoshop cc

    I am user of photoshiop cc and it worked fine until several days ago but suddenly it shows " program error " when I click color picker, and I can not use changing color. Please help me to resolve this issue.

    There was a bug with photoshop CC concerning the color picker and its swatches. Make sure you have the latest version and then if it still exists, reset your tools in the upper left hand corner which would be the very first icon in the top tool bar. That should fix it. If not let us know and maybe someone can think of something else.

  • Query to pick up people of retirement age 1 year in advance

    Hi,
    I wrote the below query to pick up all staff who will be of retirement age in a year's time. This will be used in an alert that must go to payroll 1 year before retirement date, then 6 months before retirement date and then finally 1 month before retirement date.
    select distinct papf.employee_number
    , papf.full_name
    , apps.meds_hr_util_pkg.return_department(papf.person_id) org
    , papf.date_of_birth
    , (select payroll_name from pay_all_payrolls_f where payroll_id = paaf.payroll_id) payroll_name
    , (select first_name||' '||last_name from per_all_people_f where person_id = paaf.supervisor_id and trunc(sysdate) between effective_start_date and effective_end_date) mgr
    , (select email_address from per_all_people_f where person_id = paaf.supervisor_id and trunc(sysdate) between effective_start_date and effective_end_date) mgr_email
    , add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-12) date_12month_advance
    , add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-6) date_6month_advance
    , add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-1) date_1month_advance
    , trunc(months_between(add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-12),papf.date_of_birth)/12) age_12mon
    --into &emp_no, &emp_name, &org, &date_of_birth, &payroll_name, &mgr, &mgr_email, &retirement_date     
    from per_all_people_f papf
    ,per_all_assignments_f paaf
    ,per_person_type_usages_f pptuf
    ,per_person_types ppt
    where papf.person_id = paaf.person_id
    and trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
    and trunc(sysdate) between paaf.effective_start_date and paaf.effective_end_date
    and paaf.primary_flag = 'Y'
    and paaf.assignment_type = 'E'
    and papf.person_id = pptuf.person_id
    and pptuf.person_type_id = ppt.person_type_id
    and trunc(sysdate) between pptuf.effective_start_date and pptuf.effective_end_date
    and ppt.system_person_type = 'EMP'
    and ppt.user_person_type != 'Pensioners'
    and trunc(months_between(add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') )
    ||to_char(sysdate, '-YYYY')),-12),papf.date_of_birth)/12) >= 62
    and trunc(sysdate) in (add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-12)
    , add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-6)
    , add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-1)
    and to_char(papf.date_of_birth, 'DD-MON') != '29-FEB'
    order by 1
    The query works only when I have this line in
    " and to_char(papf.date_of_birth, 'DD-MON') != '29-FEB' "
    As soon as I remove it I get an ORA-01847: day of month must be between 1 and last day of month error. I can't seem to figure out why because there is 1 person with a birth date of 29-FEB and I am catering for this in the query. Also, I am using TO_DATE for the values so using add_months and months_between should not be an issue.
    Please help....maybe someone else can see something I am missing...
    Thanks
    Shalantha

    Hi,
    To find people who are 65 years old (or older) as of today, you can simply say
    WHERE     date_of_birth <= ADD_MONTHS ( SYSDATE
                                       , -12 * 65
                                )ADD_MONTHS knows how to adjust for leap years, but it may not adjust for them the way you expect.
    If today is February 28, 2013, the condition above will include people born on Februry 29, 1948. That's actually 1 day before they reach 65. If that's a problem, the solution is slightly more complicated.
    If today is March 1, 2013, it will include people born on Februry 29, 1948.
    If today is February 29, 2012 (or February 28, 2012) it will include people born on February 28, 1947, but not people born on March 1, 1947.
    To find people who will be 65 years old (or over) 3 months from today:
    WHERE     date_of_birth <= ADD_MONTHS ( SYSDATE
                                       , (-12 * 65) + 3
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data. Simplify the problem as much as possible.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.
    Edited by: Frank Kulash on May 26, 2011 11:48 AM

  • Processo de Picking

    Boa tarde a todos, estou realizando o processo de picking e embalagem, tenho algumas dúvidas sobre o processo e gostaria de saber se alguém poderia ajudar:
    1- Ao realizar o picking e criar as entregas é possível faturar todas pelo processo de "assistente de geração de documento". Mas é possível escolher aleatoriamente qual "entrega" eu quero faturar? Não achei essa opção lá.
    2- No SAP B1 padrão é possível realizar o contagem do picking através do coletor automático ou no B1 padrão só é possível manualmente?

    Leonidas, boa noite!
    Segue as respostas.
    1.A opção "Fatura Manual" não atende o seu processo? Ao invés de você gerar as entregas você gera a nota dos itens/pedidos que deseja.
    2. Toda parte de coletor precisa ser desenvolvida, o B1 oferece por standard apenas a digitação manual.
    Espero ter ajudado,
    Marcos Leite

  • Problema ao criar Pick via DI em diferentes clients simultâneos

    Bom dia a todos.
    Gostaria de pedir uma ajuda.
    Estou criando um AddOn que ao cliente concluir um Pedido de Venda, o AddOn irá selecionar os lotes dos itens com base em alguns critérios(o primeiro é o lote que esta mais próximo de vencer, o segundo é o uma certa ordem no subnível do deposito e por ai vai...).
    Consegui criar o AddOn, tudo funciona perfeitamente, porém o cliente possui uma quantidade muito grande de clientes realizando esses pedidos de venda, e em alguns casos esta havendo uma concorrência, como por exemplo:
         - Vamos supor tenho um item chamado "It", esse item possui 2 lotes no meu deposito, o lote "LT1" e o"LT2".
         - Eu tenho 2 "LT1" que vai vencer em maio, e 5 "LT2" que irão vencer em dezembro. Logo o ao realizar um Pedido de Venda, o "LT1" ira ser selecionado primeiro.
         - Esta ocorrendo em alguns casos que o um client cria um Pedido de Venda e seleciona 1 item do "LT1" e exatamente no mesmo momento um outro cliente esta realizando um outro Pedido de Venda que vai selecionar 2 itens do "LT1".
         Agora vem o problema...
         - Já que eu tenho 7 itens, o SAP deixa eu realizar a venda, e como os dois picking estão ocorrendo simultaneamente minha consulta SQL fala que tem 2 itens "LT1" disponível para seleção, uma vez que nenhum dos dois objetos (um em cada client) conclui o update no Picking, realmente há 2 "LT1" disponíveis.
         - Só que quem confirmar primeiro vai receber os itens, o que realizar o update depois não ira reservar nada, uma vez que outro Pedido de Venda já realizou o Picking daquele lote.
    Espero que tenho conseguido repassar meu problema e o cenário, já que a situação é um tanto quanto complexa.
    Pensei em uma possível solução:
    Estou usando a DI API, será que não seria o caso utilizar a DI Server? Pois pelo que eu li na descrição dela no Help parece ser uma possível solução. No entanto um outro desenvolver SAP disse que ela não iria solucionar.
    Então fica aqui meu pedido de ajuda, Será que a DI Server é a solução? Se não, alguém tem alguma sugestão?
    Agradeço a todos desde já pela atenção.
    Obrigado.

    Bom dia Edwaldo,
    Acho que utilizar o DI Server não vai fazer diferença. O que poderias fazer é o seguinte:
    No momento do update tens de verificar se os lotes seleccionados continuam activos e esta consulta tem de ser efectuada dentro de uma transacção. No caso de os lotes terem sido usados por um outro cliente (que tenha sido mais rápido a fazer o update), notificas o utilizador que os lotes seleccionados foram utilizados e que ele deverá escolher outros lotes.
    O importante é que se faça a consulta de lotes disponíveis dentro da transacção que irá efectivamente criar o pick.
    Boa sorte.
    Best regards,
    Pedro Magueija
    Message was edited by: Moshe Naveh

Maybe you are looking for

  • Best Practices for File Organizati​on/Project Explorer

    So we are finally getting SCC at my organization to manage our LabVIEW development, and that is good!  Now, we are starting in on discussions about how we should organize our files on disk and how we should use the Project Explorer. When I started he

  • How do I turn off pop up alerts on other IOS devices when I purchase an app?

    Whenever I download and/or purchase an app on my iphone, I get a notice on my ipad that I have purchashed an app on the iphone and asking if I want to download it to the ipad. I don't have automatic downloading enabled because I don't necesarily want

  • Firefox-Nightly crashes because of libgnomevfs2-0

    I can regenerate the crash whenever i download something/open the download window or open the general settings tab under preferences. I would probably have to report this bug as a libgnomevfs problem? but I was thinking if there was a replacement or

  • Time Stamp on MAXL Export File

    I use MAXL to export data from our Essbase cube. Is there a way to add a time stamp to the filename?

  • Data Filtering Problem

    Hi all, i have a report which has to display country wise sales based on the prompt(having drop down values: India, Australia, SouthAfrica). Here i have set filter for the country (Is prompted) in the report. On the selection of the prompt value, the