Passing Data to a Paint Method

Total newbie here just learning the basics of Java on my own. Working a little application that will display a filled polygon which shows the correct heading of ship based on previously input Ship Heading, length and width. I have the application working fine to generate the 5 points, and then it will display correctly when I enter the points in the paint method by hand. Thing is I want to have the coords passed to the paint method. and am having some trouble doing this. All the examples I have seen show the points to be displayed already being declared in the paint method. Here is the Paint Method I have come up with based on examples I have seen. Still pretty new and trying to read through the APIs and other books, but haven't broken the code on understanding them.
import java.awt.*;
import javax.swing.*;
public class DrawShip5
   public static void main(String[] a)
    JFrame f = new JFrame();
    f.setTitle("Ship Heading");
    f.setSize(700,700);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setContentPane(new DrawShip2());
    f.setVisible(true);
   static class DrawShip2 extends JComponent
       static public void paintData(int [] finalCoordsArray )
    int finalBowACoordX = finalCoordsArray[0];
    int finalBowACoordY = finalCoordsArray[1];
    int finalPortMidACoordX = finalCoordsArray[2];
    int finalPortMidACoordY = finalCoordsArray[3];
    int finalPortSternACoordX = finalCoordsArray[4];
    int finalPortSternACoordY = finalCoordsArray[5];
    int finalStarSternACoordX = finalCoordsArray[6]; 
    int finalStarSternACoordY = finalCoordsArray[7]; 
    int finalStarMidACoordX = finalCoordsArray[8];
    int finalStarMidACoordY = finalCoordsArray[9];       
    public void paint(Graphics g )
         // Am sure my problem lies in here
        int finalBowACoordX = paintData.finalBowACoordX;
        int finalBowACoordY = paintData.finalBowACoordY;
        int finalPortMidACoordX = paintData.finalPortMidACoordX;
        int finalPortMidACoordY = paintData.finalPortMidACoordY;
        int finalPortSternACoordX = paintData.finalPortSternACoordX;
        int finalPortSternACoordY = paintData.finalPortSternACoordY;
        int finalStarSternACoordX = paintData.finalStarSternACoordX; 
        int finalStarSternACoordY = paintData.finalStarSternACoordY; 
        int finalStarMidACoordX = paintData.finalStarMidACoordX;
        int finalStarMidACoordY = paintData.finalStarMidACoordY;    
         g.setColor(Color.black);
         g.drawLine(350, 0, 350, 700);
         g.drawLine(0, 350, 700, 350);
         g.setColor(Color.blue);
         Polygon shipPic = new Polygon();
         shipPic.addPoint( finalBowACoordX, finalBowACoordY ); // Bow Coords
         shipPic.addPoint( finalPortMidACoordX, finalPortMidACoordY ); // Port Midship Coords
         shipPic.addPoint( finalPortSternACoordX, finalPortSternACoordY ); // Port Aft Coords
         shipPic.addPoint( finalStarSternACoordX, finalStarSternACoordY ); // Starboard Aft Coords
         shipPic.addPoint( finalStarMidACoordX, finalStarMidACoordY ); // Starboard Midship Coords
         g.fillPolygon( shipPic );
} Thanks for any help

Looks like I was typing as Malcom was responding....where would I add that bit of code?
import java.awt.*;
import javax.swing.*;
public class DrawShip5
   public static void main(String[] a)
    JFrame f = new JFrame();
    f.setTitle("Ship Heading");
    f.setSize(700,700);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setContentPane(new DrawShip2());
    f.setVisible(true);    
    // Place the code here? Get an error for the finalCoordsArray not recognized
   static class DrawShip2 extends JComponent
            private int finalBowACoordX;
         private int finalBowACoordY;
         private int finalPortMidACoordX;
         private int finalPortMidACoordY;
         private int finalPortSternACoordX;
         private int finalPortSternACoordY;
         private int finalStarSternACoordX; 
         private int finalStarSternACoordY; 
         private int finalStarMidACoordX;
         private int finalStarMidACoordY; 
          static public void setCoords(int [] finalCoordsArray)
             int finalBowACoordX = finalCoordsArray[0];
             int finalBowACoordY = finalCoordsArray[1];
             int finalPortMidACoordX = finalCoordsArray[2];
             int finalPortMidACoordY = finalCoordsArray[3];
             int finalPortSternACoordX = finalCoordsArray[4];
             int finalPortSternACoordY = finalCoordsArray[5];
             int finalStarSternACoordX = finalCoordsArray[6]; 
             int finalStarSternACoordY = finalCoordsArray[7]; 
             int finalStarMidACoordX = finalCoordsArray[8];
             int finalStarMidACoordY = finalCoordsArray[9];
          // Print final coords after array passed and parsed
             System.out.println("Paint Final Bow Coords: (" + finalBowACoordX + ", " + finalBowACoordY + ")");
             System.out.println("Paint Final Port Midship Coords: (" + finalPortMidACoordX + ", " + finalPortMidACoordY + ")");
             System.out.println("Paint Final Port Stern Coords: (" + finalPortSternACoordX + ", " + finalPortSternACoordY + ")");
             System.out.println("Paint Final Starboard Stern Coords: (" + finalStarSternACoordX + ", " + finalStarSternACoordY + ")");
             System.out.println("Paint Final Starboard Midship Coords: (" + finalStarMidACoordX + ", " + finalStarMidACoordY + ")");
      public void paintComponent(Graphics g )
        g.setColor(Color.black);
         g.drawLine(350, 0, 350, 700);
         g.drawLine(0, 350, 700, 350);
         g.setColor(Color.blue);
         Polygon shipPic = new Polygon();
         shipPic.addPoint( finalBowACoordX, finalBowACoordY ); // Bow Coords
         shipPic.addPoint( finalPortMidACoordX, finalPortMidACoordY ); // Port Midship Coords
         shipPic.addPoint( finalPortSternACoordX, finalPortSternACoordY ); // Port Aft Coords
         shipPic.addPoint( finalStarSternACoordX, finalStarSternACoordY ); // Starboard Aft Coords
         shipPic.addPoint( finalStarMidACoordX, finalStarMidACoordY ); // Starboard Midship Coords
         g.fillPolygon( shipPic );
}Tried placing that code in a few spots and got errors.
Appreciate the help, These are my first attempts at actually getting away from a single method program. Am getting it ...slowly, but I am getting it.

Similar Messages

  • Help with 2D Graphics - How do I send Variable data to paint method?

    I am working on a program that figures mortgage payments and an amortization schedule when a user inputs the principle, APR, and term length in years. After it figures all of those, I want to be able to display a chart that shows the principle and interest amounts for each year. My problem is, how do I get my loan information into my paint method so that I can draw a chart using that data? Any help would be greatly appreciated. The graph class in the code below is called after pressing a "Display Graph" button from my GUI.
    I'm pasting my code below. This does not include my main method or my GUI method. I can post those if necessary. Here is my code so far:
    import java.util.*;
    import java.lang.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import java.io.*;
    import java.lang.Math;
    public class Graph extends JFrame
         public Graph(double dCurrentBalance, double dMonthlyPmt, double dRate, int iTime)
              final double balance = dCurrentBalance;
              JFrame graphFrame;
              int iCounter = 0;
              int iPmtNumber = 0;
              double dCurrentInt = 0.0;
              double dCurrentPrinciple = 0.0;
              double dMPR = 0.0;
              int yCoordInt = 0;               //integer for Y coordinate for Interest
              int yCoordPrinciple = 0;     //integer for Y coordinate for Principle
              iTime *= 12;               //determine number of months for this loan
              iCounter = iTime;          //set loop counter to number of months for this loan
              dMPR = dRate/12;          //determine monthly periodic rate
              graphFrame = new JFrame ("mCalc Graph");
              graphFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              graphFrame.setSize(800,600);
              graphFrame.setResizable(false);
              // center graphFrame on the screen
         Dimension ScreenSize = Toolkit.getDefaultToolkit().getScreenSize();
         Dimension FrameSize = graphFrame.getSize();
         if (FrameSize.height > ScreenSize.height)
         FrameSize.height = ScreenSize.height;
         if (FrameSize.width > ScreenSize.width)
         FrameSize.width = ScreenSize.width;
         graphFrame.setLocation((ScreenSize.width - FrameSize.width) / 2,
                   (ScreenSize.height - FrameSize.height) / 2);
              //Displays graphFrame
              Graphic graphicPane = new Graphic();
              graphFrame.add(graphicPane);
              graphFrame.setVisible(true);
              //This loops until all payments have been figured
              for (; iCounter > 0; )
         iPmtNumber++;
         dCurrentInt = dCurrentBalance * dMPR;
         dCurrentPrinciple = dMonthlyPmt - dCurrentInt;
         dCurrentBalance = dCurrentBalance - dCurrentPrinciple;
                   if (iPmtNumber%12 == 0)
    //           System.out.println("dCurrentBalance = " + dCurrentBalance);
    //                    System.out.println("Payment # = " + iPmtNumber);
    //                    System.out.println("dCurrentInt = " + dCurrentInt);
    //                    System.out.println("dCurrentPrinciple = " + dCurrentPrinciple);
         iCounter = iCounter-1;
              } //end for loop
         } //end Graph constructor
    /* This class needs to be personalized to include my own variable names,
    *     etc. I also need to find a way to bring in data from the Graph class.
         class Graphic extends JPanel
              public void paintComponent(Graphics comp)
                             int i; // Declare the variables used to generate the chart
    float xLoc = 50; // Location of the X Axis along Y
    float yLoc = 50; // Location of the Y Axis along X
    Line2D.Float LnA; //
    super.paintComponent(comp);
                   // Establish a tie between this subroutine and the Graphic
    Graphics2D comp2D = (Graphics2D) comp;
    // Cast the Graphics named comp to a Graphics2D as comp2D
    comp2D.setColor(Color.white);
    // Set the background color
    comp2D.fillRect(0,0,800,600);
    // Draw the X and Y axis
    comp2D.setColor(Color.black); // Set the pen color to black
    Line2D.Float YAxis = new Line2D.Float(50,50,50,getSize().height - 50); // Define the Y-Axis
    Line2D.Float XAxis = new Line2D.Float(50F,getSize().height - 50F, getSize().width -50F, getSize().height -50F); //Define the X-Axis
    comp2D.draw(YAxis); // Draw the Y-Axis
    comp2D.draw(XAxis); // Draw the X-Axis
    Font font = new Font("Dialog", Font.BOLD, 12); // Set the font for the Axis labels
    comp2D.setFont(font);
    float increment = 15;
    // Draw the line
    xLoc += increment;
    comp2D.setColor(Color.red);
    /* Need to find a way to bring in my own data to use for the
    * yLoc variables.
    for (i=1; i<=45; i++)
    { // Begin making the graph
    if (i < 30)
         yLoc += increment;
    } else {
         yLoc -= increment;
    // Scale the location to the graph height
    LnA = new Line2D.Float( xLoc, getSize().height - 50F , xLoc, yLoc); // Create the line
    comp2D.draw(LnA); // Draw the line
    xLoc += increment;
                             }//end for
                   }//end paintComponent
              } //end class Graphic
    } //end class Graph
    Any help would be GREATLY appreciated! Thanks.
    Message was edited by:
    russedl
    My email address iss [email protected] if you wish to reply privately. I can send my entire program code if that will help. Thanks!

    Hi Deca,
    You can use the CmdExecuteSync method of the DIAdem.TOCommand interface to set the value of a text channel. For example passing the string "CHT(1,1) := 'test'" as a parameter to the CmdExecuteSync method will set the 1st row of the 1st channel to "test". Please refer to the DIAdem help for more documentation on the CHT function.
    I hope this helps! Please post back if I wasn't clear enough in explaining how to do this or if you have any problems getting it to work.
    Regards,
    Sarah Miracle
    National Instruments

  • Best method for passing data between nested components

    I have a fairly good sized Flex application (if it was
    stuffed all into one file--which it used to be--it would be about
    3-4k lines of code). I have since started breaking it up into
    components and abstracting logic to make it easier to write,
    manage, and develop.
    The biggest thing that I'm running into is figuring out a way
    to pass data between components. Now, I know how to write and use
    custom events, so that you dispatch events up the chain of
    components, but it seems like that only works one way (bottom-up).
    I also know how to make public variables/functions inside the
    component and then the caller can just assign that variable or call
    that function.
    Let's say that I have the following chain of components:
    Component A
    --Component B
    -- -- Component C
    -- -- -- Component D
    What is the best way to pass data between A and D (in both
    directions)?
    If I use an event to pass from D to A, it seems as though I
    have to write event code in each of the components and do the
    bubbling up manually. What I'm really stuck on though, is how to
    get data from A to D.
    I have a remote object in Component A that goes out and gets
    some data from the server, and most all of the other components all
    rely on whatever was returned -- so what is the best way to be able
    to "share" data between all components? I don't want to have to
    pass a variable through B and C just so that D can get it, but I
    also don't want to make D go and request the information itself. B
    and C might not need the data, so it seems stupid to have to make
    it be aware of it.
    Any ideas? I hope that my explanation is clear enough...
    Thanks.
    -Jake

    Peter (or anyone else)...
    To take this example to the next (albeit parallel) level, how
    would you go about creating a class that will let you just
    capture/dispatch local data changes? Following along my original
    example (Components A-D),let's say that we have this component
    architecture:
    Component A
    --Component B
    -- -- Component C
    -- -- -- Component D
    -- -- Component E
    -- -- Comonnent F
    How would we go about creating a dispatch scheme for getting
    data between Component C and E/F? Maybe in Component C the user
    picks a username from a combo box. That selection will drive some
    changes in Component E (like triggering a new screen to appear
    based on the user). There are no remote methods at play with this
    example, just a simple update of a username that's all contained
    within the Flex app.
    I tried mimicking the technique that we used for the
    RemoteObject methods, but things are a bit different this time
    around because we're not making a trip to the server. I just want
    to be able to register Component E to listen for an event that
    would indicate that some data has changed.
    Now, once again, I know that I can bubble that information up
    to A and then back down to E, but that's sloppy... There has to be
    a similar approach to broadcasting events across the entire
    application, right?
    Here's what I started to come up with so far:
    [Event(name="selectUsername", type="CustomEvent")]
    public class LocalData extends EventDispatcher
    private static var _self:LocalData;
    // Constructor
    public function LocalData() {
    // ?? does anything go here ??
    // Returns the singleton instance of this class.
    public static function getInstance():LocalData {
    if( _self == null ) {
    _self = new LocalData();
    return _self;
    // public method that can be called to dispatch the event.
    public static function selectUsername(userObj:Object):void {
    dispatchEvent(new CustomEvent(userObj, "selectUsername"));
    Then, in the component that wants to dispatch the event, we
    do this:
    LocalData.selectUsername([some object]);
    And in the component that wants to listen for the event:
    LocalData.getInstance().addEventListener("selectUsername",
    selectUsername_Result);
    public function selectUsername_Result(e:CustomEvent):void {
    // handle results here
    The problem with this is that when I go to compile it, it
    doesn't like my use of "dispatchEvent" inside that public static
    method. Tells me, "Call to possibly undefined method
    "dispatchEvent". Huh? Why would it be undefined?
    Does it make sense with where I'm going?
    Any help is greatly appreciated.
    Thanks!
    -Jacob

  • How many method can pass data from Database to front-end(aspx)?

    How many method can pass data from Database to front-end(aspx)?
    By using ajax, I want show some data to aspx or html
    Here is one of these method,
    HTTP Handler(ashx):
    we can json data, use HTTP Handler pass data to front-end
    And can we do this by other method? Web API? or some fancy way?
    Thanks for any reply

    Hello TaiwanWei,
    Try forums.asp.net.
    Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • What are the methods available for passing data between Labview 6.0 VI and another custom windows program

    The big picture is that I'm trying to use labview to interface to a DSP board.
    I already have a small windows application "app" which communicates with the dsp. Now I want Labview to grab data from the "app" and plot/analyze ... etc.
    I'm a novice at this 'interprocess communication stuff", what can I use to pass data back and forth between between the "app" and LV?
    use ActiveX, DMA, streams, etc.?
    In a crude sense I could just have the "app" write the data to a file and then have LV read the file. (can two applications read the file at the same time?), but
    this seems very slow and clumsy. I'd rather have a RAM based FIFO which both could access.
    Thanks!
    G
    Details:
    Pentium120 Windows 95 Host
    Spectrum TMSC30 DSP
    VC++6
    LV6

    It depends on what 'interprocess communication' your "app" program has available.
    I regulary use DDE to control a PLL App which controls our PLL via the LPT Port. This is only a write process, but works very easily. The read is equaly easy. You need to know the various "keywords" like service, topic and instruction which the "app" will respond to.
    Generaly I found ActieX to be more extensive, meaning its probably going to take longer and more steps to achive similar simple results.
    The file does not seem to be the best way.
    Hope that helps a bit.

  • Passing data b/w applet and apache server

    Hi all,
    I have an application that runs in the JApplet.I have to pass data b/w server and applet.The
    datas are brought from the server using php to the browser and passed to applet using param
    tags.
    1.Is it possible to set value for the param tag from applet?
    2.How to retrieve data from the param tag to the applet in the form of an array.
    In the getParameter it is required to specify the param name.
    Is it possible to retrieve data from param tag similar to that of getting data from command
    line arguments array.

    Hi all,
    I have an application that runs in the JApplet.I have
    to pass data b/w server and applet.The
    datas are brought from the server using php to the
    browser and passed to applet using param
    tags.
    1.Is it possible to set value for the param tag from
    applet?Why do you ever want to do it? It sounds like setting arguments passed to a program's main method from command line after the main method has been invoked. It is possible though to dynamically set any values for any applet params using php before the applet gets loaded to the browser window as you generate an html file on the server side.
    2.How to retrieve data from the param tag to the
    applet in the form of an array.
    In the getParameter it is required to specify the
    param name.
    Is it possible to retrieve data from param tag similar
    to that of getting data from command
    line arguments array.You can use some naming/numbering convention for your params. For example settings1, settings2 ... Then you can loop in your code retrieving the values like getParameter("settings" + i) checking to see that it is not null or empty.
    However, if you don't want to reload the applet (together with the page) just to get some new data from the server, you can establish a tcp/ip connection as elchaschab recommended.
    Cheers!

  • In BADi , How to pass the values between two Method

    Hi Experts,
    We have two methods in BADis. How to pass the value  between two Methods. Can you guys explain me out with one example...
    Thanks & Regards,
    Sivakumar S

    Hi Sivakumar!
    Create a function group.
    Define global data (there is a similiar menu point to jump to the top include).
    Create one or two function modules, with which you can read and write the global data.
    In your BADI methods you can access the global data with help of your function modules. It will stay in memory through the whole transaction.
    Regards,
    Christian

  • Passing data from one frame to another frame

    hello all, i am having a problem with passing data from one frame from another. I have a main frame when you click on connect button it display the second frame(class) that has 2 text fields and 2 buttons. When i click on connect it check if the data is correct. If the data is correct i want that frame to close and pass the data back to main frame. How can i do that.
    thank you

    hello all, i am having a problem with passing data
    from one frame from another. I have a main frame when
    you click on connect button it display the second
    frame(class) that has 2 text fields and 2 buttons.
    When i click on connect it check if the data is
    correct. If the data is correct i want that frame to
    close and pass the data back to main frame. How can
    i do that.
    thank you
    the original problem sounded like an ideal opportunity to use Modal Dialog. if you want one frame to display another to get user input then you need to stop the method in the main frame from executing until you recieve a valid input.
    you can use your own class and keep all of the components that you have in the connect frame but you would have to extend JDialog instead of JFrame.
    there is a way around it!
    if you must use JFrame for both, then you need to have access to the main frame in the connect frame, maybe pass the pointer to the constructor??
    anyway, when the connect frame is done with its duties, you have to use the pointer to call another method in the main frame that will continue the process. otherwise main frame doesn't know when connect frame is done and by that time, the method in main frame that instantiated the connect frame has long since died.
    also, it allows things to happen in the other window that you may not want to happen until the connect frame is done
    typically users of software start clicking around on things and you could have three or four connect frames going at the same time
    it's really best to use a Modal Dialog, it really can look just like a JFrame!!!!!!!!!!!!!!

  • Calling a new browser window with WD Abap and passing data via POST

    Hi there,
    does anybody know whether passing data via POST method is possible when opening a new browser window from within a Web Dynpro Component? In my case I use method IF_WD_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW for opening a new browser window. Now I want to pass a big amount of data which is only possible via POST method. How can I achieve that or is it not considered inside the Web Dynpro Framework?
    Kind regards,
    Albert

    Hi Priya,
    can you please explain a little bit more what you mean? I didn't get it..
    Kind regards,
    Albert

  • Problem in passing data from 1 screen to another using BBP_DOC_CHANGE_BADI.

    Hi Experts,
    i am new to the SRM, i am facing problem in passing data from one screen to another.
    my requirement is that when we select one shopping cart and press the PROPOSE SOURCES OF SUPPLY button, we will fetch all the contracts that are attached to the shopping cart.
    we have implemented a BADI implementation of BBP_SOS_BADI (method BBP_SOS_CHECK) for passing some changed values to the contracts of the shopping cart into the popup screen that is displayed when we press PROPOSE SOURCES OF SUPPLY button and when we select any contract and press ASSIGN ONLY button in the popup screen the badi BBP_DOC_CHANGE_BADI is triggered.
    i have implemented another BADI implementation of BBP_DOC_CHANGE_BADI for fetching the selected contract and pass the values to another screen, but the problem is that when we select one contract and press the assign only button we are fetching the wrong contract number ( that is in the BADI method BB_SC_CHANGE parameter IT_ITEM we are fetching the wrong contract), if we again do the same procedure for the second time we are getting the correct contract.
    i am unable to understand why we are getting the wrong contract in the first time( that is we are getting contract other than the selected one).
    as per my understanding i think when we are passing data to the popup screen using BBP_DOC_CHANGE_BADI we are not updating the shopping cart with the changed data.
    can anyone tell me how we can update the SHOPPING CART with the changed contracts data, i have used BBP_PD_SC_UPDATE, BBP_PD_SC_SAVE and other shopping cart FM but nothing is happening.
    Thanks
    Tanveer

    Hello,
    What version of SRM are you on?  Have you check for OSS Notes?  I have had trouble with BBP_DOC_CHANGE_BADI but it was because of other issues.  The BADI works pretty well and it is called almost every time something happens to the shopping cart.
    I have noticed that sometimes that values are not changed til the second calling of the BADI.  I have yet understand why but I think it has to do with prompt processing. Usually, we train our requisitioners to click the 'Check'  button to flush things out.
    I don't know if I was helpful.... another thought.... could there be an error caught by BBP_DOC_CHECK_BADI that is preventing change in BBP_DOC_CHANGE_BADI?
    Regards, Dean.

  • Passing data from one bsp application to another

    Hi,
    I have few queries that most of you would have done in ur projects:
    1. I want to pass data from one bsp application to another:
    eg based upon selected row of table view which populates material no and descriprion to another application which open the entire material master data.
    Now, i have both the pages in diff bsp applications in place but unable to pass the selected material code to the second bsp application.
    Had it been two different pages of same application I was able to achieve it with set parameter()
    2. To stop the application from reprcessing the data:
    eg: Suppose I have a bsp page where user fill details of a customer and on submitinng the details a customer is created in background and the entire page is disabled by my code. Even now if the user press refresh (F5) button then another customer gets created in the background. So basically i want to avoid the reprocess of the onSubmit event
    Few lines of sample code would be very helpful.
    Best Regards,
    Saurabh Tripathi

    Hi,
    When I am writing the following code in appl1/page1:
            export abc from transactionID
            to data buffer lv_page_data.
            CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>SET_SERVER_COOKIE
              EXPORTING
                NAME                  = 'TRANSACTIONID'
                APPLICATION_NAME      = RUNTIME->application_name
                APPLICATION_NAMESPACE = RUNTIME->application_namespace
                USERNAME              = ls_name
                SESSION_ID            = runtime->session_id
                DATA_VALUE            = lv_page_data
                DATA_NAME             = 'lv_page_data'
    and following code in appl2/page2:
      CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>GET_SERVER_COOKIE
        EXPORTING
          NAME                  = 'TRANSACTIONID'
          APPLICATION_NAME      = RUNTIME->application_name
          APPLICATION_NAMESPACE = RUNTIME->application_namespace
          USERNAME              = ls_name
          SESSION_ID            = runtime->session_id
          DATA_NAME             = 'lv_page_data'
        CHANGING
          DATA_VALUE            = lv_page_data
       IF lv_page_data IS NOT INITIAL.
         IMPORT abc to transactionid
           FROM data buffer lv_page_data.
       ENDIF.
    still the code doesn't work. Please explain and guide
    Best Regards,
    Saurabh Tripathi

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

  • Passing data from one screen to another(web-dynpro) in SRM sourcing cockpit

    HI Experts,
    i am facing problem in passing data from one web-dynpro screen and assigning the data it to another web-dynpro screen.
    my requirement is that when ever user selects a contract in PROPOSE SOURCES OF SUPPLY screen popup and press only assign only button, the data of the contract should be copied to the shopping cart.
    i have already used the BADI BBP_DOC_CHANGE_BADI, but unfortunately it was not working.
    so i tried to use the context, element and other web-dynpro fields to pass the data, i am able to pass the data from the popup to the second screen and able to assign it.
    but when ever i deselect the shoppping cart which has been assigned with the data of the popup and select another shopping cart the data of the above shopping cart is cgetting changed.
    i am unable to figure out the exact reason why this is happeing.i have written code in the ASSIGN ONLY button method to fetch the popup data and in the WDONMODIFYVIEW method of the second screen to assign the popup data to the shopping cart.
    i have tried to bind the elements using the BIND_TABLE, BIND_STRUCTURE, BIND_ELEMENT, BIND_ELEMENTS methods, but nothing is working.
    can anyone suggest me where i am making mistake and try to solve the issue.
    Thanks
    Tanveer

    Dear Poster
    Your thread has had no response since it's creation over
    2 weeks ago, therefore, I recommend that you either:
    - Rephrase the question.
    - Provide additional Information to prompt a response.
    - Close the thread if the answer is already known.
    Thank you for your compliance in this regard.
    Jason Boggans
    SAP SRM SDN Moderator

  • Passing date parameters to a custom folder

    Is there any simple way to pass date parmeters to a custom folder?

    I think I recognize a question very similar to this recently.
    And it's the same situation, in that - what do you mean by passing a date?
    I understand it to mean that you want a user - at run time - to enter a date or date range that will then return only that data from a custom folder.
    1. You could have all data returned (ie: no date conditions applied to the SQL) and then filter using the Disco tool (ie: plus, viewer, desktop).
    2. If you want to 'pass' those date parameters into the actual folder in the EUL, then there is a method that you can use using functions you write.
    3. Or you could code the actual database SQL view with some kind of hard-coded date parameters (ie: SYSDATE - 30), etc.
    Russ

  • How to pass data between views using Flex for mobile?

    Hi,
      In my 1st view, I have set of images. Each image represents a product category. When I click on an image, it has to show my 2nd view which is a list. This should show all the products linked to this category.
    I saw few examples where the 1st view is a list. Select an item in a list shows the details in the next view.
    But what I need is, I need to know which image is clicked in my 1st view (ie) Home page. This id needs to be passed to my 2nd view to retrieve the data for the clicked image (clicked product category).
    Can anyone help me in this?

    Chellaa2011,
      If I understand you correctly, you can pass data to the next view by passing the second parameter to the pushView method. 
      check out: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/ViewNa vigator.html#pushView()
      I've written similar apps in the past and found that a singleton class alleviates some of these issues.  If you use a singleton to track currently selections all your views can access the same data without having to pass and return data from each other.
    Hope this helps,
    KLee

Maybe you are looking for