GetDSN from other method

Hi,
can some one tell me how to call the dsn from other method within the same cfc.
this getDSN method return me the correct dsn that i declared from application.cfm.
<cffunction name="GetDSN" access="public"  output="false"    hint="Gets the DSN">
<cfargument name="dsn" required="yes">
    <cfreturn this />
</cffunction>
how can i get the dsn from above method.  What i have is not working..........
<cffunction name="findDupicate" output="no" access="public" returntype="query">
        <cfargument name="form" required="yes" type="struct">   
        <cfquery name="check_duplicate" datasource="#GetDSN#">
        SELECT voucherNo
        FROM voucher
        WHERE voucherNo= <cfqueryparam value="#arguments.form.voucher#" cfsqltype="cf_sql_varchar" />
    </cfquery>
    <cfreturn check_duplicate>
    </cffunction>
Thanks

Two things that immediately spring to mind.
getDsn() is misnamed, or does the wrong thing.  It doesn't return a DSN, it returns the entire object (return this).
I your CFQUERY tag you're not calling getDsn(), you're just using it as a value, eg: "getDsn" is a reference to the method itself, but "getDsn()" is actually CALLING the method.
Oh a third thing: something called getDsn() would not normally take an argument that is the very thing it is supposedly getting.  IE: why is getDsn() taking an argument of dsn?  It should be RETURNING the DSN name, not having it passed into it.
Adam

Similar Messages

  • How to Handle Automatic Skip Property of Item in Oracle Forms through Custom.pll or from other methods

    Hi All,
    How to Handle Automatic Skip Property of Item in Oracle Forms through Custom.pll or from other methods.
    This is a enhancement requirement.
    When ever user enter value in field 1 then automatically cursor should go to next field.

    Hello Bobb,
    You can create a trigger(when-list-changed) for each list item where you could:
    1.recreate the record groups and then use POPULATE_LIST so you can hide the selected values. In forms builder online help there are some good examples about create record groups dynamically.
    or
    2.you can perform a validation instead of hiding the selected values. If the values is already selected the display a message 'Value already selected....'
    Second option is much faster(only an 'if clause')
    Hope this helps.
    Regards,
    Alex

  • Pass parameters into a method from other methods.

    I m testing  2 related applications with coded ui test and wanna pass a parameter from one method into another.
    how can i do that?
    Thank you in advance.

    Hi mah ta,
    Could you please tell us what about this problem now?
    If you have been solved the issue, would you mind sharing us the solution here? So it would be helpful for other members who get the same issue.
    If not, please let us know the latest information about it.
    Best Regards,
    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.

  • Read variable from other method

    i am coding a method which required a reading from a variable in another method.
    what's the syntax for getting the variable???
    I tried.....
    ++++++++++++++++++++++++++++++++++++++++++++++++++
    public static void main (String[ ]args)
    range_1
    private static double area (int radius, final double pi)
    radius = range_1
    return radius * radius * pi
    ++++++++++++++++++++++++++++++++++++++++++++++++++
    but it doesn't work

    "private static double area (int radius, final double pi)"
    final double pi? as the method parameter? ROFLHAHAHAHAHAHAHAHAHAHAHA
    That made my day.
    As for your question, make range_1 a global variable, in other words, declare it outside your main method
    Something like
    public class gary{
    int range_1;
    public static void main (String afgfg[]){
    range_1=//something;
    private static double area (int radius)
    radius = range_1
    return radius * radius * 3.14

  • Can i run the pakage from other method

    dear
    i want to know and how work the following job.
    i have four jar files which include in my classpath.
    but when i deploy the application to the user i want that no need to set the classpath by the user.
    i think there is two ways
    1.classpath added automatically when we install the application to the user machine but how?
    2. jar files r in the same directory where main class r.how can i access it?
    all the jar files have a pakages
    and i use
    import a.*; //like that one jar file have imageicons.
    plz help me

    See Kappy's very well written user tip:
    What is "Other" and What Can I Do About It?

  • EJB 3.1 @Asynchronous and calling other methods from within

    Hey all,
    I am helping a friend set up a test framework, and I've turned him on to using JEE6 for the task. I am decently familiar with entity beans, session beans, and such. One of the new features is @Asynchronous, allowing a method to be ran on a separate thread. The test framework generally needs to spawn potentially 1000's of threads to simulate multiple users at once. Originally I was doing this using the Executor classes, but I've since learned that for some reason, spawning your own threads within a JEE container is "not allowed" or bad to do. I honestly don't quite know why this is.. from what I've read the main concern is that the container maintains threads and your own threads could mess up the container somehow. I can only guess that this might be possible if your threads use the container services in some way.. but if anyone could enlighten me on the details as to why this is bad, that would be great.
    None the less, EJB 3.1 adds the async capability and I am now looking to use this. From my servlet I use @EJB to access the session bean, and call an async method. My servlet returns right away as it should. From the async method I do some work and using an entity bean store results, so I don't need to return a Future object. In fact, my ejb then makes an HttpClient call to another servlet to notify it that the result is ready.
    My main question though, is if it's ok to call other methods from the async method that are not declared @Asynchronous. I presume it is ok, as the @Asynchronous just enables the container to spawn a thread to execute that method in. But I can't dig up any limitations on the code within an async method.. whether or not it has restrictions on the container services, is there anything wrong with using HttpClient to make a request from the method.. and making calls to helper methods within the bean that are not async.
    Thanks.

    851827 wrote:
    Hey all,.. from what I've read the main concern is that the container maintains threads and your own threads could mess up the container somehow. I can only guess that this might be possible if your threads use the container services in some way.. but if anyone could enlighten me on the details as to why this is bad, that would be great.
    Yes since the EE spec delegated thread management to conatiners, the container might assume that some info is available in the thread context that you may not have made available to your threads.
    Also threading is a technical implementation detail and the drive with the EE spec is that you should concentrate on business requirements and let the container do the plumbing part.
    If you were managing your own threads spawned from EJBs, you'd have to be managing your EJBs' lifecycle as well. This would just add to more plumbing code by the developer and typically requires writting platform specific routines which the containers already do anyway.
    >
    None the less, EJB 3.1 adds the async capability and I am now looking to use this. From my servlet I use @EJB to access the session bean, and call an async method. My servlet returns right away as it should. From the async method I do some work and using an entity bean store results, so I don't need to return a Future object. In fact, my ejb then makes an HttpClient call to another servlet to notify it that the result is ready.
    My main question though, is if it's ok to call other methods from the async method that are not declared @Asynchronous. I presume it is ok, as the @Asynchronous just enables the container to spawn a thread to execute that method in. But I can't dig up any limitations on the code within an async method.. whether or not it has restrictions on the container services, is there anything wrong with using HttpClient to make a request from the method.. and making calls to helper methods within the bean that are not async.
    Thanks.If you want to be asynchronous without caring about a return value then just use MDBs.
    The async methods have no restrictions on container services and there is nothing wrong with calling other non async methods. Once the async method is reached those annotations don't matter anyway (unless if you call thhose methods from a new reference of the EJB that you look up) as they only make sense in a client context.
    Why do you need to make the call to the servlet from the EJB? Makes it difficult to know who is the client here. Better use the Future objects and let the initial caller delegate to the other client components as needed.

  • Method not accessible from other classes

    Hi,
    I ve defined a class and would like to create an instance of it from another class. That works fine, I am also able to access class variables. However the class method "calcul" which is defined as following, is not accessible from other classes:
    class Server {
    static String name;
    public static void calcul (String inputS) {
    int length = inputS.length();
    for (int i = 0 ; i < length; i++) {
    System.out.println(newServer.name.charAt(i)); }
    If I create an instant of the class in the same class, the method is then available for the object.
    I am using JBuilder, so I can see, which methods and variables are available for an object. Thanks for your help

    calcul is a static method, that means you do not need an instance of server to run this method. This method is also public, but your class Server is not, your Server class is package protected. So only classes within the same package has Server can use its method. How to use the calcul method?// somewhere in the same package as the Server class
    Server.calcul( "toto" );

  • Pm-suspend resumes from suspend, but all other methods don't

    Running Arch with xfce. Everything is updated and am on kernal 3.9. Desktop PC, motherboard Gigabyte H61N-USB3 (latest BIOS).
    I've been having an issue for a few months with resume not working properly after a suspend. I've tried all sorts of solutions, e.g.:
    adding items to my kernal line (hpet=disable, acpi_osi=Linux)
    installing acpi, acpid
    disabling HPET in the BIOS
    editing /etc/mkinitcpio.conf with the resume hook instead of autodetect
    installing uswsusp
    None worked. Seen a lot of threads here of people having the same issue, but with me, it ALWAYS resumes fine if I suspended with pm-suspend.
    If I issue pm-suspend, the computer suspends nicely. I press the power button and everything comes back on. /var/log/pm-suspend.log is always successful.
    But, if I use any other method, such as sysctl suspend, or upower, or the suspend option in the Xfce menu (uses xfce4-power-manager), the resume doesn't wake any USB devices (my mouse light stays off) or the monitor (stays in blinking stanby mode). Sometimes it will resume fine, very rarely, but 90% of the time it won't. Only the PC power light will come on but that's it. Even the reset button won't restart the PC. I have to hold the power button for 4 seconds to turn it off.
    I'm almost to the point of replacing the motherboard over this as it's driving me up the wall.
    pm-suspend (which works great) generates a pm-suspend log. But any of the other methods generate a pm-powersave log. So those other methods must have something in common. I will post the contents later as I'm at work.
    I'd like to get the other methods working because if the PC suspends after a set time (through xfce), or if I use the Xfce suspend menu option, I know it won't resume. A workaround would be to make a pm-suspend menu option and some sort of schedule for it to run after a certain idle time, but that's not an answer for the original problem.
    Is there any way I can troubleshoot why systemd and other methods don't resume but pm-suspend does resume it fine?
    Last edited by nLinked (2013-05-24 13:52:20)

    I cleared pm-powersave.log and suspended through the xfce menu > Suspend.
    Resume worked fine once.
    Suspended again.
    Resume worked fine second.
    Suspended again, resume didn't work, PC fans on but mouse and display off.
    The output of the new pm-suspend.log is here, although it's possible it can't write any errors to the log when resume fails?
    http://pastebin.com/ZHDSeG6H

  • NEED HELP on returning values from a method

    Hello Java World,
    Does anyone know how to return more then 1 value from a method..
    ex.
    //the following returns one value
    //Person Class
    private String getname()
    return this.name;
    how can i get two values (ex. name and occupation of person)
    Thank you in advance.

    Create a Class which will hold the values you want and return that object. Or return a List, or return an array, or - taking your example with the person, why don't you return the whole person object?
    Thomas

  • Returning multiple values from a method

    I have to return a string and int array from a method (both are only of size 5 for a total of 10) What would be considered the best manner in which to do this ?
    Dr there's 10 points in it for you or whoever gives me the best idea ;-P

    hey here it is easy that you can return many things
    what ever you want from a single method man....
    you know the main thing what you have to do is.....
    Just create a VECTOR or LIST object, then add all the
    values what ever you want to return like string and
    int array like etc...
    Then make the method return type is VECTOR and after
    getting the Vector you can Iterate that and you can
    get all the values from that method what ever you
    want....
    jus try this,,,,,,,,,,
    Its really work......
    reply me..but it relies purely on trust that the returned collection would contain exactly the right number and type of arguments

  • Return multiple values from a method

    For a school project I have to make a parameter-less constructor that can input values from the keyboard and calculate those values. Now that I have the values how do I return them? I need to return 3 values from this parameter-less method.
    I hoope someone can help.

    Qwertyfshag wrote:
    Here is the wording of the assignment. I have copied and pasted it word for word:
    "Declare and use a no-argument (or "parameter-less") constructor to input the data needed, and to do the calculations."
    Any advice???Find a teacher who isn't an idiot. That sentence is vague ("to input the data needed"? Does that mean that it's supposed to query the user (which is terrible) or that it's supposed to encapsulate the data as hardcoded values, or what?) and is a bad design. Constructors shouldn't do this sort of thing.
    Ok I have done that part and now I want to retrieve the values of the calculations. How can I get those values out of that method What do you mean "that method"? Constructors aren't methods, and they don't return values.
    I suppose you could define a class whose constructor queries the user, and which would have a method to return values. That could be pretty simple; the method signature would be like this:
    Set<Integer> getValues();
    This seems like an advanced problem.It's not advanced; it's just garbage.
    I can't post the code in hear because that may constitute cheating. I am allowed to discuss it verbally but I cannot share code, sorry.You can't get a lot of help then. We can't psychically see what you've done so far.
    In conclusion: I have to have two methods. One method is a constructorConstructors aren't methods. If your teacher told you that they are, then he/she doesn't know what he/she is doing.
    that has NO parameters that will get input from the keyboard (done) and do the calculations (done). The other method must print that values to the screen on separate lines (not done). I don't know how to get the values out of the method.If they're two methods in the same class, then the constructor just needs to store the user input into a field of the class, and the other method can read the values in that field.

  • Using a variable from another method within another method

    I have a couple methods. In the beginning of the class I declared the double variables. Then I have a method1 that in that class that changes those double variables. Then the last method2 runs, and is suppose to print information to the screen with the changed variable information all being called from another class. How do I get those changed double variables to be read in method2?

    Sorry about all that, when I paste it in from the compiler it's skews it some, but hopefully this should be more readable
    * Project Filename: Lab1s2
    * Program Filename: Lab1s2.java
    * I/O Files used:
    * Fuction:          This program will use interactive input to ask cost of a
    *                   product in dollars and cents (eg. 17.50).  If the product
    *                   is not less than $100.00, an error message will be displayed
    *                   and input will be requested again.  Once a valid value is
    *                   given, the program will calculate the fewest bills and change
    *                   to be returned if the customer gives a $100.00 bill.
    * Formulas:         (100 - amount = change)
    * Algorithm:
    * Purpose:          The main method calls other methods found in the MoneyXX class
    *                   that will accomplish the function of the project.
    public class Lab2sl
         public static void main( String[] args ) // main method begins program execution
         Money2sl myMoney2sl = new Money2sl(); // create myMoney2sl object and assign it to Money2sl
            myMoney2sl.inputSL();// calls input method and pass argument
            myMoney2sl.changeSL(); // calls change method
            System.out.println(); // output a blank line
         myMoney2sl.outputSL(); //calls outputSL to show results
    * Project Filename: Money2SL.java
    import java.util.Scanner;
    import java.util.Calendar;
    public class Money2sl
         Scanner input = new Scanner( System.in ); // create Scanner to obtain input from command window
        private double change,
                       amount; // instant variable, stores amount
        private double twentyD = 20.00;
        private double tenD = 10.0;
        private double fiveD = 5.0;
         private double dollar = 1.0;
         private double quarter = 0.25;
         private double dime = 0.10;
         private double nickel = 0.05;
         private double penny = 0.01;
         private double numTwentyD;
         private double numTenD;
         private double numFiveD;
         private double numDollar;
         private double numQuarter;
         private double numDime;
         private double numNickel;
         private double numPenny;
        // inputSL() method gets amount, checks to see if it is under $100, stores amount into variable
        public void inputSL() //input method
             Calendar dateTime = Calendar.getInstance(); // get current date and time
            //print date and time
            System.out.printf( "%s\n", "nothing" );
            System.out.printf( "%1$ta, %1$tB. %1$te, %1$tY %1$tr\n\n", dateTime );
             //print output
                System.out.println( "Please enter the amount of money (less than $100) that you will spend: ");  // prompt
              amount = input.nextDouble();
              while ( amount > 100 )
                  System.out.println( "error - enter amount less than $100");
                System.out.println( "Please enter the amount of money (less than $100) that you will spend: ");  // prompt
                  amount = input.nextDouble();
             } // end inputSL method
        // changeSL() calculates change from amount entered out of $100
         public void changeSL()
              change = 100 - amount; // calculate change
              while(change > 0)
            if ( change - fiveD >= 0 )
                        numFiveD ++;
                       change -= fiveD;
              if ( change - fiveD >= 0 )
                        numFiveD ++;
                       change -= fiveD;
              if ( change - dollar >= 0 )
                        numDollar++;
                       change -= dollar;
              if ( change - quarter >= 0 )
                        numQuarter ++;
                       change -= quarter;
              if ( change - dime >= 0 )
                        numDime ++;
                       change -= dime;
              if ( change - nickel >= 0 )
                       numNickel ++;
                       change -= nickel;
              if ( change - penny >= 0 )
                        numPenny ++;
                       change -= penny;
         } // end changeSL method
        //outputSL() displays original amount, change dollar amount, and change in individual bills and coins
        public void outputSL()
             System.out.printf( "$%.2f dollars will return $%.2f, which is: ",
                                 amount, change );
            System.out.println(); // blank line
             System.out.println(); // blank line
            if ( numTwentyD > 0 )
                 if ( numTwentyD > 1)
                      System.out.println( numTwentyD + " twenty dollar bills" );
                 System.out.println( numTwentyD + " twenty dollar bill" );
            if ( numTenD > 0)
                 if ( numTenD > 1 )
                      System.out.println( numTwentyD + " ten dollar bills" );
                 System.out.println( numTwentyD + " ten dollar bill" );
            if ( numFiveD > 0)
                 if ( numFiveD > 1 )
                      System.out.println( numFiveD + " five dollar bills" );
                 System.out.println( numFiveD + " five dollar bill" );
            if ( numDollar > 0)
                 if ( numDollar > 1 )
                      System.out.println( numDollar + " one dollar bills" );
                 System.out.println( numDollar + " one dollar bill" );
              if ( numQuarter > 0)
                 if ( numQuarter > 1 )
                      System.out.println( numQuarter + " quarters" );
                 System.out.println( numDollar + " quarter" );
              if ( numDime > 0)
                 if ( numDime > 1 )
                      System.out.println( numDime + " dimes" );
                 System.out.println( numDime + " dime" );
              if ( numNickel > 0)
                 if ( numNickel > 1 )
                      System.out.println( numNickel + " nickels" );
                 System.out.println( numNickel + " nickel" );
              if (numPenny > 0)
                 if ( numPenny > 1 )
                      System.out.println( numPenny + " pennies" );
                 System.out.println( numPenny + " penny" );
    }

  • Reading a variable from one method to another method

    I am pretty new to Java and object code, so please understand if you think I should know the answer to this.
    I wish to pass a variable from one method to another within one servet. I have a doPost method:
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              HttpSession session = request.getSession();
             String userID = (String)session.getAttribute("userID");
             String title = request.getParameter("title");
            PrintWriter out = response.getWriter();
            out.println("userID is ..."+userID);
    } and wish to pass the variable userID to:
      public static void writeToDB(String title) {
             try{
                  String connectionURL = "jdbc:mysql://localhost/cms_college";
                  Connection connection=null;     
                 Class.forName("com.mysql.jdbc.Driver");
                 connection = DriverManager.getConnection(connectionURL, "root", "");
                 Statement st = connection.createStatement();         
                   st.executeUpdate ("INSERT INTO cmsarticles (title, userID) VALUES('"+title+"','"+userID+"')");
             catch(Exception e){
                   System.out.println("Exception is ;"+e);
        }because, at the moment the userID cannot be resolved in the writeToDB method. Thanking you in anticipation.

    Thanks for responding.
    If I replace
    public static void writeToDB(String title)with
    public static void writeToDB(String title, String userID)It throws up an error in the following method
    public void processFileItem(FileItem item) {
              // Can access all sorts of useful info. using FileItem methods
              if (item.isFormField()) {
                   //Map<String, String> formParameters = new LinkedHashMap<String, String>();
                   //String filename = item.getFieldName();
                   //String title = item.getString();
                   //System.out.println("received filename is ... " + filename );
                   //formParameters.put(title, filename);
                   } else {
                      // Is an uploaded file, so get name & store on local filesystem
                      String uploadedFileName = new File(item.getName()).getName();            
                      File savedFile = new File("c:/uploads/"+uploadedFileName);
                      long sizeInBytes = item.getSize();
                      System.out.println("uploadedFileName is " + uploadedFileName);
                      String title = uploadedFileName;
                      System.out.println("size in bytes is " + sizeInBytes);
                      writeToDB(title);
                      try {
                        item.write(savedFile);// write uploaded file to local storage
                      } catch (Exception e) {
                        // Problem while writing the file to local storage
              }      saying there are not enough arguments in writeToDB(title);
    and if I put in an extra argumenet writeToDB(title,String userID);
    again it does not recognise userID

  • How to read internal table data and use to retrive from other table.

    Hi all,
        I am trying to generate a report using ooabap.
    In this scenario, I retrieved data from one standard table (zcust) and successfully displayed using structure 'i_zcust_final' ( i_zcust_final is similar structure of zcust).  
        Now I want to get some other data from other standard table  (zpurch) using the data in i_zcust_final. How....???? I am unable to read data from i_zcust_final even i kept in loop.
        I am attaching the code here.. even it too long, please look at the code and suggest me what to do.
    code  **************************
    REPORT  ZBAT_OOPS_REPORT1.
    TABLES: ZCUST.
        D E F I N I T I O N     *****
    CLASS BATLANKI_CLS DEFINITION.
      PUBLIC SECTION.
      DATA : ITAB_ZCUST TYPE STANDARD TABLE OF ZCUST,
             I_ZCUST_FINAL LIKE LINE OF ITAB_ZCUST,
             ITAB_ZCUST1 TYPE STANDARD TABLE OF ZCUST.
      TYPES: BEGIN OF IT_ZPURCH,
              CUSTNUM   TYPE ZPURCH-CUSTNUM,
              PURC_DOC  TYPE ZPURCH-PURC_DOC,
              VENDOR    TYPE ZPURCH-VENDOR,
              STATUS    TYPE ZPURCH-STATUS,
              PURC_ORG  TYPE ZPURCH-PURC_ORG,
            END OF IT_ZPURCH.
      DATA : ITAB_ZPURCH TYPE TABLE OF IT_ZPURCH,
             I_ZPURCH_FINAL LIKE LINE OF ITAB_ZPURCH.
      METHODS: GET_ZCUST,
               PRINT_ZCUST,
               GET_ZPURCH.
    ENDCLASS.
    I N I T I A L I Z T I O N   *****
        SELECT-OPTIONS:S_CUSNUM FOR ZCUST-CUSTNUM.
    INITIALIZATION.
    S_CUSNUM-LOW = '0100'.
    S_CUSNUM-HIGH = '9999'.
    S_CUSNUM-OPTION = 'BT'.
    S_CUSNUM-SIGN   = 'I'.
    APPEND S_CUSNUM.
    CLEAR S_CUSNUM.
    I M P L E M E N T A T I O N *****
    CLASS BATLANKI_CLS IMPLEMENTATION.
      METHOD GET_ZCUST.
      SELECT * FROM ZCUST
        INTO TABLE ITAB_ZCUST
       WHERE CUSTNUM IN S_CUSNUM.
    ENDMETHOD.
      METHOD PRINT_ZCUST.
       LOOP AT ITAB_ZCUST INTO I_ZCUST_FINAL.
       WRITE:/ I_ZCUST_FINAL-CUSTNUM,
               I_ZCUST_FINAL-CUSTNAME,
               I_ZCUST_FINAL-CITY,
               I_ZCUST_FINAL-EMAIL.
       ENDLOOP.
      ENDMETHOD.
       METHOD GET_ZPURCH.
    LOOP AT ITAB_ZCUST INTO ITAB_ZCUST1.
      SELECT CUSTNUM
             PURC_DOC
             VENDOR
             STATUS
             PURC_ORG
        FROM ZPURCH
        INTO CORRESPONDING FIELDS OF TABLE ITAB_ZPURCH
        WHERE CUSTNUM EQ I_ZCUST_FINAL-CUSTNUM.
    ENDLOOP.
         LOOP AT ITAB_ZPURCH INTO I_ZPURCH_FINAL.
         WRITE:/ I_ZPURCH_FINAL-CUSTNUM,
                 I_ZPURCH_FINAL-PURC_DOC,
                 I_ZPURCH_FINAL-VENDOR,
                 I_ZPURCH_FINAL-STATUS,
                 I_ZPURCH_FINAL-PURC_ORG.
         ENDLOOP.
    ENDMETHOD.
    ENDCLASS.
      O B J E C T   *****
    DATA: BATLANKI_OBJ TYPE REF TO BATLANKI_CLS.
    START-OF-SELECTION.
    CREATE OBJECT BATLANKI_OBJ.
    CALL METHOD:
                 BATLANKI_OBJ->GET_ZCUST,
                 BATLANKI_OBJ->PRINT_ZCUST,
                 BATLANKI_OBJ->GET_ZPURCH.
    Can anyone suggest me..
      Thanks in advance,
      Surender.

    Hi Surendar..
    There is mistake in the Work area specification in this method.
    METHOD GET_ZPURCH.
    LOOP AT ITAB_ZCUST INTO ITAB_ZCUST1.
    SELECT CUSTNUM
    PURC_DOC
    VENDOR
    STATUS
    PURC_ORG
    FROM ZPURCH
    INTO CORRESPONDING FIELDS OF TABLE ITAB_ZPURCH
    <b>WHERE CUSTNUM EQ      ITAB_ZCUST1-CUSTNUM.</b>           
                                   "Instead of  I_ZCUST_FINAL-CUSTNUM.
    ENDLOOP.
    LOOP AT ITAB_ZPURCH INTO I_ZPURCH_FINAL.
    WRITE:/ I_ZPURCH_FINAL-CUSTNUM,
    I_ZPURCH_FINAL-PURC_DOC,
    I_ZPURCH_FINAL-VENDOR,
    I_ZPURCH_FINAL-STATUS,
    I_ZPURCH_FINAL-PURC_ORG.
    ENDLOOP.
    ENDMETHOD.
    Now it should work..
    One more thing : From performance point of view you have to Replace that loop using FOR ALL ENTRIES . And avoid CORRESPONDING FIELDS. it will be slow.
    This is the code.
    LOOP AT ITAB_ZCUST INTO ITAB_ZCUST1.
    if ITAB_ZCUST[] IS NOT INITIAL.
    SELECT CUSTNUM
    PURC_DOC
    VENDOR
    STATUS
    PURC_ORG
    FROM ZPURCH
    INTO TABLE ITAB_ZPURCH
    <b>for all entries in ITAB_ZCUST1</b>
    <b>WHERE CUSTNUM EQ      ITAB_ZCUST1-CUSTNUM.</b>           
                                   "Instead of  I_ZCUST_FINAL-CUSTNUM.
    ENDIF.
    ENDLOOP.
    <b>Reward if Helpful.</b>

  • Problem with image returned from getGeneratedMapImage method

    I'm a newbie as far as map viewer and Java 2D goes....
    My problem is the java.awt.Image returned from the getGeneratedMapImage method of the MapViewer API. The image format is set to FORMAT_RAW_COMPRESSED. The image returned is of poor quality with colors not being correct and lines missing. I'm painting the Image returned from this method onto my own custom JComponent by overriding the paint() method...
    public void paint( Graphics g )
    Image image = map.getGeneratedMapImage();
    if ( image != null )
    g.drawImage( image, getLocation().x, getLocation().y, Color.white, this );
    If I take the xml request sent to the application server and paste it into a "sample map request" on the map admin website (along with changing format to PNG_STREAM) my image renders exactly how I expect it to.
    Anyone have any idea what I need to do to get the java.awt.Image with format set to FORMAT_RAW_COMPRESSED to render correctly. I was hoping to get back a BufferedImage or a RenderedImage from the getGeneratedMapImage call but I'm getting back a "sun.awt.motif.X11Image".
    Will downloading the JAI (java advanced imaging) from sun help me at all?

    Joao,
    Turns out it is related to colors. I'm dynamically adding themes, linear features and line styles. I ran a test where I changed the color being specified in the line style from magenta (ff00ff) to black. When I changed the color the linear feature would show up. It was being rendered as white on a white background when I was specifying it to be magenta. I'm specifying another linear feature to be green and it is showing up in the java image as yellow. This doesn't happen when I take the generated XML from the request and display it as a PNG_STREAM.
    Any clue what is going on there?
    Jen

Maybe you are looking for