Draw graphics, circles

Hi Guys,
I ahve a question in ABAP using graphics.
can we draw a circle, rectangle(a box) , arrows in ABAP.
My requierment is, we have certain products which we need to link with arrows and there are group of products which I need to put into circle or rectangle.
plz suggest..
regards,
Nazeer

Hi Nazeer,
use given below code & try to understand. Test run on your server.
DATA: BEGIN OF TAB OCCURS 5,
      CLASS(10) TYPE C,
      VAL1(2) TYPE I,
      VAL2(2) TYPE I,
      VAL3(2) TYPE I,
      VAL4(2) TYPE I,
      VAL5(2) TYPE I,
      VAL6(2) TYPE I,
      END OF TAB.
DATA: BEGIN OF OPTTAB OCCURS 1,
        C(20),
      END OF OPTTAB.
MOVE: 'anik' TO TAB-CLASS,
      6 TO TAB-VAL1, 7 TO TAB-VAL2, 8 TO TAB-VAL3, 3 TO TAB-VAL4,  5 TO TAB-VAL5, 6 TO TAB-VAL6.
APPEND TAB.
CLEAR TAB.
MOVE: 'narendra' TO TAB-CLASS,
      15 TO TAB-VAL1, 10 TO TAB-VAL2, 18 TO TAB-VAL3, 3 TO TAB-VAL4,  5 TO TAB-VAL5, 6 TO TAB-VAL6 .
APPEND TAB.
CLEAR TAB.
MOVE: 'gaurav' TO TAB-CLASS,
      17 TO TAB-VAL1, 11 TO TAB-VAL2, 20 TO TAB-VAL3, 3 TO TAB-VAL4,  5 TO TAB-VAL5, 6 TO TAB-VAL6.
APPEND TAB.
CLEAR TAB.
MOVE: 'Kushagra' TO TAB-CLASS,
      10 TO TAB-VAL1, 12 TO TAB-VAL2, 15 TO TAB-VAL3, 3 TO TAB-VAL4,  5 TO TAB-VAL5, 6 TO TAB-VAL6.
APPEND TAB.
OPTTAB = 'FIFRST = 3D'.     APPEND OPTTAB.
OPTTAB = 'P2TYPE = TO'.     APPEND OPTTAB.
OPTTAB = 'P3TYPE = PY'.     APPEND OPTTAB.
OPTTAB = 'P3CTYP = RO'.     APPEND OPTTAB.
OPTTAB = 'TISIZE = 5'.      APPEND OPTTAB.
OPTTAB = 'CLBACK = X'.      APPEND OPTTAB.
*CALL FUNCTION 'GRAPH_MATRIX_3D'
    EXPORTING*
         COL1        = 'monday'*
         COL2        = 'tuesday'*
         COL3        = 'wednesday'*
         DIM2        = 'employees'*
         DIM1        = 'months'*
         TITL        = 'Comparison of Employee attendace in different months.'*
    TABLES*
         DATA        = TAB*
         OPTS        = OPTTAB*
    EXCEPTIONS*
         OTHERS      = 1.*
CALL FUNCTION 'GRAPH_MATRIX_3D'
  EXPORTING
    COL1 = 'monday'
    COL2 = 'tuesday'
    COL3 = 'wednesday'
    COL4 = 'thursday'
    COL5 = 'friday'
    COL6 = 'saturday'
    DIM1 = 'week days'
    DIM2 = 'employees'
  TABLES
    DATA = TAB
    OPTS = OPTTAB.
LEAVE PROGRAM.
I hope it will help u a lot.
Regards,
Narendra

Similar Messages

  • Draw a circle on a jFrame

    Hi! How can i draw a circle over a jFrame?

    In general trying to draw directly on a JFrame is not a good idea and can be problematic. You should think about doing your drawing in a JPanel and adding that to the frame
    Here are a number of things to look at in drawing a circle
    Graphics.drawOval(...)
    Ellipse2D, Ellipse2D.Double
    Area - you can create an area from any Shape, and it offers a lot of advantages to dealing with Shape
    Graphics2D.draw/fill(Shape)

  • Drawing a circle

    Hi Friends,
    I have the following requirement. I am relatively new to Java
    1. Draw a circle
    2. Draw a rectange at the center of the circle
    3. Draw lines from the top edge of the circle to various points in the circle.
    4. Convert this graphic into a gif or a png image.
    Can this be achieved using Java 2D. If yes, can you pls provide me some sample code if possible.
    Thanks a lot for your help.

    You can also use the TextLayout class for displaying text.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.net.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class GraphicsTest
        public static void main(String[] args)
            GraphicsPanel panel = new GraphicsPanel();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(panel.getUIPanel(), "North");
            f.getContentPane().add(panel);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class GraphicsPanel extends JPanel
        Font font;
        String text;
        public GraphicsPanel()
            font = new Font("lucida bright regular", Font.PLAIN, 22);
            text = "centered text";
            setBackground(Color.white);
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int w = getWidth();
            int h = getHeight();
            int cx = w/2;
            int cy = h/2;
            int dia = Math.min(w,h)*7/8;
            g2.setPaint(Color.blue);
            g2.draw(new Ellipse2D.Double(cx - dia/2, cy - dia/2, dia, dia));
            g2.setPaint(Color.orange);
            g2.draw(new Rectangle2D.Double(cx - dia/4, cy - dia/4, dia/2, dia/2));
            g2.setPaint(Color.blue);
            double theta = -Math.PI/2;
            double
                x1 = cx,
                y1 = cy + (dia/2) * Math.sin(theta),
                x2,
                y2 = cy + (dia/4) * Math.sin(theta);
            g2.draw(new Line2D.Double(x1, y1, x1, y2));
            theta = -Math.PI*3/4;
            x1 = cx + (dia/2) * Math.cos(theta);
            y1 = cy + (dia/2) * Math.sin(theta);
            x2 = cx + (dia/4) * Math.sqrt(2) * Math.cos(-Math.PI*5/4);
            y2 = cy + (dia/4) * Math.sqrt(2) * Math.sin(-Math.PI*5/4);
            g2.draw(new Line2D.Double(x1, y1, x2, y2));
            theta = -Math.PI/4;
            x1 = cx + (dia/2) * Math.cos(theta);
            y1 = cy + (dia/2) * Math.sin(theta);
            x2 = cx + (dia/4) * Math.sqrt(2) * Math.cos(Math.PI/4);
            y2 = cy + (dia/4) * Math.sqrt(2) * Math.sin(Math.PI/4);
            g2.draw(new Line2D.Double(x1, y1, x2, y2));
            g2.setFont(font);
            FontRenderContext frc = g2.getFontRenderContext();
            float textWidth = (float)font.getStringBounds(text, frc).getWidth();
            LineMetrics lm = font.getLineMetrics(text, frc);
            float x = (w - textWidth)/2;
            float y = (h + lm.getHeight())/2 - lm.getDescent();
            g2.drawString(text, x, y);
        public JPanel getUIPanel()
            JButton save = new JButton("save");
            save.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    saveImage();
            JPanel panel = new JPanel();
            panel.add(save);
            return panel;
        private void saveImage()
            int w = getWidth();
            int h = getHeight();
            BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
            Graphics2D g2 = bi.createGraphics();
            paint(g2);
            g2.dispose();
            try
                ImageIO.write(bi, "png", new File("test.png"));
            catch(IOException ioe)
                System.out.println("IOE: " + ioe.getMessage());
    }

  • Draw graphics in ABAP

    Hi,
    i'm looking for a way to draw graphics in my SAP-GUI. I need really drawing, not only charts.
    I searched the forum for this topic, and found the solution via a HTML-Control with SVG.
    Basicly this is exactly what im looking for, but isn't there any other way?? In best case a solution, that don't need a plug-in..

    Hi Bernd
    For pictures you can use the class "cl_gui_picture". You can find more in the demo program Nablan mentioned.
    It may also be OK to use an HTML viewer if possible. It can be instantiated from the class "cl_gui_html_viewer"
    To store your picture files you can use the Web Repository.
    To draw graphics, you can use "GRAPH_MATRIX_*" function modules. You can inspect those.
    A better way that I would prefer to draw graphics, is using GFW (Graphical FrameWork). Inspect demo programs "GFW_DEMO_*" for those.
    Hope this clue helps...
    *--Serdar

  • How do I draw a circle in MUSE?

    How do I draw a circle in MUSE? Holding shift&rectangle tool (as in InDesign) isn't working.

    obcomm - Use the Rectangle tool to draw a square. Click the corner options in the Control toolbar, then increase the size until you have a circle.
    David

  • Drawing graphics in RT

    Ok, gonna try to explain my problem:
    I'm into a program who draws graphics using points as they come in.
    By now I repaint() every second the graphs every second but my paint() method redraws all the points received instead of just adding the last one received.
    Any help for getting my already received points in the graph and just add the last one? ( I wanna repaint only if my scale changes )

    I suppose you have a datastructure (like an array or ArrayList) for storing the points, and in the paint method you are redrawing them all.
    So you have to change your strategy. Instead of keeping your points in an array, just draw them in a BufferedImage, and in the paint draw the BufferedImage on the Panel. The code inside paint(Graphics g) will look something like : g.drawImage(bufferedImage, 0, 0, this);
    That way you have a fast and flicker free repaint method.
    Notice that this method will loose all information about point coordinates because it will simply draw them on the BufferedImage. So if you want to be storing the point coordinates for further use (maybe the ability to edit or delete them) you'll have to keep them in a separate datastructure also.
    Hope this helps,
    Ioannis

  • Draw animated circle with brush tool in Flash

    Hello all,
    I need to make a circle with a brush tool so that it looks like a child draws it. If I make a dot with the brush tool on the first frame and a circle on the 15th frame and then create shape tween between those frames it looks stupid, like the circle grows itself.
    Is there any possibility of making such a thing except for drawing it per frame?
    Thanks
    Julia  

    I'm just asking what is the method to draw a circle with a brush that you can see it animated - I mean the process of drawing. For now the only thing I know is to draw every small piece of it frame by frame but I suppose there is a better method.

  • Help in drawing graphics.

    Hi friends,
    I'm newbie in drawing graphics with Java, and I need some help in a specific part of my program.
    What I want to do is to draw a waveform of a sound file. That waveform is built based on the amplitude of each sound sample. So I have a big vector full of those amplitudes. Now what I need to do is plot each point on the screen. The x coordinate of the point will be its time position in the time axis. The y coordinate of the point will be the amplitude value. Ok... Now I have a lot of doubts...
    1 - can someone give me a simple example on how to plot points in a java app? I know I have to extend a JPainel class, but I don't know much about those paint, and repaint methods. It's all weird to me. I already searched through the tutorial and the web, but I couldn't see a simple, good example. Can someone hand me this?
    2 - Once I know how to draw those graphics, I need to find a way to put a button, or anything like that, in my app, so the user can press that button to see to next part of the waveform, since the wave is BIG, and doesn't fit entirely on the screen. Is this button idea ok? Can I use some sort of SCROLL on it, would it be better?
    Well... I'm trying to learn it all. ANY help will be appreciated, ANY good link, little hint, first step, anything.
    Thanks for all, in advance.
    Leonardo
    (Brazil)

    This will lead you, in this sample you have a panel and a button,
    every click will fill a vector with random 700 points and draw them on the panel,
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    public class Wave extends Frame implements ActionListener
         WPanel   pan    = new WPanel();
         Vector   points = new Vector();
         Button   go     = new Button("Go");
         Panel    cont   = new Panel();
    public Wave()
         super();
         setBounds(6,6,700,400);     
         addWindowListener(new WindowAdapter()
        {     public void windowClosing(WindowEvent ev)
                   dispose();     
                   System.exit(0);
         add("Center",pan);
         go.addActionListener(this);
         cont.add(go);
         add("South",cont);
         setVisible(true);
    public void actionPerformed(ActionEvent a)
         points.removeAllElements();
         for (int j=0; j < 700; j++)
              int y = (int)(Math.random()*350);
              points.add(new Point(j,y+1));
         pan.draw(points);
    public class WPanel extends Panel
         Vector   points;
    public WPanel()
         setBackground(Color.pink);
    public void draw(Vector points)
         this.points = points;
         repaint();
    public void paint(Graphics g)
         super.paint(g);
         if (points == null) return;
         for (int j=1; j < points.size(); j++)
              Point p1 = (Point)points.get(j-1);
              Point p2 = (Point)points.get(j);
              g.drawLine(p1.x,p1.y,p2.x,p2.y);
    public static void main (String[] args)
         new Wave();  
    Noah

  • Req: Draw Concentric Circles - help please!

    Hi all!
    Newbie question:
    I'm trying to draw a series of concentric circles in Flash 5
    The circle tool always starts to draw the circle from a
    corner - this makes it tricky to draw a set of concentric circles
    I'm sure there's a way of setting defaults so that Flash will
    draw circles (or other shapes like rectangles) about their centres
    instead of their corners, but I can't find the setting.
    Sorry for the dumb question!
    Thanks in anticipation
    Dave

    Thanks, but it's still not quite what I'm after.
    If you scale the circles serially as you suggest, the gap
    between circles is not equal; as the circles get smaller, the gap
    between them also gets narrower, rather like ripples on a pond. I
    wanted the circles to be concentric, but each one to be a fixed
    distance from the next, rather than a geometric progression.
    Also, I'd still like to be able to constrain the "draw
    rectangle" and "draw circle" commands to draw from the centre
    rather than the corner....
    Any more suggestions, or is upgrading to Flash 8 the only
    solution ? ;-)
    Thanks
    Dave

  • Where can I find the VI "draw a circle by radius" (it's used in NI demo) ?

    I work wiht LabVIEW 6.0.2 full version
    And I'd like to use some "picture functions". But I didn't find those functions... So I went to NI site to find some help but it seems that some commands and functions are missing on my computer because I can't find the library "picture.llb" and the VI "draw a circle by radius" whereas with NI example it is written that no add-on is required...

    Take attached zip file
    Attachments:
    picture.zip ‏204 KB

  • How Do I Draw a Circle / Line Through An Image In Pages?

    Hi guys,
    I never do anything very involved in Pages but today ...
    I have an image (jpeg file) and I would like to draw a circle around it and a line through it -- you know, turn it into one of those International "Don't Do This" signs.
    Is there an easy way?
    Thanks
    I'm using Pages '09 version 4.1

    Insert a round Shape and give it a very thick border with equally thick line (also in Shapes) diagonally across the circle.
    To add the image just drag it onto the shape and when you positioned it the way you like it, group the two.
    Peter

  • Where can I find the Ellipse Tool in PE 12 in order to draw a circle ?

    Where can I find the Ellipse Tool in PE 12 in order to draw a circle ?

    ReaderTortune
    Besides the article to which GautamBahl referred....
    You may also want to review the following for working with the Titler's Shapes in Premiere Elements 12.
    http://www.atr935.blogspot.com/2013/08/pe11-titler-shapes-for-highlighting.html
    Thanks.
    ATR

  • Draw graphics on Image and Save it

    hi!,
    Can anyone help me how to draw graphics(Line, rectangle.ect) on an Image and save it. I need to do the following steps.
    1. Get the Image from the local file system
    2. Based on the parameters i receive for graphics(Ex: rectangle).
    -I have to draw a rectangle on the Image.
    3. Save the Image again to the file system
    I would appreciate if any one has any ideas or sample code I can start with.
    Thanks!!!

    Here's an example using the javax.imageio package.
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.Rectangle;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    public class DrawOnImage {
        public static void main(String[] args) {
            try {
                BufferedImage buffer = ImageIO.read(new File(args[0]));
                Graphics2D g2d = buffer.createGraphics();
                Rectangle rect = new Rectangle(10, 10, 100, 100);
                g2d.setPaint(Color.RED);
                g2d.draw(rect);
                ImageIO.write(buffer, "JPG", new File(args[1]));
            } catch (IOException e) {
                e.printStackTrace();
    }

  • How to call - draw(Graphics g)

    This is a little method in my Applet:
    public void draw(Graphics g)
    g.drawImage(image, 0, 0, this);
    What I want is to call this method when I need it, not automatically like paint(Graphics g), but I couldn't figure out how to call, because Graphics is abstract class, can not be instantiated .
    Pleeeeeeeeeeeeease help me out , many thanks !!!

    This is a little method in my Applet:
    public void draw(Graphics g)
    g.drawImage(image, 0, 0, this);
    What I want is to call this method when I need it,Why?
    not automatically like paint(Graphics g), but I
    couldn't figure out how to call, because Graphics is
    abstract class, can not be instantiated .Right. You can't, nor should you ever need to do what you want to do. The Graphics object is passed to you in the paint() method.
    See:
    http://java.sun.com/products/jfc/tsc/articles/painting/index.html

  • How to draw the circle diagram of induction motor using labview

    hi
      i am trying to model the  electrical machines using labview..
    i want to know that is it possible to draw the circle diagram of induction motor using labview..........
    if its possible then please suggest me the possible ways.
                                                                                         thanks

    There may be better ways, but the method I used was to convert amplitude & angle to rectangular coords, then create an XY plot from (0,0) to those coords.  (Or 1 plot for Voltage, 1 for Current, etc.)  I would then just keep updating this plot and feeding it to the graph in a loop.  The result was a slightly choppy looking but useable animation of the phase vectors.
    -Kevin P.

Maybe you are looking for

  • How do I get PSE 8 to open just one file, not previous ones?

    I just reinstalled PSE 8 (which I prefer to PSE 10) on my new iMac (using Lion 10.4.7; the previous iMac used Leopard 10.5.8) and when I click on a file in a folder or from Bridge to open it in PSE 8, the previous files I worked on also open. I can e

  • Cannot get display to work on I pad 2. No visible damage

    I Pad 2. Cannot get display working?  No visible damage

  • CREATING A CUSTOMIZED PLANNING APPLICATIONS

    Hi all, Please could someone link a HOW-TO "  " guide for developing a customized planning application on marketplace. or let you share your views on this scenarios. thanks a lot, axel

  • Material master template

    hi , does anyone have a template for material master, which can be used for LSMW data mapping? Please forward it to [email protected] Thanks

  • Calculate how long a function takes to run

    I would like to know how to find out how long the function will take to run public int[][] MatrixMultiplication(int[][] MatrixA, boolean[][] MatrixB) {         int result[][] = new int[number_positions + 2][number_positions + 2];         int temp = 0