Grid of circles...

I was just wondering what would be the easiest (yet most efficient) way of creating a grid of circles? Like a grid layout of drawOvals. Is this possible?
I have only been taught GridLayout, FlowLayout and BorderLayout managers. The goal is to set each circle a specific colour when it is clicked.
I was thinking of creating an array but how could I do this and display the array with circles?
For example...
for (int i = 0; i < 42; i++)
   drawOval();
}Obviously I can't nest a paint method inside a for loop...so how else could it be done?
Thank you. :)

I'm nearly there!
for (int i = 0; i < circleTiles.length; i++)
                    gameCenter.add(CircleGrid);
                  }Then for the subclass...
public class CircleGrid extends JPanel implements MouseListener
        boolean ifRed;
        public CircleGrid()
          ifRed = true;
          addMouseListener(this);
        public void toggleColor()
          ifRed = !ifRed;
          repaint();
        public void paintComponent(Graphics g)
          if (ifRed)
            g.setColor(Color.RED);
          else {
            g.setColor(Color.BLUE);
          g.drawOval(0, 0, this.getWidth(), this.getHeight());
        public void mousePressed(MouseEvent evt)
           toggleColor();
        public void mouseClicked(MouseEvent evt)
        public void mouseReleased(MouseEvent evt)
        public void mouseEntered(MouseEvent evt)
        public void mouseExited(MouseEvent evt)
        {}I have the array declared as:
int [][] circleTiles = new int [7][6];Now the compiler is saying CircleGrid cannot be found.
Edited by: Aurora88 on Feb 10, 2008 5:29 AM

Similar Messages

  • Change colour of a circle whether mousePressed is an even or odd number

    Right this is sort've difficult to explain. I have implemented a grid of circles for a Connect 4 game with the help of you fine people :) Now to add to this, I am looking to change the colour of a circle depending on whether it's an even or odd mousePressed. Basically this is like playing somebody else, so each player takes it in turns. If there is an easier way to do this then I would greatly appreciate it.
    public class CircleGrid extends JPanel implements MouseListener
            boolean ifRed;
            public CircleGrid()
              ifRed = true;
              addMouseListener(this);
            public void toggleColor()
              ifRed = !ifRed;
              repaint();
            public void paintComponent(Graphics g)
              if (ifRed)
                g.setColor(Color.RED);
              else
                g.setColor(Color.BLUE);
              g.fillOval(0, 0, 50, 50);
            public void mousePressed(MouseEvent evt)
               toggleColor();
            public void mouseClicked(MouseEvent evt)
            public void mouseReleased(MouseEvent evt)
            public void mouseEntered(MouseEvent evt)
            public void mouseExited(MouseEvent evt)
         }That is the code which draws the ovals and such on to my gameCenter JPanel.
    I was thinking something like:
    pesudo code --
    if mousePressed is an even number
    then set g.setColor = blue
    else
    g.setColor = red
    Thank you guys. I would appreciate any help. I'm still very much a newbie and some of my questions, I'm sure, are trivial to most of you but we all have to start somewhere.

    Hey LW, cheers buddy. :)
    I used your idea.
    Here's my working code:
    if (clicks == 0)
                        ifRed = true;
                        repaint();
                        clicks = 1;
                   else if (clicks > 0)
                        ifRed = false;
                        repaint();
                        clicks = 0;
                   }

  • HD Preset sees cropping or margins on HDready TVs.

    Premiere CS3
    I am desperate to resolve this apparent simple task.  I need to know, why does Premiers presets not fit HDready TV's ?
    See the results from three different TV’s further below.
    Just what should I make the width and height of a project (and what pixel aspect ratio ?) to have videos played on PAL dvd players fit a HD ready screen ?  I need to put stills into the video. What size and pixel aspect ratio should they be made ?
    The advice I followed sees margins and cropping. What other settings should I be choosing in Photoshop and then in Premiere and in TMPGenc ?
    I am using Pshop CS2 WinXP, I have an LCD monitor. Client has LCD HDready TV PAL. (Native res 1533 x 768px.)  the standard dvd video is to also play on friends LCD TVs. (they don’t have blueray players), all are dvd players with scart. People are buying LCD but keeping existing dvd players and thus using scart, picture quality is less than my Wega !
    Why don’t the suggested presets from another thread create videos that fit HDready screens ?
    I have need of making stills or video fit the screen of HD Ready TV’s (dont we all ?? !!!) and I am following advice that said use either 720x576 or 1280 x 720 or 1920x 1080 and ignore the screens default resolution. The 1920x1080 is the size of full HD TV’s and the 720x576 is not 16:9 ratio so probably intended for non HD Ready TV’s though I tried it anyway, picture quality on HDready was poor and it still saw cropping so it must be the 1280x720 then for the HDready.
    To test this out, I created a chart of 1280 x 720pixels Square pixels in photoshop, saving as tiff.
    It has a square grid of black lines on a white background (20 squares wide - each is thus 64pixels) and circles at left middle and right. At the sides are 5 pixel increment rulers heading into the chart with 0 at picture edge.
    We want our stills or video to fit the HD Ready screen without distortion.
    Thus the goal is to get the test image to fit the screen and see all edges as 0.
    I went New Project in Premiere and chose the suggested 1280 x 720 size 25fps which exists as a preset.
    Imported the tiff into the timeline. Made a video and authored it in TMPGencAuthoringWorks. It saw it as 720x576 and no options existed to make it otherwise. I chose Progressive.
    Playing it on DVD players connected to LCD TVs we get anything but a fit to screen ! Why ?
    Note they all are using scart, both shops and private TV’s. Would a HDMI enabled dvd player connected via hdmi see a fit with 0 at all four screen edges and perfect grid and circles, and no ghosting on the verticals, and the 1pixel zebra chart visible ?
    I also noticed that text created in premiere was of better quality than Photoshops text in the tiffs, which on the Panasonic had jpg type artefacts around it, but not on the Wega CRT. Why ?
    Panasonic HD Ready 32inch  scart DVD to TV.
    Auto     0 on all four sides so picture all in but with Black margins 3inch sides and 2 inch top/bottom.
    16:9     0 on all four sides so picture all in but with Black margins 3inch sides and 2 inch top/bottom.
    Zoom 1    0 and 0 left and right,  25 top and 20 bott, 4 inch wide black margins at sides.
    Zoom 2    0 and 0 left and right, 25 top and 20 bottom so some cropping, circles a little stretched north/south
    Zoom 3   0 and 0 left and right, 100 top and 100 bottom so 200 pixels lost in top/bott crop, circles heavily stretched north/south
    14:9   0 all four sides with 5inch black side margins and 1inch black top/bott margins, circle heavily stretched north/south
    4:3 though not an obvious choice for filling a 16:9 screen, gave 0 all round and 8inch black left/right and 2inch black top/bott.
    Best then was Zoom 2 but 40 pixels lost north/south.
    All vertical lines had ghosted lines either side, horiz lines ok.
    LG (LH2000) 42inch LCD  scart dvd to TV.
    16:9   0 all four sides with black margins. Circles slightly stretched north/south
    Full Wide   0 all fours sides with 3.5inch margins left/right and black margins top/bott.
    Zoom   0 at left, right and bott but 20 at top. Black margins at left, right and bott but not at top. Most odd ! Circle stretched north/south
    Original   0 all four sides and black margins 3.5 inch sides and 1.5 inch top/bott with Circles slightly stretched north/south.
    Again All vertical lines had ghosted lines either side, horiz lines ok.
    Samsung 32inch LCD scart dvd to TV.
    Margins measured also using the pixel ruler of the chart, though its obvious its been compressed, else e.g. the 1024px margins of 4:3 take up almost all the screen width which they don’t in fact.
    16:9   0 all four sides with black margins 202px wide at sides and 197px tall at top/bott. Circles distorted east/west.
    Zoom   0 all four sides with black margins 202px wide sides and 90px tall top/bott. Circles distorted north/south
    4:3   0 all four sides and black margins 512 pixels wide sides (6.25inches) and 240 pixels tall top/bott (3.25inch)
    Autowide    0 all four sides with black margins 202px wide sides and 250px tall (3.25inch) top/bott. Circles distorted east/west.
    Again All vertical lines had ghosted lines either side, horiz lines ok.
    A second chart featured zebra crossings (alternate black/white lines) vert and horiz orientated of sizes 1,2 3 and 4 pixel line weights. All TVs were able to show the 3 pixel sets, in that the 1 and 2 were blurred and one could see the 3 was alternate black/white, not pin sharp though but somewhat woolly !
    Playing the 720x576 Sq Pixel Interlaced chart :-
    Sony Wega digital CRT 42inch: (scart dvd to TV):-
    Smart   15left, 5 right, 54 top and 58 bottom with circles slight stretch middle east/west and more stretched for the outer ones. No Margins
    14:9   20 left  0 right, 60 top and bottom. Black margins at sides of 72px width left and 55px width right. Circles ok.
    Zoom   20 left, 14 right, 80 top and 85 bottom, No margins. circle ok middle and some stretch east/west for outer two.
    Wide   20 left, 13 right,  15 top and 24 bottom No Margins with all three circles stretched east/west.
    4:3    20 left, 0 right, 20 top and 25 bottom. Black margins at sides 128px width. Circles and grid almost perfect. Crazy though to be losing one side of image.
    No ghosting of vert lines.
    Panasonic LCD 32inch (same as in earlier test above..clients TV)
    Auto 0 sides and 30top, 15 bottom, circle distorted east/west. No black margins
    16:9   0 sides and 20 top, 15 bottom, circle distorted east/west. No black margins
    Zoom 1   0 sides 90 top, 85 bott no black margins, Circle OK
    Zoom 2   90 sides and 90 top, 85 bottom. Circle distorted east/west. No black margins
    Zoom 3   90 sides and 16 top and bottom. Circle slight distort north/south, quality poor.
    14:9   0 sides and 60 top, 55 bottom. Circle ok. Black margins sides (50pixel wide)
    4:3   0 sides and 20 top, 15 bott. Circle ok. Black margins sides 120px width (3inch)
    16:9 probably best but with cropping top and bott and distorted circles east/west so nothing here of use.
    Vert lines ghosted either side
    Nothing of any use.
    Envirographics

    Hi, Thanks for the advice.
    How do you wish to show your project on an HDTV?.
    Client has dvd player (not bluray capable) via scart and hopefully soon a hdmi lead.
    Currently  tried 1280 x 720 square pixel images created in photoshop (hence sq pixels) to suit the input preset of PAL 1280 x 720  25fps Square Pixel and going File>Export>Adobe Media Encoder and choosing MPEG2-DVD and  PAL Progressive Widescreen High Quality which yields 720 x 576. This seemed suitable for a non HD playing device. It looked good on screen in TMPGencAuthoringWorks. Am I right in saying people buying LCD HDready TV's need to get a new dvd player capable of HD so as to make the most of the image quality of their TV ? Most seem to buy LCD and plumb them into their existing dvd players !
    As the dvd player is not capable of bluray output, choosing this seemed logical BUT trying out all screen aspect settings on the Panasonic LCD HDready TV sees the following cropping of our 1280x720 test image with grid and circles, the cropping we got is simply unacceptable. (192 left /right means 192 on each side totalling 384)
    On a plus note, quality improved, now seeing horiz black/white lines 1 pixel line weight, vert ones were a little woolly though. 2px test lines were ok. Thats an improvement over only 3 beijg best. Finding the Adobe Media Encoder has seen some benefit !
    Auto  55 left /right ( that’s 8.6% lossage) and 25 top and 20 bott (6.25% lossage), Circles OK
    16:9  ditto
    Zoom 1  55 left /right (8.6%) and 105 top/bott (29% lossage) Circles stretched vert
    Zoom 2    192 left /right (30%) and 100 top/bott (27%) Circles ok
    Zoom 3   192 left/right (30%) and 168 top/bott (47%) ..a disaster !
    14:9   55 left/right with black margins each 96px ,  75top and 65 bott (19%) Circles stretched vert.
    4:3   55 left/right with black margins each 192, 25top and 20 bott (6.25%) Circles stretched vert.
    Auto and 16:9 best but we ned to see 0 on all four sides else we are losing people out of the picture ! ...or should we add black margins to it ! ?
    Any answers to the following gratefully received.
    What should I choose for PAL dvd video to HDreadyTV. ?
    1) Pixel width and height of still (tiff) ?
    2) Pixel aspect ratio of still (tiff) ?
    3) Preset for input source or custom setting and what to choose ?
    4) Adobe Media Encoder output settings:-
         a) MPEG2 or MPEG2-DVD
         b)  PAL option ..which one to pick with regards pixel width/height, fps, interlacing or progressive, quality effect on pixels and our desired goal ?
         c) or custom output and what ?
    Envirographics.

  • Where can I find a Pages tutor

    I need to create square grids of circles of varying sizes and distances apart. I can't figure out how to do this quickly and accurately in Pages (or word for that matter) Anyone have an idea where I can get help with this? I'd probably need some real handholding over the phone. Thanks!

    Sorry but you will not get any phone help from these forums.

  • Cropping of excess transformed objects

    My problem is as follows:
    I have created a series of circles starting with a base circle then using two transform operations -- one to copy it down then another to copy the whole set across.  So that leaves me with a grid of circles.
    I have created an irregular clipping mask to restrict the circles to within the area of the clipping mask (blue sploosh)
    Everything looks fine in illustrator.  I have included a snapshot here with the clipping mask released so that you can see the objects being worked with.
    The problem comes in when I go to copy & past that artwork into photoshop.  What I get is the full spread of (clipped) circles which messes up sizing inside photoshop.  The clipping mask hid the excess circles but it did not get rid of them.  I have further tried using the pathfinder crop tool but that doesn't seem to work with transformed objects.  Does anyone have any suggestions as to how I can get rid of the spare inner circles so they are really gone and not simply hidden by the clip mask?

    @Jacob
    Thanks.  That was helpful in that it was the first time I've seen anything which was actually able to destructively get rid of the spares. The downside is that for reasons unknown the "blueness" from the sploosh underneath was removed... or more accurately, the it put a white background underneath the clipped circles.  If I turn off the circles group then the sploosh is visible underneath.  I fooled around with other options on the Object -> Flatten Transparency dialog and found I got more pleasing results by enabling Preserve Alpha Transparency but the things like the drop shadow just turned awful.  I'd be way better off to just manually drag circles around. 
    That, at least, gave me SOME Illustrator operation that had some effect on the extra circles created by Effect -> Distort & Transform -> Transform option
    As you can probably tell, I'm a photoshop guy struggling to learn Illustrator.  I find myself partly awed at some of the things it can do and greatly annoyed at silly things like this (and don't even get me started on how awful the bevel options are in Illustrator vs. photoshop LOL).
    At least for the short-term I have a working vector image.  I can pull it into photoshop, rasterize it, then get rid of the spare bits... or simply ignore them since they are invisible.

  • A grid (2*2 for example) with a circle in a selected place

    Dear Forum members,
    Please tell me how to make (in swing , but NOT applet) a grid (2*2 for example) with a circle in a selected place (in one or more of the 4 cells). I want to be able to turn on and off (circle or no circle) any cell in the grid.
    Thanks
    Eran

    Doubleposted,
    http://forum.java.sun.com/thread.jsp?forum=54&thread=477343&tstart=0&trange=15

  • Meaning of Up arrow symbol with circle on Grid Control

    On the targets page in Grid control, the instances that are up and running have an upward arrow against their names. Some however have a circle around them. What does this circle signify?
    Regards
    Baffy

    The circle indicates that you can click on it. You'll be able to click on the status and see Overall Availability unlike other targets that don't have the circle. It might have to do with the different licensing of different targets.

  • Split a circle into a grid of masks

    Hi there,
    I'm looking for some help with masks in AE CC. I need to split a circle into masks in a grid formation and wondered what the quickest way to do it was?
    Basically, I need to do this so that I can smash it in Newton 2 but there can't be any gaps between the masks and the edge masks need to follow the contour of the circle.
    Hopefully that makes sense and someone has a tip or two for me.
    Thanks in advance.

    Use Illustrator's "Split into Grid" feature combined with some Pathfinder-ing. Or something like that perhaps?
    http://aescripts.com/voronoi-shatter/
    Mylenium

  • Grid design element to cover page using circle objects and the align toolbox.

    Hi all,
    I'm currently working through a tutorial in which I need to cover the entire page with a grid of evenly spaced small circles. The tutorial tells me to copy and paste the initial circle then align left and vertical, and repeat for horizontal. However what I'm left with are just two rows of circles, one down the far left and one across the top of the page.
    What is the best way of covering the entire page with these circles so that they are identical and evenly spaced across the page?
    Thank you!!

    If i understand correctly, how a bout Edit>step and repeat and turn on create as a grid

  • Issue with snap grid and making perfect circles

    I noticed after I brought my drawing to adobe illustrator CC 2014 that the snaps that the program was making were imperfect and off. As seen in my picture the circle does not create a clean solid shape. If there is anything I should change to help fix this or to help the development team to further refine the product please let me know.
    Thanks,
    Eric

    Hi,
    By double tapping on the shape, it will automatically trace the full shape contour giving you a cleaner trace of the shape.
    Hope this helps,
    Jose

  • I am having a real problem running Safari. It is super slow and I am getting the rainbow circle a lot. Can anyone help me? Please. It is only two years old.

    I am having a real problem with my MacBook Pro. While I am using Safari it is running really slowly and I am getting the rainbow circle a lot. Can someone give me some suggestions? I have no idea why it is so slow and it will not open any webpages.

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Click the Clear Display icon in the toolbar. Then try the action that you're having trouble with again. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Help figuring out how to tell if an object is within a dynamically made circle

    Hello Everyone,
    I am currently in the middle of working on a project but sadly I am having a bit of trouble getting a few things figured out.
    Essentially what the project consists of is I have random balls appearing on the screen and moving around and I need to make it so that the user is able to draw a circle around the ball (may be more than one) and have that balls dissapear and count the number of balls circled.
    This project is being done in flash builder 4.5 and is being made for the android platform as part of a senior project.
    At this point this is where I am.. I have been able to randomly create the balls and give them a random movement. I have also been able to figure out how to allow the user to draw on the screen.
    What I am trying to figure out is how to make it so that if the user draws a circle around the balls make it so that I know these balls have been circled and make them dissapear and have the number of balls inside the area calculated.
    I have thought about making the entire background a grid and make it so that I can track somehow the line made by the user and then track the coordinate of the balls then if it is within that area it means that the ball has been circled but I would like something more efficient than that.
    I apologize if it is unclear for what I am looking for but a simple description is I am making a simple game where you are able to circle a moving item on screen, then once it is circled the item disappearsand you gain a point.
    Any help would be greatly appreciated.

    that's non-trivial.  just determining if your user drew a closed curve is non-trivial.  then deciding what's inside and what's outside that curve is non-trivial.
    that's not to say it can't be done or even, that it can't be done with flash.  it can.  but you're not going to get a short paragraph answer to this one unless there are significant assumptions you can use to simplify the problem.

  • 11.2.0.3 grid installation fails while selecting OCFS2 for ocr files

    We are installing 11GR2 (11.2.0.3) cluster on a 64 bit system. we have OCFS2 filesystem for shared devices. version 1.6.3.
    While selecting ocr file locations , we get the following error
    [INS-41321] Invalid oracle cluster register [OCR] Location
    Cause- The installer detects that the storage type of location is not supported for Oracle Cluster registery
    Action - Provide a supported storage location for the Oracle Cluster Registry
    Additional information
    /crp2db01/OCR/ocr_1 is not shared
    However , this mountpoint is shared across both the nodes.
    Note: 11201 grid installation was successful and it accepted the above locations for OCR. however ,we need 11.2.0.3 cluster for 11.2.0.3 database

    As for your current problem, just because Oracle "allows" OCFS2 in a GRID environment, I would never suggest nor implement that. It adds a layer of complexity that is totally unnecessary when a GRID/ASM implementation performs circles around OCFS2. ASM is much easier to manage, maintain, expand and shrink than OCFS2. Especially at version 11.2.0.3. When working at a large telco a few years ago, we had a 300TB+ ASM environment. OCFS2 could not even begin to be that big. ASM will provide you a MUCH more stable environment than OCFS2. And with ASM there is a lot of "magic" that happens with OCR/Voting that makes your life MUCH easier. If you "require" shared application files, then use ASM/ACFS. It is a much better "volume manager" than OCFS2.
    Since you must present devices to the system for OCFS2, you should not have any problems doing the same for ASM. (and don't use ASMLib as it is going away and is not necessary - just make sure you use a partition that skips the first 1M (usually cylinder 1) and you should be good to go!)
    I also would not use a "shared ORACLE_HOME" on either ACFS or OCFS2. The biggest reason is that you lose the ability to do a "rolling" upgrade and when you have a VLC, that becomes much more important that saving a few GB worth of storage.
    I would also pay attention to this:
    http://docs.oracle.com/cd/E11882_01/install.112/e22489/storage.htm#CDEDAHGB
    3.1.4.2 General Storage Considerations for Oracle RAC
    Use the following guidelines when choosing the storage options to use for each file type:
    You can choose any combination of the supported storage options for each file type provided that you satisfy all requirements listed for the chosen storage options.
    If you plan to install an Oracle RAC home on a shared OCFS2 location, then you must upgrade OCFS2 to at least version 1.4.1, which supports shared writable mmaps.
    Oracle recommends that you choose Oracle ASM as the storage option for database and recovery files.
    For Standard Edition Oracle RAC installations, Oracle ASM is the only supported storage option for database or recovery files.

  • Couldn't get to the login scrn. Circle with slash symbol. S-mode not helpin

    System: *PowerMac G4 DDR 1GHz with 1.25GB RAM and Tiger 10.4.10 (or .11 not sure)*
    At first, I could not get the Mac to get to the login screen i.e. it boots up but the timer symbol thing (you know that clockwise 'loading' icon thingy) keeps cycling for hours (eventually I switched it off not to waste electricity).
    Tried second time using OS X install disk and check + repair disk, then boot up - still the same symptoms. (NB. Looks like I can do the fresh install though but that is not my intention just now).
    Then, did the reset PRAM thing (cmdalt+PR), second chime - folder/question mark (no startup disk screen), then it shows the circle with slash icon on screen, eventually shut it down.
    In single user mode, it stops after the 'got bootdisk...' and no flashing of the keyboard cursor.
    In verbose mode, almost the same as above.
    +Have not changed the PRAM battery or reset PMU. Have been off the grid (off at socket for quite a long period but does not normally do this).+
    +In single user mode, one of the line says clock is wrong or reset. After PRAM reset, one line says PMU was reset.+
    My questions are:
    1. What is that circle with slash icon mean? (can only find on Intel Mac pages - could not load boot.efi, or some other issue)
    - ref: <http://support.apple.com/kb/HT2674>
    2. Is installing a new system folder the only solution?
    3. Do I need to get a new battery?
    4. Is my startup hard disk at fault?
    Thanks.
    dean

    Hi Dean,
    Have been off the grid (off at socket for quite a long period but does not normally do this).
    I'm pretty sure the battery is extremely dead if the computer has been off the grid. Remove the PRAM battery and see if it starts. A new battery is always a good place to begin. We've seen plenty of posters here say their MDD startup problems cleared up with the installation ofa new battery. I get my batteries here:
    http://eshop.macsales.com/item/Newer%20Technology/BAA36VPRAM/
    I don't know your geographic location; if you are not in an area served by the above reseller, you can use the specs in that link to shop locally. Bottom line--you need to eliminate the battery as a suspect before proceeding with troubleshooting.
    If a battery is over a year old I don't bother testing it. I've had too many PRAM batteries test 3.6V in my hand yet did not perform well enough under load to propelr work in teh computer.
    Another easy thing to try is a Safe Boot. Info here:
    http://support.apple.com/kb/HT1455
    Be sure to give the computer time to get to a desktop--takes longer is safe mode.

  • Pls help me this is an urgent  requirement on  ALV GRID

    Hi all
      Here i am sendig my requirement pls help me on coding ..
    Report Assignment For ELTPs:
    Selection criteria :
    Circle id : Select option without interval and mandatory
    SPR Id :  Select option without interval
    Project Status :  Parameter
    Output required in ALV Grid format with the below structure :
    cProjects ID     SPR ID     Project Name     Circle ID     Circle Description     Delegation Status     No. of CU Projects     CU-PO Share     FLCB     FLCB
    NAME     FLCL ID     FLCL Name     FLCL Email ID
    1232007
         1230
              ABCD          No     0                              
    1242007
         1240
              ABCD          Partial     2                              
    1112007
         1241
              XYZ                                             
    2222007
         1242
              WXY                                             
    1252007
         1250
              EFGH          Full     1                              
    3332007
         1251
              DEF                                             
    Requirement : 
    1.     The report should list all the CFU projects and the corresponding CU projects circle wise based on the circles entered on the selection screen and which have the SPR ids and Project status on the selection screen.
    2.     If SPR id or Project status is not entered then all the projects to be considered for the given circle/s.
    3.     It should display the details of the CFU project first. The corresponding CU projects should be listed below that CFU project in the successive rows.
    4.     For example, project 1232007 is a CFU project which does not have any CU under it. Hence, another CFU project 1242007 is displayed in the second row. It has 2 CU projects under it. The details of those two CU projects are displayed in the 3rd and 4th rows.
    5.     Total share given to the CU circle (by adding different PO shares to that circle in that project) by the CFU project should be displayed in the field ‘CU-PO Share’.
    6.     For CU projects, the fields ‘Delegation Status’, ‘No. of CU projects’ and ‘CU-PO share’ should be space.
    7.     FLCB, FLCL ID, FLCL name and FLCL email  need to given for all the projects in all the rows.
    Tables to be referred: ZSCP_PROJECT, ZSCP_CIRCLE_M, ZSCP_PJ_CL_PO_MP, ZSCP_PRJ_LINK, USR21,
    ADR6, BUT000,CGPL_TEXT.
    [<b>b]Here i done the coding the but the error showing that field catolog is not found..
    pls check this and kindly send the code .....</b></b>
    REPORT  Z_64328_TEST .
    TYPE-POOLS : SLIS.
    TABLES : ZSCP_PROJECT,ZSCP_CIRCLE_M,ZSCP_PJ_CL_PO_MP,ZSCP_PRJ_LINK,
             USR21,ADR6, BUT000.
    SELECT-OPTIONS : S_CIRID FOR ZSCP_CIRCLE_M-CIRCLE_ID NO INTERVALS.
    SELECT-OPTIONS : S_SPR_ID    FOR ZSCP_PROJECT-SPR_PROJECT_ID NO INTERVALS.
    PARAMETERS     : P_STAT  LIKE ZSCP_PROJECT-PRJ_STAT.
          DATA : GS_LAYOUT1 TYPE SLIS_LAYOUT_ALV,
                 CT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
                 G_REPID   TYPE  SY-REPID,
                 TEMP_CAT1  TYPE SLIS_FIELDCAT_ALV,
                 HEADER_ALV1 TYPE SLIS_T_LISTHEADER,
                 HEADER_ALV_WA1  TYPE SLIS_LISTHEADER,
                 GT_SORT  TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,
                 GS_KEYINFO  TYPE SLIS_KEYINFO_ALV.
    DATA : SPRID  TYPE ZSPR_PROJECT_ID.
    DATA : CID    TYPE ZCIRCLE_ID.
    DATA : ITAB  TYPE TABLE OF ZSCP_PROJECT.
    DATA : WA    TYPE ZSCP_PROJECT.
    DATA : ITAB1 TYPE TABLE OF ZSCP_CIRCLE_M.
    DATA : WA1   TYPE ZSCP_CIRCLE_M.
    SELECT * FROM ZSCP_CIRCLE_M INTO TABLE ITAB1.
    SELECT * FROM ZSCP_PROJECT INTO TABLE ITAB WHERE SPR_PROJECT_ID IN S_SPR_ID OR CIRCLE_ID IN S_CIRID.
    LOOP AT ITAB INTO WA.
    READ TABLE ITAB1 INTO WA1 WITH KEY CIRCLE_ID = WA-CIRCLE_ID.
    WRITE : WA1-CIRCLE_DESC.
    WRITE : WA-CIRCLE_ID,
            WA-PROJECT_ID,
            WA-DELEG_STAT,
            WA-PRJ_STAT,
            WA-FLCB,
            WA-FLCL.
    ENDLOOP.
    *PERFORM FIELD_CATALOG1.
    PERFORM alv_display1.
    FORM FIELD_CATALOG1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'CIRCLE_ID'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'CIRCLEID'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'SPR_PROJECT_ID'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'CPROJECTID'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'CIRCLE_DESC'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'CIRCLEDESC'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'DELEG_STAT'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'DELGSTAT'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'PRJ_STAT'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'PROJSTAT'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'FLCB'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'FLCB1'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'FLCL'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'FLCL1'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    ENDFORM.   "END CATALOG1.
    FORM ALV_DISPLAY1.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                 = G_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE             = 'TOP-OF-PAGE1 '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
       IS_LAYOUT                          = GS_LAYOUT1
       IT_FIELDCAT                        = CT_FIELDCAT1
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                            = GT_SORT[]
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                             = 'A '
      TABLES
        T_OUTTAB                          = ITAB
    EXCEPTIONS
       PROGRAM_ERROR                      = 1
       OTHERS                             = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    Thanks and regards
    Nagendra Kumar

    hi nagendra,
             go through this code.
    TYPE-POOLS : SLIS.
    TABLES : ZSCP_PROJECT,ZSCP_CIRCLE_M,ZSCP_PJ_CL_PO_MP,ZSCP_PRJ_LINK,
    USR21,ADR6, BUT000.
    SELECT-OPTIONS : S_CIRID FOR ZSCP_CIRCLE_M-CIRCLE_ID NO INTERVALS.
    SELECT-OPTIONS : S_SPR_ID FOR ZSCP_PROJECT-SPR_PROJECT_ID NO INTERVALS.
    PARAMETERS : P_STAT LIKE ZSCP_PROJECT-PRJ_STAT.
    DATA : GS_LAYOUT1 TYPE SLIS_LAYOUT_ALV,
    CT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
    G_REPID TYPE SY-REPID,
    TEMP_CAT1 TYPE SLIS_FIELDCAT_ALV,
    HEADER_ALV1 TYPE SLIS_T_LISTHEADER,
    HEADER_ALV_WA1 TYPE SLIS_LISTHEADER,
    GT_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,
    GS_KEYINFO TYPE SLIS_KEYINFO_ALV.
    DATA : SPRID TYPE ZSPR_PROJECT_ID.
    DATA : CID TYPE ZCIRCLE_ID.
    DATA : ITAB TYPE TABLE OF ZSCP_PROJECT.
    DATA : WA TYPE ZSCP_PROJECT.
    DATA : ITAB1 TYPE TABLE OF ZSCP_CIRCLE_M.
    DATA : WA1 TYPE ZSCP_CIRCLE_M.
    SELECT * FROM ZSCP_CIRCLE_M INTO TABLE ITAB1.
    SELECT * FROM ZSCP_PROJECT INTO TABLE ITAB WHERE SPR_PROJECT_ID IN S_SPR_ID OR CIRCLE_ID IN S_CIRID.
    LOOP AT ITAB INTO WA.
    READ TABLE ITAB1 INTO WA1 WITH KEY CIRCLE_ID = WA-CIRCLE_ID.
    WRITE : WA1-CIRCLE_DESC.
    WRITE : WA-CIRCLE_ID,
    WA-PROJECT_ID,
    WA-DELEG_STAT,
    WA-PRJ_STAT,
    WA-FLCB,
    WA-FLCL.
    ENDLOOP.
    PERFORM FIELD_CATALOG1.
    PERFORM alv_display1.
    FORM FIELD_CATALOG1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'CIRCLE_ID'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'CIRCLEID'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'SPR_PROJECT_ID'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'CPROJECTID'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'CIRCLE_DESC'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'CIRCLEDESC'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'DELEG_STAT'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'DELGSTAT'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'PRJ_STAT'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'PROJSTAT'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'FLCB'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'FLCB1'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'FLCL'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'FLCL1'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    ENDFORM. "END CATALOG1.
    FORM ALV_DISPLAY1.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE1 '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT = GS_LAYOUT1
    IT_FIELDCAT = CT_FIELDCAT1
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT = GT_SORT[]
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = 'A '
    TABLES
    T_OUTTAB = ITAB
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    <b>please reward points if helpfull.</b>
    with regards,
    radhika kolluru.

Maybe you are looking for

  • Can I video record with iMac?

    Can I record video directly with the built-in iMac camera? I am using OS X 10.8.3

  • How to read from untrusted https connection?

    i try to read the content of a https URL but when calling httpsurl.getContent() or con.getInputStream() i get the following exception: javax.net.ssl.SSLException: untrusted server cert chain      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA

  • How to handle weird characters in form fields (like bullet points from Word docs)

    hi there lots of my users copy and paste from MS Word documents into a text area my app takes that form.textarea data and inserts it in a MYSQL db. when we output that cell from the db, we often find there are ? [question marks] where there once were

  • Upgrade License Question

    Hi, Sorry... didn't know where else to post this. I am considering upgrading to CS5 'Producer'?  from CS4. When I upgrade, does the license allow me to continue to use CS4 -independently-. I ask for two reasons: 1. In case of'glitches', can I keep CS

  • Operations Manager 2012 - TCP Port Monitor

    Hi, Is it possible to have the TCP port monitor only alert if it fails on subsequent polls, instead of the single connection failure which is the default? We have 3 GPRS connections which intermittently fail, so we only need to be alerted if they don