Coding a LOGOFF button for a single Webdynpro Application

Hi Experts,
       Can you please help me with the coding for a LOGOFF button for a standalone Webdyn pro Application.
I did do the initial research and have the following in place.
        View O/P plug => Calling Window I/P plug => Calling Window O/P plug [Type 1 Exit ].
Also, have the following coding in the Window I/P Plug.
                   wd_this->fire_op_logoff_plg(
          close_window = ABAP_TRUE  " wdy_boolean
The Problem  is, When I press the LOGOFF button, a Window pops-up with "Do you want to Close this Window?" and Has 2 buttons YES/NO. If the user clicks YES, the window close and ALL IS WELL! But if the user CLICKs "NO" .  The Brower is still open with the message "Application was terminated; You can close the Window". Not sure how to take it forward. Please advise.
       If am totally fine, if I can close the window w/o any popup or user option.
Cheers in advance!

Hi,
What you enumerated above should be all you need to code logoff:
View O/P plug => Calling Window I/P plug => Calling Window O/P plug Type 1 Exit .
Also, have the following coding in the Window I/P Plug.
wd_this->fire_op_logoff_plg(
close_window = ABAP_TRUE " wdy_boolean
Just check your sessions before and after you click the logoff button. You should see the HTTP session only while the WD app is active.
Are you saying it is not working? Did you setup the navigation link between the I->O plugs?
Is there a problem?
Regards,
George

Similar Messages

  • Single Webdynpro Application with multiple JCO Connection ?

    Hi Experts,
    I have a strange requirement ......
    We have a Webdynpro Application which is connected to
    say (using JCO connection)
    client:- A
    now i want to connect the same Webdynpro application to
    Client:- B which is again in the same server as the client A.
    Please help me how to handle this.
    how it possible to connect a single Webdynpro application to two different clients using JCO Connection.
    Please help.
    Points would be rewarded to helpful answers.
    Regards,
    Sanjyoti.

    Hi experts
                        We have to use  wd application for both client at a same time e.g. as follow
    Client A -
    > Travel app--->Featches data from A for   employee hired in client A ,in same server as B
    Client B -
    > Travel app--->Featches data from B for   employee hired in client B , in same server as A
    we  are using same EP for both client but using diffrent roles for employees of both client.
    Please reply asap.

  • How To get the number of request's for a single Composite Application

    Hi can any body tell how to get the number requst's for a single composite application.
    Thanks
    Mani

    Hi,
    There are lots of STATE is available for composite instances, like mentioned in the below query. I hope you will get answer from the below query.
    SELECT (CASE WHEN STATE=1 THEN 'OPEN AND RUNNING'
    WHEN STATE=2 THEN 'OPEN AND SUSPENDED'
    WHEN STATE=3 THEN 'OPEN AND FAULTED'
    WHEN STATE=4 THEN 'CLOSED AND PENDING'
    WHEN STATE=5 THEN 'CLOSED AND COMPLETED'
    WHEN STATE=6 THEN 'CLOSED AND FAULTED'
    WHEN STATE=7 THEN 'CLOSED AND CANCELLED'
    WHEN STATE=8 THEN 'CLOSED AND ABORTED'
    WHEN STATE=9 THEN 'CLOSED AND STALE'
    WHEN STATE=10 THEN 'NON-RECOVERABLE'
    ELSE STATE || ''
    END) AS STATE, component_name, COUNT(*) AS NUM_OF_CUBE_INST FROM CUBE_INSTANCE where composite_name='PASS THE COMPOSITE NAME HERE..........'
    group by (CASE WHEN STATE=1 THEN 'OPEN AND RUNNING'
    WHEN STATE=2 THEN 'OPEN AND SUSPENDED'
    WHEN STATE=3 THEN 'OPEN AND FAULTED'
    WHEN STATE=4 THEN 'CLOSED AND PENDING'
    WHEN STATE=5 THEN 'CLOSED AND COMPLETED'
    WHEN STATE=6 THEN 'CLOSED AND FAULTED'
    WHEN STATE=7 THEN 'CLOSED AND CANCELLED'
    WHEN STATE=8 THEN 'CLOSED AND ABORTED'
    WHEN STATE=9 THEN 'CLOSED AND STALE'
    WHEN STATE=10 THEN 'NON-RECOVERABLE'
    ELSE STATE || ''
    END), component_name;
    Thanks,
    Vijay

  • How to set different urls for logoff button for different user groups

    HI All,
    We have two different set of users in our company .when one user group clicks on the logoff button in masthead we want to redirect them to for example www.google.com and for the other group we want to redirect to www.gmail.com.
    How can we acheive this particular requirement
    Thanks
    Bala Duvvuri

    hi bala,
    For the  two user groups maintain two different desktops, two/same themes and frame work.change the headeriview jsp in masthead par file to Google and save it as masthead1 and another one with gmail as masthead2 then create iviews with that par file and assign them to different groups and make invisible the default masthead iview.then the users get the logoff based on group you can get some wikis on changing log off or redirecting log off, check these threads
    Portal logoff : Redirection or Close the Entire Window
    Portal Logoff redirection URL
    Regards
    Mahesh

  • Maximum number of buttons for a single screen? Max Number of videos?

    I'm getting horribly slow performance (waiting for minutes at a time to do simple menu edits) and frequent crashes in Encore CS5.  It is nearly unusable.
    I have about 45 individual short clips that I want to put on a DVD.  Each clip needs to play and then return to the main menu screens (i have 3 menus set up to break up the clips).
    I have the basic structure set up (after a few dozen crashes and sluggish performance) but auto-routing on the buttons results in instant crashes and the final DVD burn doesn't follow the routing that I've set up manually.
    This software is deeply deeply flawed.  What are it's official limitations because I seem to be exceeding boundaries in many places  (even though my project isn't particularly sophisticated)?

    Adobe shouldn't enforce restrictions regarding number of buttons on a single screen!
    A warning is Ok, but this decision should be left to the user!
    Why? I burned the other day a fully functional Blu-ray disc (BDMV) with a SINGLE submenu page containing 52 text buttons (!) + RETURN button back to the Top Menu. I used Sony Media's DVD Architect (v.5.0.b) to do that. I played the disc on my Sony BDP-S550 without any problem whatsoever (as well as on my PC both the physical disc, and from the BDMV folder, using both PowerDVD and ArcSoft's software). I'm pretty confident it'll play in other players as well.
    So, in my experience it's fully possible to have a lot more than 18 buttons on a blu-ray (sub)menu, in spite the formal DVD definitions.
    I was rather disappointed to discover that Encore restrict that
    (I wanted to use Enocre since DVD Architect needed to recompress the source, I don't want that.)
    My Encore experience in this case summarized:
    - I can place all the 52 buttons on a submenu manually,
    - "Check project" is fine with that (no errors),
    - The links are Ok ("Show button routing")
    => In the "Preview", however, only the first 18 links navigate, the rest play "dead" (don't activate even if I move the mouse over those)!
    Still, if I choose a specific Chapter beyond #18 (say #39) in the field below, it plays the requested Chapter!
    How about that.
    This is an irritating and unnecessarily enforced restriction by Adobe.
    Let me decide, please!
    Cheers,
    Willy

  • Table as Input parameter for BAPI in Webdynpro Application

    I am creating webdynpro JAVA application to create RFQ, for which ABAP guy written a Custom BAPI called Z_BAPI_INQUIRY_CREATE. I tested this BAPI  in SAPGUI it is working fine. From my webdynpro application when I passes header and item parameter, my header getting inserted but my item data is not. It is giving me error like "Table input parameter not found". I am passing table to this bapi. When I tried my code to standard BAPI's (NOT CUSTOM), I am able to insert both HEADER and ITEM data.
    In above scenario I have few questions,
    1. Is there anything extra we have to do with custom BAPI's? (my BAPIs are in BOR).
    2. What is the datatype in webdynpro parallal to table parameter?
    3. is there any tutorial available for table parameter? (except FLIGHT examle).
    Thanks and regards,
    Nitin

    Hi Vijayakhanna Raman,
    Thanks much for your reply.
    Yes I did the same as you mentioned, but still I am getting an error "Table parameter not avaliable is empty".
    I am not getting were is the bug. And this is happening only with ZBapi's not with Standard Bapi's.
    I am really stucted becouse of this, answer will really get all 10 points.
    Here is my code,
         1. First create an instance for bapi and bind the instance to the bapi node.
         Z_Bapi_Inquiry_Change_Input input = new Z_Bapi_Inquiry_Change_Input();
         Zbapirfqitem item =new Zbapirfqitem();          
         wdContext.nodeBapi_RFQ_OnHold_Update_Input().bind(input);
         2. Then if u have the import parameter u have to set them by using
         input.setRfq_Number("6");
         input.setCreated_By("NLNS0000");
         //wdContext.currentBapi_RFQ_OnHold_Update_InputElement().modelObject().setRfq_Number("6");
         //wdContext.currentBapi_RFQ_OnHold_Update_InputElement().modelObject().setCreated_By("NLNS0000");
         3. If the bapi has a table parameters then the structure for the table parameters will also be imported In the model class.
    DONE!
         4. Set the table parameters by creating the instance for that structure and using this instance set it.
                             item.setUpdateflag("I");
                             item.setItm_Number("000030");
                             item.setMaterial("MAT-NITIN");
                             item.setMatl_Desc("Inserted by Nitin");
                             item.setQuantity(new BigDecimal(4));
                             item.setBase_Uom("PCE");
                             item.setReq_Qty(new BigDecimal(4));
                             item.setBase_Uom1("PCE");
                             item.setList_Price(new BigDecimal(3));
                             item.setList_Curr("");
                             item.setReq_Price(new BigDecimal(4));
                             item.setCurrency("EUR");
                             item.setIndirect_Price(new BigDecimal(4));
                             item.setCurrency_2("EUR");
                             item.setFinal_Price(new BigDecimal(4));
                             item.setCurrency_3("EUR");
                             item.setText_Line("");
                             item.setReq_Date_H(new Date(12-05-06));
                             item.setDirect_Dis(new BigDecimal(4));
                             item.setIndirect_Dis(new BigDecimal(4));
                             item.setFinal_Dis(new BigDecimal(4));
                             item.setProfit_Margin1(new BigDecimal(4));
                             item.setProfit_Margin2(new BigDecimal(4));
                             item.setBrand1("");
                             item.setModel1("");
                             item.setVal_Loccurr1(new BigDecimal(4));
                             item.setCurrency1("");
                             item.setBrand2("");
                             item.setModel2("");
                             item.setVal_Loccurr2(new BigDecimal(4));
                             item.setCurrency2("");
              5. Then add the structure instance to the bapi instance.
         input.addItem(item);
         6. Then Execute the bapi after setting the import parameters.
              //wdThis.wdGetContext().currentBapi_RFQ_OnHold_Update_InputElement().modelObject().execute();
              input.execute();
    Message was edited by: Nitin Kamble

  • Coding a submit button for a db

    can anybody help me out!
    i've created two editor panels in dbswing along with a submit button.
    i'm not really sure how to code the submit button to send the info from the editor panels to a database!
    database is mysql
    thanks in advance!

    JButton b = ....
    b.setActionCommand("submit");
    b.addActionListener(listener);where listener is an a class that implements ActionListener
    In listener's "actionPerformed()" method, put your DB code.
    If you already knew all that, then your post is more DB related than
    Swing, and so there is probably a better forum for it.

  • Error in Travel n Expenses for EHP2 (Abap webdynpro application)

    Hi,
    We have implemented ESS 1.2 in Portal (NW 7.0) alongwith Enhancement Package 2.
    Due to EHP2 our Travel Application is now ABAP Based WEBDynpro,so when we access any Travel related link in Portal we will be directed to the R3 system.
    Now we have an issue whil accesing the Create Travel request & Create Expense report applications in Portal.
    Details:-
    1.When we access Create Travel Request or Create Expense Report through QUICK Links provided in the Overview Page and other places we are able to access the Applications.
    2.But when we try to Access the Create Travel request & Create Expense Report through the path:-
    My Trips & Expenses --> Create Travel request / Create Expense Report (which are BUTTONS provided within My Trips & expenses) then we are not able to Access the applications. We are getting
    Javascript:void(0);
    3.Since the Funcitonality of Create Travel request & Expense Report is working through Quick Links, we thought of HIDING the BUTTONS provided in My Trips & Expenses.
    4.How Do we HIDE THE BUTTONS provided there? OR Make the buttons working....
    Useful suggestions will be awarded.
    Regards,
    JJ

    Hi Joshi,
    For example if you want the plannning button to work put the following content in your spro->define resources.
    Resoruce key : EMPLOYEE_TRAVEL_PLANNING_SRV_12
    URL of PCD path: ROLES://portal_content/Custom_Development/com.sao.ca.hr.etravel.F_e- Travel/com.sao.ca.hr.etravel.F_e- Travel_Roles/com.sao.ca.hr.etravel.R_ESS_All_Users/com.sao.ca.hr.etravel.W_ESS_All_Users/com.sap.pct.erp.ess.12.planning
    It will work for sure..similarly do it for expense and request
    Thanks,
    Rajkumar.S
    Edited by: Rajkumar S on Dec 31, 2008 9:14 AM

  • Feedback request for a Single Instance Application Implementation

    Hello,
    I have been working on a class which I tried to make the most generic I could so that I could re-use it for various projects. It offers 2 main functionalities:
    -Preventing multiple instances of an application
    -Allowing a user to stop the application even if it doesn't read any user input
    Of course if someone wants to have multiple instances of the same application, it is still possible. The only requirement is that each instance be configured to run on a different port.
    I would like your feedback on how I've implemented this to make sure I haven't missed the chance to make my Class flexible and re-usable. I would also make sure that there aren't any situations where the different threads used for realizing this functionality will run into any conflicts.
    My code includes the following files:
    Serviceable.java : An interface which must be implemented by every application using these classes
    DuplicateServiceException.java : An exception thrown when an instance of the application is already running
    Service.java : The class responsible for offering the functionalities I already mentionned
    Main.java : An example of a class implementing Serviceable and offering two ways of closing the Application. 1- By closing the JFrame which is displayed. 2- By sending the stop command.
    In order to execute this example, you have to specify the following command line arguments:
    -DService.Command={start/stop} //Either start or stop command
    -DService.Port=<0-65535> //Port to be used for receiving the stop command and preventing multiple instances
    Serviceable.java
    * Serviceable cares about two parts of the life of a Service.  Its startup
    * and its shutdown sequences.  The startup occurs only after making sure
    * no other instance of the Service is running.  Shutdown has to be
    * synchronized between multiple threads since it is possible to shutdown
    * the service through a shutdown command sent by another process, or through
    * the normal flow of execution of the service.
    * @author Gabriel Aubut-Lussier
    public interface Serviceable {
          * Initiates the startup of the Service since we have made sure
          * that there isn't any other instance of the Service running.
         public void startup();
          * Initiates the shutdown of the Service since we've received
          * a shutdown request from one of the two supported means of
          * shutting down.
         public void shutdown();
    DuplicateServiceException.java
    public class DuplicateServiceException extends Exception {
          * serialVersionUID?  Bah. Eclipse generates one automatically so why not...
         private static final long serialVersionUID = 3929576386522489749L;
         public DuplicateServiceException() {
              super();
         public DuplicateServiceException(String msg) {
              super(msg);
    Service.java
    * The same way a graphical application is running as long as there
    * is something to display, a background service will run as long as
    * there is an active Thread.
    * A service can be terminated in different ways.  First of all, it
    * can be terminated through its normal flow of execution.  On the
    * other hand, it is possible to provoke the termination of a Service
    * externally.
    * To terminate the service through the normal flow, just call the
    * Service.shutdown() method.  Another way to terminate the service
    * is to start a new instance of the program with the Stop command.
    * This Service implementation will behave according to two system
    * properties.  The property Service.Command can be set
    * to "start" or "stop".  When set to "start", the Service will make
    * sure there isn't another instance of the service already running.
    * If it is the case, a DuplicateServiceException will be thrown.  In
    * the other case, the Service will start.  When the "stop" command
    * is invoked, the Service will attempt to stop a running instance of
    * the Service.  The other property is Service.Port and
    * it defines the Port number which will be used to support the
    * functionalities offered by the Service class.
    * It is recommended to set these properties as command line arguments
    * when launching the application.  Moreover, batch files or shell
    * scripts can be created for invoking the start and stop commands.
    * @author Gabriel Aubut-Lussier
    public class Service implements Runnable {
         public final static String START_COMMAND = "start";
         public final static String STOP_COMMAND = "stop";
         public final static String SERVICE_COMMAND = "Service.Command";
         public final static String SERVICE_PORT = "Service.Port";
         private String serviceCommand;
         private int servicePort;
         private Serviceable service;
         private ServerSocket serviceListener;
         private Thread serviceThread;
          * Creates a new service registering the hooks required to perform
          * clean termination sequences.
          * @param s
          * @throws DuplicateServiceException
         public Service(Serviceable s) throws DuplicateServiceException {
              service = s;
              serviceCommand = System.getProperty(SERVICE_COMMAND);
              String servicePortString = System.getProperty(SERVICE_PORT);
              if(servicePortString == null)
                   servicePort = -1;
              else
                   servicePort = Integer.parseInt(servicePortString);
          * Try running this new Service instance if there isn't one
          * already running.
          * @throws DuplicateServiceException if another service instance is already running.
         public void start() throws DuplicateServiceException {
              if(serviceCommand == null || servicePort < 0) {
                   throw new IllegalArgumentException("The command and port number must be specified.");
              if(serviceCommand.equals(START_COMMAND)) {
                   try {
                        serviceListener = new ServerSocket(servicePort);
                        serviceThread = new Thread(this);
                        serviceThread.start();
                        service.startup();
                   } catch(BindException e) {
                        throw new DuplicateServiceException("An instance of the service is already running.");
                   }catch(IOException e) {
                        e.printStackTrace();
              } else if(serviceCommand.equals(STOP_COMMAND)) {
                   shutdown();
          * Provoke a shutdown command.
         public void shutdown() {
              try {
                   Socket sock = new Socket("localhost", servicePort);
                   OutputStreamWriter out = new OutputStreamWriter(sock.getOutputStream());
                   out.write("shutdown");
                   out.flush();
                   out.close();
                   sock.close();
              } catch (UnknownHostException e) {
                   e.printStackTrace();
              } catch (IOException e) {
                   //This exception may occur when trying to stop a service which wasn't running.
                   //There is no need to do anything in this case.
          * While the Service is running, it listens on a port to make sure no
          * other instance of this Service is started and to listen to shutdown
          * commands.
         public void run() {
              boolean keepGoing = true;
              while(keepGoing) {
                   try {
                        Socket sock = serviceListener.accept();
                        InputStreamReader in = new InputStreamReader(sock.getInputStream());
                        char cBuf[] = new char[256];
                        int amount = in.read(cBuf);
                        in.close();
                        sock.close();
                        keepGoing = !((new String(cBuf, 0, amount)).equals("shutdown"));
                   } catch (IOException e) {
                        e.printStackTrace();
              try {
                   service.shutdown();
                   serviceListener.close();
              } catch(IOException e) {
                   e.printStackTrace();
         public String getServiceCommand() {
              return serviceCommand;
         public void setServiceCommand(String serviceCommand) {
              this.serviceCommand = serviceCommand;
         public int getServicePort() {
              return servicePort;
         public void setServicePort(int servicePort) {
              this.servicePort = servicePort;
    Main.java
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JFrame;
    public class Main implements Serviceable {
         private JFrame window;
         private Service service;
         public static void main(String[] args) {
              new Main();
         public Main() {
              try {
                   service = new Service(this);
                   service.start();
              } catch(DuplicateServiceException e) {
                   e.printStackTrace();
         public void startup() {
              window = new JFrame("SERVICE TEST! :D");
              window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              window.addWindowListener(new WindowAdapter() {
                   public void windowClosed(WindowEvent e) {
                        service.shutdown();
              window.setVisible(true);
         public void shutdown() {
              System.out.println("Application shutdown");
              window.dispose();
    }Thanks in advance for your feedback.
    -Gabriel Aubut-Lussier

    I have fixed the handshake.
    And even though it isn't implemented yet, I think I have my solution for the limitation of 1 instance per user. I plan on using a hidden file in the user's home directory in which I will write the port number where the running application is listening for events. I have not yet chosen how the port number will be chosen before being written to the file but I am thinking about using a random number between 1024 and 65535. Using this approach, it is possible to maintain all the features I've implemented in the Single Overall Instance solution I already have.
    Here is the code with the handshake fixed:
    Serviceable.java
    * Serviceable cares about two parts of the life of a Service.  Its startup
    * and its shutdown sequences.  The startup occurs only after making sure
    * no other instance of the Service is running.  Shutdown has to be
    * synchronized between multiple threads since it is possible to shutdown
    * the service through a shutdown command sent by another process, or through
    * the normal flow of execution of the service.  Moreover, when another instance
    * is prevented from being launched, the running instance is notified so that it
    * can react to such an event.
    * @author Gabriel Aubut-Lussier
    public interface Serviceable {
          * Initiates the startup of the Service since we have made sure
          * that there isn't any other instance of the Service running.
         public void startup();
          * Notifies the Service that the application has been invoked again in
          * case the running instance wants to react to such an event.  Most GUI
          * applications will just bring themselves to the front while background
          * services will maybe just want to re-scan their configuration files or
          * just ignore the event.
         public void invoke();
          * Initiates the shutdown of the Service since we've received
          * a shutdown request from one of the two supported means of
          * shutting down.
         public void shutdown();
    DuplicateInstanceException.java
    public class DuplicateServiceException extends Exception {
          * serialVersionUID?  Bah. Eclipse generates one automatically so why not...
         private static final long serialVersionUID = 3929576386522489749L;
         public DuplicateServiceException() {
              super();
         public DuplicateServiceException(String msg) {
              super(msg);
    Service.java
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.net.BindException;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.net.UnknownHostException;
    * The same way a graphical application is running as long as there
    * is something to display, a background service will run as long as
    * there is an active Thread.
    * A service can be terminated in different ways.  First of all, it
    * can be terminated through its normal flow of execution.  On the
    * other hand, it is possible to provoke the termination of a Service
    * externally.
    * To terminate the service through the normal flow, just call the
    * Service.shutdown() method.  Another way to terminate the service
    * is to start a new instance of the program with the Stop command.
    * This Service implementation will behave according to two system
    * properties.  The property Service.Command can be set to "start"
    * or "stop".  When set to "start", the Service will make sure there
    * isn't another instance of the service already running.  If it is
    * the case, a DuplicateServiceException will be thrown.  In the
    * other case, the Service will start.  When the "stop" command is
    * invoked, the Service will attempt to stop a running instance of
    * the Service.  The other property is Service.Port and it defines
    * the Port number which will be used to support the functionalities
    * offered by the Service class.
    * It is recommended to set these properties as command line arguments
    * when launching the application.  Moreover, batch files or shell
    * scripts can be created for invoking the start and stop commands.
    * @author Gabriel Aubut-Lussier
    public class Service implements Runnable {
         public final static String START_COMMAND = "start";
         public final static String STOP_COMMAND = "stop";
         public final static String SERVICE_COMMAND = "Service.Command";
         public final static String SERVICE_PORT = "Service.Port";
         private final static String GREETING = "Greetings";
         private final static String QUERY = "?";
         private final static String ACCEPT = "yes";
         private final static String DECLINE = "no";
         private final static String SHUTDOWN = "shutdown ";
         private final static int SO_TIMEOUT = 100;
          * This is the application-specific String
         private String serviceClass;
          * This is the command which we will execute when start() is invoked
          * The value is either "start" or "stop"
          * This value can be configured using the System property: Service.Command
         private String serviceCommand;
          * This is the port which is used to watch for duplicate instances
          * This value can be configured using the System property: Service.Port
         private int servicePort;
         private Serviceable service;
         private ServerSocket serviceListener;
         private Thread serviceThread;
          * Creates a new service registering the hooks required to perform
          * clean termination sequences.
          * @param s A Serviceable class
          * @throws DuplicateServiceException If there is a duplicate instance running
         public Service(Serviceable s) throws DuplicateServiceException {
              service = s;
              serviceClass = s.getClass().toString();
              serviceCommand = System.getProperty(SERVICE_COMMAND);
              String servicePortString = System.getProperty(SERVICE_PORT);
              if(servicePortString == null)
                   servicePort = -1;
              else
                   servicePort = Integer.parseInt(servicePortString);
          * Try running this new Service instance if there isn't one
          * already running.
          * @throws DuplicateServiceException if another service instance is already running.
          * @throws BindException if another application is using the configured port.
         public void start() throws DuplicateServiceException, BindException {
              if(serviceCommand == null || servicePort < 0 || servicePort > 65535) {
                   throw new IllegalArgumentException("The command and port number must be specified.");
              if(serviceCommand.equals(START_COMMAND)) {
                   try {
                        serviceListener = new ServerSocket(servicePort);
                        serviceThread = new Thread(this);
                        serviceThread.start();
                        service.startup();
                   } catch(BindException e) {
                        queryOtherInstance();
                        throw e;
                   } catch(IOException e) {
                        e.printStackTrace();
              } else if(serviceCommand.equals(STOP_COMMAND)) {
                   shutdown();
          * Send the shutdown command to the running instance of the application.
         public boolean shutdown() {
              boolean shutdownSuccessful = false;
              try {
                   Socket sock = new Socket("localhost", servicePort);
                   sock.setSoTimeout(SO_TIMEOUT);
                   //If the greeting doesn't match, it's not a duplicate instance
                   //and we can't shut it down
                   InputStreamReader in = new InputStreamReader(sock.getInputStream());
                   OutputStreamWriter out;
                   if(receivedGreeting(in)) {
                        //Sending the shutdown command
                        out = new OutputStreamWriter(sock.getOutputStream());
                        out.write(SHUTDOWN + serviceClass);
                        out.flush();
                        //Read the confirmation
                        char cBuf[] = new char[1024];
                        int amount = in.read(cBuf);
                        String confirmation = new String(cBuf, 0, amount);
                        if(confirmation.equals(ACCEPT)) {
                             shutdownSuccessful = true;
                        out.close();
                   //Closing the connection
                   in.close();
                   sock.close();
              } catch (UnknownHostException e) {
                   //This exception shouldn't happen unless the loopback address doesn't exist?
              } catch (IOException e) {
                   //This exception may occur when trying to stop a service which wasn't running.
                   //There is no need to do anything in this case.
              return shutdownSuccessful;
          * Reads the greeting from the running instance we are interacting with.
          * @param in An InputStreamReader built on the Socket's InputStream
          * @return True if we received the expected greeting, false otherwise
          * @throws IOException if a problem occurs while receiving the greeting
         private boolean receivedGreeting(InputStreamReader in) throws IOException {
              //Reading the expected greeting from the server
              char cBuf[] = new char[1024];
              int amount = in.read(cBuf);
              String greeting = new String(cBuf, 0, amount);
              return greeting.equals(GREETING);
          * While the Service is running, it listens on a port to make sure no
          * other instance of this Service is started and to listen to shutdown
          * commands.
         public void run() {
              boolean keepGoing = true;
              while(keepGoing) {
                   Socket sock;
                   InputStreamReader in;
                   try {
                        sock = serviceListener.accept();
                        sock.setSoTimeout(SO_TIMEOUT);
                        //Sending a greeting
                        OutputStreamWriter out = new OutputStreamWriter(sock.getOutputStream());
                        out.write(GREETING);
                        out.flush();
                        //Reading the incoming message
                        in = new InputStreamReader(sock.getInputStream());
                        char cBuf[] = new char[1024];
                        int amount = in.read(cBuf);
                        String message = new String(cBuf, 0, amount);
                        //Writing an answer
                        boolean invoked = message.equals(serviceClass + QUERY);
                        if(invoked) {
                             out.write(ACCEPT);
                        } else {
                             out.write(DECLINE);
                             keepGoing = !message.equals(SHUTDOWN + serviceClass);
                        out.flush();
                        //Closing the connection
                        out.close();
                        in.close();
                        sock.close();
                        //Notify the running application is there has been an invocation
                        if(invoked) {
                             service.invoke();
                   } catch (IOException e) {
                        //Seems like an IO operation failed.  Let's just forget about
                        //this connection attempt and wait for another
              //Shutdown the Service
              service.shutdown();
              try {
                   serviceListener.close();
              } catch(IOException e) {
                   //Couldn't close the serverSocket upon shutdown?
                   //weird... but anyhow...
          * Connects to the configured port to check out wether it is a duplicate
          * instance of the application or if it is another application using the
          * same port number.  If it is another application, nothing will happen.
          * @throws DuplicateServiceException if it is a duplicate instance
         private void queryOtherInstance() throws DuplicateServiceException {
              try {
                   Socket sock = new Socket("localhost", servicePort);
                   sock.setSoTimeout(SO_TIMEOUT);
                   //Read greeting
                   InputStreamReader in = new InputStreamReader(sock.getInputStream());
                   String answer = null;
                   if(receivedGreeting(in)) {
                        //Writing the application-specific query
                        OutputStreamWriter out = new OutputStreamWriter(sock.getOutputStream());
                        out.write(service.getClass().toString() + "?");
                        out.flush();
                        //Reading the answer
                        char[] cBuf = new char[3];
                        int amount = in.read(cBuf);
                        answer = new String(cBuf, 0, amount);
                        out.close();
                   //Closing the connection
                   in.close();
                   sock.close();
                   //If the answer is "yes" then it is a duplicate
                   if(answer != null && answer.equals("yes")) {
                        throw new DuplicateServiceException("An instance of the service is already running.");
              } catch (UnknownHostException e) {
                   //This exception shouldn't happen unless the loopback address doesn't exist?
              } catch (IOException e) {
                   //If we fail to query the application appropriately we consider
                   //it isn't a duplicate entry so we do nothing.
         public String getServiceCommand() {
              return serviceCommand;
         public void setServiceCommand(String serviceCommand) {
              this.serviceCommand = serviceCommand;
         public int getServicePort() {
              return servicePort;
         public void setServicePort(int servicePort) {
              this.servicePort = servicePort;
    Main.java
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.net.BindException;
    import javax.swing.JFrame;
    public class Main implements Serviceable {
         private JFrame window;
         private Service service;
         public static void main(String[] args) {
              new Main();
         public Main() {
              try {
                   service = new Service(this);
                   service.start();
              } catch(DuplicateServiceException e) {
                   e.printStackTrace();
              } catch(BindException e) {
                   e.printStackTrace();
         public void startup() {
              window = new JFrame("SERVICE TEST! :D");
              window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              window.addWindowListener(new WindowAdapter() {
                   public void windowClosed(WindowEvent e) {
                        service.shutdown();
              window.setVisible(true);
         public void shutdown() {
              System.out.println("Application shutdown");
              window.dispose();
         public void invoke() {
              System.out.println("Another instance tried to startup");
              window.toFront();
    }

  • How to make Exit button for Out-of-browser application

    Greetings all,
    This sounds so simple, yet I can't find anything about it.  I want to make an Exit button in a Silverlight 4 Out-of-browser application.  When the user clicks the button, the application is to quit or close or exit.  (The same effect as if the user clicks
    the red X icon in the upper right-hand corner of a window.)
    Any ideas will be appreciated.

    Jonathan --
    Yes, the word Page has taken on many meanings in the last 15 years.  I'll clarify.  When I make a simple Silverlight OOB (out-of-browser) application using Visual Studio 2010, I ask Visual Studio to Add New Item, then choose Silverlight Page.  Let's
    say I name it Page2.xaml.
    By default VS2010 already made another page for me, MainPage.xaml.
    Now, here is my need:  On the page called MainPage.xaml, I want to place a large button that says Exit Application.  When the user clicks that button, I want the application to end and the entire window to close.  This is the standard behavior in most traditional Windows
    applications, for example in Microsoft Word or Microsoft Excel or Microsoft Access.  In any of those traditional applications, the user can, from the menu, choose File/Exit.  If he does, then not only does the application quit, but also the window
    closes itself.  The user doesn't have to click the small red X icon in the upper right corner. 
    That simple behavior of almost all traditional Windows applications, large and small, is what I'm looking for in my simple Silverlight
    OOB applications:  An Exit command that quits the application and closes the window itself.
     Sorry for the confusion.  I really appreciate your help.  Any ideas?

  • Corresponding BAPIs for the respective Webdynpro applications

    Hi All,
    We are on EP7,ECC 6, ESS BP1.2 enhancement package. Configured the NWDI and how do we know which BAPI is being called.
    Scenario:
    In the Bank Information application,
    User can perform three actions : Enter, change and delete the bank details.
    First we need the list of BAPI’s through which this three feature are called by the WDP application.
    ( When ever there some modifications are done in the application, here they are goin to create a ZBapi which is goin to trigger a workflow… and send the notification for approval of mail to his manager)
    Second : once this operations are done , user clicks on save( or any submit button ) it should prompt a message saying “ Information sent for approval “ instead of “ Data saved”
    Guide me what needs to be done here …
    Thanks,
    NR

    Dear Nazeer,
    As suggested by Chris, follow the steps using system trace st01.
    Select the Trace components (RFC Calls etc), Click on general filters ->>> trace on for the user which you would test ESS application.
    Hope your Basis Guy can help you better.
    Regards,
    Anil Kumar

  • How to add bookmark button for user to access application

    I would like to add a button that will be an 'ADD BOOKMARK' concept for the user so that they don't try to save the url that is generated at the time they run the application.
    I am using Apex 4.0.
    Is anyone familiar with this concept?
    I see it a lot on the internet with other websites.
    Thanks,
    Maggie

    This post is made for the future Apex users that need this info.
    I discovered a fantastic website that helped me generate the code needed for my apex page to add a bookmark link. This website is:
    http://www.webmaster-affiliates.net/bookmark-site_doit.php
    This was my code used (be sure to replace the curly brackets with a pointed less than/greater than bracket):
    {div align=right}{a href="javascript:window.external.AddFavorite('http://your.url.goes.here:7780/pls/apex/f?p=Graphics_Status', 'Graphics Status')"}Bookmark Site{a}{div}
    I created a page region and put the above code in the source field. Worked fantastic.
    Maggie
    Edited by: mjhamilton on Sep 2, 2010 7:59 AM

  • Use of multiple Applications for single webdynpro component in ABAP WEB DYNPRO

    I am working on a object which have multiple webdynpro applications for single webdynnpro component.How to assign a different functionality to each application bcoz when we right click on webdynnpro component and select create webdynpro applications ,it just creates a application how so we assign diff functionality to each of them .Also in the parameter tab of the webdynpro applications ,there is a diff config id mentioned for each application.what is its relavance

    Hi Sam,
    Different functionalities for a single webdynpro component can be achieved by many ways. Among them is the use of multiple applications. Say for example if you want different views/windows to be displayed at the start up, you can achieve it by specifying at the default window, for each every webdynpro application.
    And if you want control the fields, say for example you want to display input fields as editable for one application and read only for other application, you can achieve it through application parameters. Based on parameters, in HANDLEDEFAULT method of window controller , you can specify the type of behaviour , whether it has to editable or not based on parameters and same can be used at context binding of UI properties. 
    Application configuration can be used for personalization.Web Dynpro ABAP Application Configuration. This tutorial would help you understanding the concept much better. There can be multiple application configurations for a single application.
    Regards,
    Harsha

  • Error while configuring Debugging for WebDynpro Application

    Hi Experts,
    I am trying to configure Portal server for debugging a WebDynpro application.
    In NWDS , in Debug configuration
    When i tried to add my Webdynpro Project and application under Debug tab , No problem.
    But when i checked J2EE Engine tab : it showed the following error.
    <b>[J2EE Engine]: the selected server node does not run  in restricted load balancing mode, please configure it correctly so that the URL extention can be used</b>
    And ignoring it when i started debugging the application , the URL was formed like this :
    http://<host>:50000/@@@DEBUG@@@7672950/webdynpro/dispatcher
    /local/WDtest/WDtest?SAPtestId=1
    with the error :   The requested resource does not exist.
    Details: Go to main page of this application!
    Can anybody help me to fix the configuration.
    Regards,
    Ashish Shah

    Hi,
    To configure to the debugging mode... follow the steps:
    1. Select "SDM" from J2EE engine (To get this view navigate thru Window--> Show View --> J2EE Engine)
    2. Make a right click on "SDM" and choose "Enabling Debugging of Process"
    3. Now, Navigate to Run --> Debug --> Select your Project as "Webdynpro Application" and click "new" button
    4. Now give some name and Click BROWSE to select ur project and then click APPLY and DEBUG
    Or if u use 2004s, then u can do the settings in Portal itself...which gives u more clear information...  follow the link
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0cb32c5-36a7-2910-2c9b-ba4a5bbdbb56">WebDynpro Java Debug Configurator</a>
    Hope it helps...
    Regards / Guru

  • How to create an iview for ABAP Webdynpro Application in Portal?

    HI,
    I am Webdynpro Java webdynpro developer.
    I want to create an IVIEW for an ABAP Webdynpro application in the enterprise portal.

    The process is almost exactly the same as creating a Web Dynpro Java iView. You simply chose the ABAP instead of the Java radio button when you reach that step in the Web Dynpro iView creation process.  There is a video on the topic here:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/eae111e7-0b01-0010-6cb7-e0dd2bfbfa7a
    You can also read about the process in the online help:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/1d/e4a34273f60b31e10000000a1550b0/frameset.htm

Maybe you are looking for

  • ADDING CONTACTS TO ADDRESS BOOK SERVER!!!!!!!!!

    Can someone please help me figure out how to add contacts to the address book server. I tried to drag my contacts but it doesn't work. There is no "+" button for me to add new contacts. I've been trying for a couple days and nothing. Thank you in adv

  • The music sound from my i pod is muffled through my headphone.. does the headphone jack need replacing

    Iv had my ipod for few years.. now the sound through the headphone is muffled i brought new ones but the sound is still the same.. does the headphne jack need changing and how much will it cost ?

  • JSP Tags in JSPX

    I have been using jsp tags (.tag) in my JSF-JSPs to reuse components. As I have seen, Oracle recommends using .jspx instead of .jsp, so in my way to create a new application using jspx I found that I can not make the jsp tag work (using jspx and tagx

  • Print prview for goods issue

    hi all, how can i see the print preview for goods issue? regards, satheesh

  • Really bad image quality on iPhone 6

    I took a photo using my iPhone 6 of some kit that I needed to be able to identify later on. I was looking at the photo today and the fine detail is unreadable, it looks like some kind of pixelating filter has been applied to the image. Does the attac