The following sample program got empty display , why?

import pool.ConnectionPool;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import javax.sql.*;
public class Update extends HttpServlet {   
    Statement stmt = null;
    ResultSet rs = null;
    Connection conn = null;
ConnectionPool connectionPool = null;
* Creates a connection pool.
public void init() throws ServletException
String jdbcDriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String dbURL ="jdbc:microsoft:sqlserver://localhost:1433; DatabaseName=pubs";
try
//instantiate the connection pool object by passing the
//jdbc driver, database URL, username, and password
connectionPool = new ConnectionPool(jdbcDriver, dbURL,
"test","1234");
//specify the initial number of connections to establish
connectionPool.setInitialConnections(5);
//specify number of incremental connections to create if
//pool is exhausted of available connections
connectionPool.setIncrementalConnections(5);
//specify absolute maximum number of connections to create
connectionPool.setMaxConnections(20);
connectionPool.createPool(); //create the connection pool
catch(Exception e)
System.out.println("Error: " + e);
/** Destroys the servlet.
    public void destroy() {
    public void doGet(
    HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException {  
       }// end of DoGet
  public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
     res.setContentType("text/html");
    PrintWriter out = res.getWriter();
    PreparedStatement ps = null;
      try{
            String myName= req.getParameter("uname");             
             String password =req.getParameter("oldpassword");
             String Npassword =req.getParameter("pas1");          
            String ErrMsg = "";
              //get free connection from pool
         conn =connectionPool.getConnection();
             stmt = conn.createStatement(
                       ResultSet.TYPE_SCROLL_SENSITIVE,
                       ResultSet.CONCUR_READ_ONLY);
         rs = stmt.executeQuery("select * FROM users where Name='"+myName+"' and password='"+password+"'" );
              int count =0;//how many rows we can find.
              while (rs.next()){
                  count++;
           if(count<1){
                     ErrMsg ="UserName and Password are not there, can't update !";
                    HttpSession userSession = req.getSession(true);           
                    userSession.setAttribute("ErrMsg", ErrMsg);
                      RequestDispatcher disp;
                    disp = getServletContext().getRequestDispatcher("/secure/UpdateError.jsp");
                    req.setAttribute("ErrMsg",ErrMsg);
                   disp.forward(req, res);
         else{
            conn.setAutoCommit(false);
                   Statement stmt = conn.createStatement();
             String sql ="UPDATE users SET password='"+Npassword+"' where Name='"+myName+"'and password='"+password+"'";
                     ps = conn.prepareStatement(sql);            
                      ps.executeUpdate();                    
           conn.commit();
           conn.setAutoCommit(true);
         //get current session, create if it doesn't exits
           HttpSession userSession = req.getSession(true);
           userSession.setAttribute("Name", myName);
           userSession.setAttribute("Password", Npassword);
       RequestDispatcher disp;
       disp = getServletContext().getRequestDispatcher("/secure/update.jsp");
       req.setAttribute("Name", myName);
       req.setAttribute("password", Npassword);
       disp.forward(req, res);
      }// end else
    }//end try
   catch(SQLException e) {
     finally {
      try {
        if(rs != null)
          rs.close();
          rs = null;
        if(stmt != null)
          stmt.close();
          stmt = null;
        if(conn != null)
          conn.close();
          conn = null;
      } //end try
    catch (SQLException e) {}   
  }//end finally
} // end doPost
public String getServletInfo()
    return "A Simple Servlet";
}// end of ContrUpdate
       jsp
<%@ page buffer="16kb"%>
<html>
<head>
<title>NewMember</title>
<body >
<center>
<h3> Welcome Back,<%= request.getAttribute("Name")%></h3>
<h3> you are new information on our Login table are... you can use these userName and Password to login</h3>
<table width="63%" border="1" align="center" >
<tr>
<th  bgcolor="#ffffcc" width="26%">UserName: </th>
<td><%= request.getAttribute("Name") %></td>
</tr>    
<tr>
  <th bgcolor=#ffffcc width="26%">Password: </th>
   <td><%= request.getAttribute("password") %> </td>
</tr>
</table>
</center>
</body>
</html>

There are a lot of try and forget blocks.
catch (SQLException e) {}   
  }within your code.
You should at least log the Exception, better would be to rethrow the Exception and display an ErrorPage.
You may not close the connection within the finally block
if(rs != null)
          // when a Exception occurs here neither the statement nor the
         // connection will be closed.
          rs.close();
          rs = null;
        if(stmt != null)
          stmt.close();
          stmt = null;
        if(conn != null)
          conn.close();
          conn = null;
        }If the creation of the Connection Pool fails your doPost Method will throw a NullPointerException becauseconnectionPool is null.
Your init Method should throw an Exception in this case.
You use a PreparedStatement but you don't use Parameters
   String sql ="UPDATE users SET password='"+Npassword+"' where     Name='"+myName+"'and password='"+password+"'";
                     ps = conn.prepareStatement(sql);            
                      ps.executeUpdate();                 
// should be
   final String sql ="UPDATE users SET password=? where Name=? and password=?";            
                     ps = conn.prepareStatement(sql);            
                     ps.setSring(1, Npassword);
                     ps.setString(2,myName);
                     ps.setString(3, password);
                      ps.executeUpdate();                 

Similar Messages

  • When using private browsing to view image results in Safari 5.1.3, only the first two rows of results are visible, the following four or so rows display greyed out place holders, and the safe search button is inoperable. Suggestions?

    When using private browsing to view image results in Safari 5.1.3, only the first two rows of results are visible, the following four or so rows display greyed out place holders, the remainder of the results page is blank, and the safe search button is inoperable. When I turn off private browsing and refresh the page, everything works again.
    Anyone else having this problem?

    I have got the same behaviour after the last Safari Update to 5.1.3. It seems that Safari now handles some scripts in a new way. If you debug the Google Website, you will see, that there is some Javascript Error, that seems to prevent to write into local cache. After some searching I wasn't able to finde a solution for this problem, other then disabling Javascript while private browsing to prevent the script loading. You then are able to use Google with the old layout. The option to disable JavaScript can be found in the Menu "Developer", wich has to be enabled in Safari in the options first.
    In my opinion this is a bug that is now occuring, because Apple changed something in private browsing and that has to be fixed by Google now, to run again. Or we will have to wait for 5.1.4, as you can read online Apple will change and bugfix the javascript engine in that version, perhaps this fixes the problem as well. I hope so!
    If anyone is in the developer program perhaps you could test this with the beta of 5.1.4 and tell us if it works.

  • The following remoteapp program is not in the list of authorized programs.

    Hi,
    Iam in a pickle at the moment.
    My RDS 2012 R2 environment was working successfully previously, arrived from holiday and it is not longer working.
    My setup:
    **RDS01 ( Session Host and Connection Broker Roles )
    **RDS02 ( Web Access, Gateway and Licencing Roles)
    The Problem i am facing is, after successfully login to the RDWeb page, lunching the remoteapp i get the following:
    1st Get Certificate mismatch ( name in the certificate RDS02.mycompany.local is not trusted )
    2nd Hit YES and the following message "Windows cannot start the RemoteApp program. The following RemoteApp program is not in the list of authorized programs: WinWord"
    It happens whether i do connect externally.
    Internally the SSO does not work ( i did check my certificate and it is installed )
    If i run the script Set-RDPublishedName and change it from remote.mycompany.com to RDS01.mycompany.local
    1st Certificate name mismatch ( requrested pc RDS01, name in the certficate remote.mycompany.com )
    2nd Hit Yes and the app works
    It happens whether i do connect internally or externally.
    Any help will be very appreciated.
    cheers
    Elton

    Hi Elton,
    It sounds like the DNS lookup is resolving to the wrong ip address.  When the RD Gateway (RDS02) looks up remote.yourcompany.com to connect to your broker/RDSH it should resolve to the ip address of RDS01, but it appears it is resolving to RDS02 instead.
    I recommend you use Set-RDPublishedName to change the name back to what is was before (remote.yourcompany.com) and verify that your DNS settings are correct.  For example, if you log on to RDS02 and try to ping remote.yourcompany.com it should try to
    ping the internal ip address of RDS01, since that is your connection broker.
    -TP

  • Has the ipad 3rd gen got retina display?

    Has the ipad 3rd gen got retina display?

    Yes, the iPad 3 and the iPad 4 both have a 2048 × 1536 pixel screen (the iPad 1 and 2 have 1024 x 768)

  • Has anyone here gotten an email that contains the following? I got it (I don't think is legit) that's why I'm asking in here, thanks for any response I get.

    THis is the complete email I got:
    Dear Customer, We need to ask you to complete a short and brief step to securing and validating your account information.  
    Click here to complete validation 
    Failure to complete our validation process will result in a suspension of your Apple ID. We take every step needed to automatically validate our users, unfortunately in your case we were unable to. The process only takes a couple of minutes and will make sure there is no interruption to your account. 
    Wondering why you got this email?
    This email was sent automatically during routine security checks. We are not completely satisfied with your account information and require you to update your account to continue using our services uninterrupted. For more information, see our FAQ. Thanks,
    Apple Customer Service
    Copyright © 2014 Apple Inc. Apple Inc., Infinite Loop, Cupertino, CA 95014 Company Registration number: 15719. VAT number: IE6554690W

    It's a phishing attempt to get your account and payment info, Apple send emails like that (accounts aren't 'suspended', the English in it is poor, it's not a personalised email, and the links don't take you to an Apple site). You could forward the email to Apple : [email protected]

  • I've updated to FF26 and get the follow error message "Secure Connection Failed" why is that?

    ever since I've updated to FF26 some of the sites won't come up and show the following error message:
    Secure Connection Failed
    An error occurred during a connection to www.facebook.com. SSL peer rejected a handshake message for unacceptable content. (Error code: ssl_error_illegal_parameter_alert)
    The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
    Please contact the website owners to inform them of this problem. Alternatively, use the command found in the help menu to report this broken site.
    it does not happens all the time but most of the times.
    this also occurs on google.com, twitter.com and many more.
    what to do?

    Do you have the option to turn off the feature of Kaspersky scanning your SSL traffic? Usually that can be turned off (e.g., in ESET and BitDefender).

  • Print Preview of Sample Program LP01 not displaying form

    Hey,
    I have successfully configured ADS in NW2004s ABAP stack.
    I ran the FP_PDF_TEST_OO program which checks the ABAP Adobe configuration and displays the version number of Adobe document.
    The problem however is when I implement the sample " Part I: Adobe Print Forms" given on the site https://www.sdn.sap.com/irj/sdn/interactiveforms.
    When I run the program and do a Print Preview of the form, with the default printer LP01, I do not see a PDF as mentioned in the sample. The control returns to the start page. Also, the download button on the screen results in a PDF that has 0 bites.
    During the debugging, data from the database gets retrieved properly, and the correct function name gets retrieved. Would you guys know what I might be missing.
    Thank you for the help.
    Sumit.
    I did the interface, form, and building the context several times and that seems fine.
    Attached is the code:
    REPORT  ZTSA_EMPLOYEE_ADS_REPORT.
    parameter: i_empid type ZTSA_employee-employeeid obligatory.
    type-pools: abap.
    start-of-selection.
    data: ie_outputparams type sfpoutputparams.
    call function 'FP_JOB_OPEN'
    changing
    ie_outputparams = ie_outputparams.
    try.
       data: i_name type fpname,
       i_funcname type funcname.
       i_name = 'ZTSA_EMPLOYEE_FORM'.
       call function 'FP_FUNCTION_MODULE_NAME'
       exporting
         i_name = i_name
       importing
         e_funcname = i_funcname.
         catch cx_fp_api_repository.
         catch cx_fp_api_usage.
         catch cx_fp_api_internal.
    endtry.
    data: isemployee type ZTSA_EMPLOYEE_STRUCT.
    select *
    into corresponding fields of isemployee
    from ZTSA_EMPLOYEE
    where employeeid = i_empid.
    endselect.
    data: fp_docparams type sfpdocparams.
    data: fp_formoutput type fpformoutput.
    call function i_funcname
    exporting
    /1bcdwb/docparams = fp_docparams
    employee = isemployee
    importing
    /1bcdwb/formoutput = fp_formoutput
    exceptions
    usage_error = 1
    system_error = 2
    internal_error = 3.
    call function 'FP_JOB_CLOSE'
    exceptions
    usage_error = 1
    system_error = 2
    internal_error = 3
    others = 4.

    Hi,
    May be this link this be helpful...
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/how%20to%20troubleshoot%20the%20render%20exception.pdf
    Regards,
    <i><b>Raja Sekhar</b></i>

  • The following block is giving an exception.why?

    DECLARE
    TYPE typ_tab_oid IS TABLE OF ncs_domain.sco_item_results.OID%TYPE;
    v_tab typ_tab_oid;
    CURSOR cur_oid
    IS
    SELECT OID
    FROM ncs_domain.sco_item_results sir
    WHERE sir.is_total = 'Y';
    v_error_code number(10);
    v_error_mesg varchar2(4000);
    BEGIN
    OPEN cur_oid;
    LOOP
    FETCH cur_oid
    BULK COLLECT INTO v_tab LIMIT 1000;
    FORALL i IN 1 .. v_tab.COUNT
    DELETE FROM ncs_domain.sco_item_results_bkp sir
    WHERE sir.OID = v_tab (i);
    EXIT WHEN cur_oid%NOTFOUND;
    END LOOP;
    CLOSE cur_oid;
    EXCEPTION
    WHEN OTHERS
    THEN
    v_error_code:=sqlcode;
    v_error_messg:=sqlerrm;
    insert into my_error_log values()
    raise_application_error (-20001, v_error_code||''||v_error_messg);
    END;
    exception that i am getting is ora-30036: unable to extend segment by 8 in undo tablespace........
    why??
    also prior to script i had no index on the column is_total of table ncs_domain.sco_item_results
    when i ran the scipt it gave the output in approx 3 hrs.
    once i created bitmap index on the column is_total and it is taking 5 hrs.
    SAD Part is that even after 5hrs i get an exception that no space in undo tablespace(mentioned above).
    How do i handle this exception.??I am a user.Dont have any sys previliges also.
    Can saomebody help in improving the perfomace of the script..
    The script is basically deleting approx 10,000,000 records.

    Hi.
    Following is the sript of the table.
    It already includes nologging clause.
    CREATE TABLE SCO_ITEM_RESULTS_BKP
    OID VARCHAR2(32 CHAR) NOT NULL,
    TEST_ID NUMBER(22,10),
    STUDENT_OID VARCHAR2(32 CHAR),
    TEST_TYPE VARCHAR2(32 CHAR),
    CUSTOMER_ID NUMBER(9) NOT NULL,
    SCORED_DATE DATE,
    STATUS VARCHAR2(50 CHAR),
    SCORE_VALUE VARCHAR2(10 CHAR),
    SCORE_MIN VARCHAR2(10 CHAR),
    SCORE_MAX VARCHAR2(10 CHAR),
    NUM_ATTEMPTS NUMBER(22,4),
    ITEM_ID NUMBER(22,10),
    ASSIGNMENT_OID VARCHAR2(32 CHAR),
    AUTH_LEVEL_ENTITY_ID NUMBER(10),
    SESSION_ID NUMBER(22,10),
    CREATEDBY_OID VARCHAR2(32 CHAR),
    UPDATEDBY_OID VARCHAR2(32 CHAR),
    CREATEDATE DATE,
    UPDATEDATE DATE,
    ORIGINTYPECD_OID VARCHAR2(32 CHAR),
    OWNER_ORGUNIT_OID VARCHAR2(32 CHAR),
    APPLICATION_VERSION VARCHAR2(32 CHAR) NOT NULL,
    INACTIVESTATUS CHAR(1 CHAR) NOT NULL,
    ISDELETED CHAR(1 CHAR) NOT NULL,
    JOB_ID VARCHAR2(32 CHAR),
    TESTRESULTS_OID VARCHAR2(32 CHAR),
    FORM_ID NUMBER(10),
    IS_TOTAL CHAR(1 CHAR),
    STUDENT_PERSON_OID VARCHAR2(32 CHAR)
    TABLESPACE BASE_DATA
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOLOGGING
    NOCACHE
    NOPARALLEL
    MONITORING;
    Edited by: user8731258 on Nov 25, 2009 8:16 PM

  • I am running MAC and when I try to open lightroom5, I am getting the following: "This program must be run under Win32" The download link says WIN /MAC. I have no other option.

    What can I do so that I can download this to my MAC?

    Lightroom - all versions
    Windows
    http://www.adobe.com/support/downloads/product.jsp?product=113&platform=Windows
    Mac
    http://www.adobe.com/support/downloads/product.jsp?product=113&platform=Macintosh

  • I have created the controlfile while opening the following error is got

    SQL> ALTER DATABASE OPEN RESETLOGS;
    ALTER DATABASE OPEN RESETLOGS
    ERROR at line 1:
    ORA-01194: file 11 needs more recovery to be consistent
    ORA-01110: data file 11: '/oracle/u01/testdb/oradata/testdb/dati_pms01'
    SQL> recover database using BACKUP CONTROLFILE until cancel;
    ORA-00279: change 37911539 generated at 12/22/2006 12:29:28 needed for thread 1
    ORA-00289: suggestion : /oracle/u01/app/oracle/product/9.2.0/dbs/arch1_117.dbf
    ORA-00280: change 37911539 for thread 1 is in sequence #117
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    AUTO
    ORA-00308: cannot open archived log
    '/oracle/u01/app/oracle/product/9.2.0/dbs/arch1_117.dbf'
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    ORA-00308: cannot open archived log
    '/oracle/u01/app/oracle/product/9.2.0/dbs/arch1_117.dbf'
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01194: file 11 needs more recovery to be consistent
    ORA-01110: data file 11: '/oracle/u01/testdb/oradata/testdb/dati_pms01'

    RESTORE ARCHIVE LOGS THEN USE
    sql>recover AUTOMATIC database using BACKUP CONTROLFILE until cancel;
    THEN OPEN WITH RESETLOGS

  • About HR-ABAP Sample program.

    Hi,
    I am new to SAP.I wanna know about basics about HR-ABAP can any one help me to get very basic ideas in HR-ABAP.
    Thanks,
    Sakthi.

    HR deals with the INFOTYPES which are similar to Tables in General ABAP.
    There are different ways of fetching data from these infotypes.
    There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
    Infotypes for these areas are different from one another area.
    storing of records data in each type of area is different
    LDBS like PNP are used in HR programing.
    Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
    and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
    On the whole Normal ABAP is different from HR abap.
    For Personal Admn the Infotypes start with PA0000 to PA1999
    Time Related Infotypes start with PA2000 to PA2999.
    Orgn related Infotypes start with HRP1000 to HRP1999.
    All custom developed infotypes stsrat with PA9000 onwards.
    In payroll processing we use Clusters like PCL1,2,3 and 4.
    Instead of Select query we use PROVIDE and ENDPROVIDE..
    You have to assign a Logical Database in the attributes PNP.
    Go through the SAp doc for HR programming and start doing.
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    sites regarding hr-abap:
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    You can see some Standard Program examples in this one ...
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    These are the FAQ's that might helps you as well.
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.atomhr.com/library_full.htm
    HR Long texts Upload
    Look at the below link
    BDC - hr maintain text
    Please refer to the following sample program for accessing PCH LDB.
    For concept to start with refer url:
    http://www.sap-press.de/download/dateien/860/sappress_mysap_hr_technical_principles2.pdf
    It contains info regarding PCH Reporting.
    REPORT zhsol010.
    TABLES: objec, gdstr.
    INFOTYPES: 0002, 0006, 1003.
    DATA: stabs LIKE p1003-stabs,
    name LIKE p0001-ename.
    INITIALIZATION.
    pchotype = 'O'.
    pchwegid = 'O-S-P'.
    GET objec.
    IF objec-otype = 'S'.
    CLEAR stabs.
    LOOP AT p1003 WHERE begda LE pc-endda
    AND endda GE pc-begda.
    IF p1003-stabs = 'X'.
    stabs = 'X'.
    WRITE : / objec-objid, objec-short, objec-stext.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF objec-otype = 'P' AND stabs = 'X'.
    PROVIDE vorna nachn FROM p0002
    subty telnr FROM p0006
    BETWEEN pc-begda and pc-endda
    WHERE p0006-subty = '1'.
    IF p0006_valid = 'X'.
    CONCATENATE p0002-vorna p0002-nachn INTO name
    SEPARATED BY space.
    WRITE: / name, p0006-telnr.
    SKIP.
    ENDIF.
    ENDPROVIDE.
    ENDIF.
    <b>sample code:</b>
    REPORT zpwtest .
    TABLES : t001 .
    TYPE-POOLS slis .
    DATA : t_t001     TYPE TABLE OF t001        ,
           t_abaplist TYPE TABLE OF abaplist    .
    DATA : w_abaplist TYPE abaplist .
    SELECT-OPTIONS : s_bukrs FOR t001-bukrs OBLIGATORY .
    PARAMETERS     : p_list  TYPE c NO-DISPLAY .
    START-OF-SELECTION .
      IF sy-batch = 'X' AND p_list IS INITIAL .
      Submit report and get list in memory
        SUBMIT zpwtest EXPORTING LIST TO MEMORY
                       WITH s_bukrs IN s_bukrs
                       WITH p_list = 'X'
                   AND RETURN.
      Get the list from memory.
        CALL FUNCTION 'LIST_FROM_MEMORY'
             TABLES
                  listobject = t_abaplist
             EXCEPTIONS
                  not_found  = 1
                  OTHERS     = 2.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      Send report to mail receipent
        PERFORM send_mail .
      ELSE.
        PERFORM select_data .
        PERFORM display_data .
      ENDIF.
    *SO_NEW_DOCUMENT_SEND_API1
    *&      Form  select_data
    FORM select_data.
      SELECT *
        INTO TABLE t_t001
        FROM t001
       WHERE bukrs IN s_bukrs .
    ENDFORM.                    " select_data
    *&      Form  display_data
    FORM display_data.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                i_structure_name = 'T001'
           TABLES
                t_outtab         = t_t001
           EXCEPTIONS
                program_error    = 1
                OTHERS           = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " display_data
    *&      Form  send_mail
    FORM send_mail.
      DATA: message_content LIKE soli OCCURS 10 WITH HEADER LINE,
            receiver_list LIKE soos1 OCCURS 5 WITH HEADER LINE,
            packing_list LIKE soxpl OCCURS 2 WITH HEADER LINE,
            listobject LIKE abaplist OCCURS 10,
            compressed_attachment LIKE soli OCCURS 100 WITH HEADER LINE,
            w_object_hd_change LIKE sood1,
            compressed_size LIKE sy-index.
    Fot external email id
    receiver_list-recextnam = '[email protected]'.
    receiver_list-recesc = 'E'.
    receiver_list-sndart = 'INT'.
    receiver_list-sndpri = '1'.
    FOr internal email id
      receiver_list-recnam = sy-uname .
      receiver_list-esc_des = 'B'.
      APPEND receiver_list.
    General data
      w_object_hd_change-objla = sy-langu.
      w_object_hd_change-objnam = 'Object name'.
      w_object_hd_change-objsns = 'P'.
    Mail subject
      w_object_hd_change-objdes = 'Message subject'.
    Mail body
      APPEND 'Message content' TO message_content.
      CALL FUNCTION 'TABLE_COMPRESS'
           IMPORTING
                compressed_size = compressed_size
           TABLES
                in              = t_abaplist
                out             = compressed_attachment.
      DESCRIBE TABLE compressed_attachment.
      CLEAR packing_list.
      packing_list-transf_bin = 'X'.
      packing_list-head_start = 0.
      packing_list-head_num = 0.
      packing_list-body_start = 1.
      packing_list-body_num = sy-tfill.
      packing_list-objtp = 'ALI'.
      packing_list-objnam = 'Object name'.
      packing_list-objdes = 'Attachment description'.
      packing_list-objlen = compressed_size.
      APPEND packing_list.
      CALL FUNCTION 'SO_OBJECT_SEND'
           EXPORTING
                object_hd_change = w_object_hd_change
                object_type      = 'RAW'
                owner            = sy-uname
           TABLES
                objcont          = message_content
                receivers        = receiver_list
                packing_list     = packing_list
                att_cont         = compressed_attachment.
    ENDFORM.                    " send_mail
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • OCI - Sample program works on Windows but gives error in Solaris ??

    Hi,
    I am new to OCI. I was trying the following sample program:
    #include<iostream>
    #include<conio.h>
    #include<firstheader.h>
    //#include<stdafx.h>
    #include<string.h>
    using namespace std;
    class OCIClass
    public:
         OCIClass()
    int p_bvi;
    char p_sli[20];
    int rc;
    char errbuf[100];
    int errcode;
    const char *s;
    printf("Hello\n");
    string sql;
    string sql2="select substr(ename,1,3) from emp where job='ANALYST'";
    cout<<sql2;
    //char sql[512];
    int flag=0;
    sql += "SELECT * from emp where job='";
    if (flag==0)
    sql += "MANAGER";
    else
    sql += "ANALYST";
    sql += "'";
    cout<<sql + "\n";
    s=sql.c_str();
    char* cstr = new char[sql.size()+1];
    strcpy (cstr, sql.c_str());
    char* cstr2 = new char[sql2.size()+1];
    strcpy (cstr2, sql2.c_str());
    sql=" ";
    /* Initialize evironment */
    rc=OCIEnvCreate((OCIEnv **)&p_env,(ub4)OCI_DEFAULT ,(void *)0, (void * (*)(void *, size_t))0,
    (void * (*)(void *, void *, size_t))0,(void (*)(void *, void *))0,(size_t)0, (void **)0);
    /* Initialize handles */
    rc = OCIHandleAlloc( (dvoid *) p_env, (dvoid **) &p_err, OCI_HTYPE_ERROR,
    (size_t) 0, (dvoid **) 0);
    printf("Error handle allocated\n");
    rc = OCIHandleAlloc( (dvoid *) p_env, (dvoid **) &p_svc, OCI_HTYPE_SVCCTX,
    (size_t) 0, (dvoid **) 0);
    printf("service handle allocated\n");
    printf("Value of RC before Logon\n %d", rc);
    /* Connect to database server */
    rc = OCILogon(p_env, p_err, &p_svc, (OraText *)"scott", 5,(OraText *) "welcome", 7,(OraText *) "", 0);
    printf("Value of RC after Logon\n %d", rc);
    if (rc != 0) {
    OCIErrorGet((dvoid *)p_err, (ub4) 1, (text *) NULL, &errcode, (OraText *)errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR);
    printf("Error - %s\n",errbuf);
         printf("error");
    //exit(8);
         getch();
    printf("Connect successful\n");
    /* Allocate and prepare SQL statement */
    rc = OCIHandleAlloc( (dvoid *) p_env, (dvoid **) &p_sql,
    OCI_HTYPE_STMT, (size_t) 0, (dvoid **) 0);
    rc = OCIStmtPrepare(p_sql, p_err, (OraText*) cstr,
    (ub4) 37, (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT);
    /* Bind the values for the bind variables
    p_bvi = 10; /* Use DEPTNO=10
    rc = OCIBindByName(p_sql, &p_bnd, p_err, (text *) ":x",
    -1, (dvoid *) &p_bvi, sizeof(int), SQLT_INT, (dvoid *) 0,
    (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT);*/
    /* Define the select list items */
    rc = OCIDefineByPos(p_sql, &p_dfn, p_err, 1, (dvoid *) &p_sli,
    (sword) 20, SQLT_STR, (dvoid *) 0, (ub2 *)0,
    (ub2 *)0, OCI_DEFAULT);
    /* Execute the SQL statment */
    rc = OCIStmtExecute(p_svc, p_sql, p_err, (ub4) 1, (ub4) 0,
    (CONST OCISnapshot *) NULL, (OCISnapshot *) NULL, OCI_DEFAULT);
    while (rc != OCI_NO_DATA) {             /* Fetch the remaining data */
    printf("%s\n",p_sli);
    rc = OCIStmtFetch(p_sql, p_err, 1, 0, 0);
    printf("After fetch\n");
    rc = OCILogoff(p_svc, p_err); /* Disconnect */
    rc = OCIHandleFree((dvoid *) p_sql, OCI_HTYPE_STMT); /* Free handles */
    rc = OCIHandleFree((dvoid *) p_svc, OCI_HTYPE_SVCCTX);
    rc = OCIHandleFree((dvoid *) p_err, OCI_HTYPE_ERROR);
    void main()
    OCIClass c1;
    getch();
    The above program works on my Windows desktop. If I try this in Solaris, OCILogon fails and gives an error. If I check the value of rc, I find that it is -2. I can connect to the database using SQLPlus, but not through the program. Not sure how to debug this...
    Any pointers ?
    Thanks in advance,
    mrk

    Did you make the required port entry in the /etc/services file? You will need to add the gateway service port there. Then try to run your program.
    T00th

  • Error when starting remoteapp program - "the following is not in your list of authorised programms:"

    have 2 rd  web servers set up using an nlb cluster
    3 rd sesison host servers - dns round robin
    session broker (installed on dc)
    web single sign on is in place using cert generated internally on standalone ca
    I have added several programs to list on all session host servers and allows "domain users" access to them.
    regardless of the account that logs on I get the error "the following remoteapp program is not in the list of authorized programs: WordPad
    I have tried various things but I am sure the setup is correct.. any ideas?

    Hello,
    Based on my experience on similar issues, this error may be caused by missing Host Records of the TS servers on the local DNS.
    To fix this issue, please add the Host Records of the Terminal Servers into the local DNS and test it again.
    Let us know the result if possible. Thanks.
    Best Regards,
    Lionel Chen

  • Need a sample program for hierarchial oops ALV report

    Hello experts,
                     I Need a sample program for hierarchial oops ALV report.

    Hi,
       Check the following sample code...
    T A B L E S
    tables : ekko.
      data definition
    types : begin of ty_ekko,
              ebeln type ekko-ebeln,
              lifnr type ekko-lifnr,
              bsart type ekko-bsart,
              aedat type ekko-aedat,
              ernam type ekko-ernam,
            end of ty_ekko.
    types : begin of ty_eket,
               ebeln type ekpo-ebeln,
               ebelp type ekpo-ebelp,
               werks type ekpo-werks,
               matnr type ekpo-matnr,
               menge type eket-menge,
               wamng type eket-wamng,
               netpr type ekpo-netpr,
            end of ty_eket.
    data : it_ekko type table of ty_ekko,
           it_eket type table of ty_eket.
    data: ob_hieralv type ref to cl_salv_hierseq_table.
    data: it_binding type salv_t_hierseq_binding,
          is_binding type salv_s_hierseq_binding.
    S E L C T O P T I O N S
    select-options : s_ebeln for ekko-ebeln.
    S T A R T O F S E L E C T I O N
    start-of-selection.
    select ebeln
           lifnr
           bsart
           aedat
           ernam from ekko
    into corresponding fields of table it_ekko
    where ebeln in s_ebeln.
    if sy-subrc eq 0.
    select aebeln aebelp
           awerks amatnr
           bmenge bwamng
           a~netpr from ekpo as a join eket as b
                     on  amandt = bmandt
                     and aebeln = bebeln
                     and aebelp = bebelp
                   into corresponding fields of table it_eket
                  where a~ebeln in s_ebeln.
    endif.
    is_binding-master = 'EBELN'.
    is_binding-slave = 'EBELN'.
    append is_binding to it_binding.
    *TRY.
    call method cl_salv_hierseq_table=>factory
    exporting
    t_binding_level1_level2 = it_binding
    importing
    r_hierseq = ob_hieralv
    changing
    t_table_level1 = it_ekko
    t_table_level2 = it_eket .
    *CATCH cx_salv_data_error .
    *CATCH cx_salv_not_found .
    *ENDTRY.
    call method ob_hieralv->display( ).
    Cheers,
    Ram

  • Sample Program for Creating ALV Tree

    Hello Guys,
    Can some One Send me some sample program for creating ALV Tree.
    my Requirement is like below Diagram.
    ALV Tree |   ALV GrId
       |
       |
    I want to also about event in ALV , As per requirement when user select (Double click or press any push button) a node of ALV Tree That Node (Contain Sales order and as a child billing Doc No)  In the ALV Grid All the details about Sales order Will be display.
    Please guide me.
    Thanks
    Swati....

    Hi..
    check the following demo programs:
    RSDEMO_DRAG_DROP_EDIT_TREE
    RSDEMO_DRAG_DROP_TREE_MULTI
    BCALV_GRID_DND_TREE
    BCALV_GRID_DND_TREE_SIMPL
    BCALV_TEST_COLUMN_TREE
    BCALV_TEST_SIMPLE_TREE
    BCALV_TREE_01
    BCALV_TREE_02
    BCALV_TREE_03
    BCALV_TREE_04
    BCALV_TREE_05
    BCALV_TREE_06
    BCALV_TREE_DEMO
    BCALV_TREE_DND
    BCALV_TREE_DND_MULTIPLE
    BCALV_TREE_EVENT_RECEIVER
    BCALV_TREE_EVENT_RECEIVER
    BCALV_TREE_ITEMLAYOUT
    BCALV_TREE_MOVE_NODE_TEST
    BCALV_TREE_SIMPLE_DEMO
    BCALV_TREE_VERIFY
    hope this helps..
    -kothai

Maybe you are looking for

  • Error 3259 unable to download and install 3.0

    At least 7 times this weekend on 2 different laptops both with XP, 3.0 loads completely, but then get an error box saying my connection timed out or there is connection problem. Bull! Everything's connected. 3G downloading AFAP. Have ESET antivirus w

  • HP Laserjet M1120 installation problem on Window 7(64bit)

    I've recently purchased a new desktop, when I try to install my HP Laserjet M1120 MFP driver on the new desktop, I search and downloaded the HP M1120 MFP x64 installer from the HP official website (ljM1120-hb-pnp-win64-en.exe), when the installer say

  • SharePoint 2010 with SQL Reporting Services 2012 "Installation Error: Could not find SOFTWARE\Microsoft\Microsoft SQL Server\110 registry key"

    i have a small sharepoint farm "2 servers" (WFE) and SQL Server 2012 , i installed rsSharePoint for reporting services , as a read the Reporting services is Application Service  with SQL 2012 not as SQL 2008 R2 with SharePoint integrated mode, so aft

  • Nokia_PC_Suite_6_84_10_3_eng_web Fails on Vista x6...

    Hi, When trying to install the 6.84.10.3 version of pcsuite from the web under Vista x64 I get the following error: "Could not open key" "HKEY_LOCAL_MACHINE32\Software\Classes\Conn..(the rest goes off the screen!" Verify that you have sufficient acce

  • JPanel help

    hey, I'm making a calculator program with a function graphing part using JFrame and JPanel. But these two have been causing problems because when I run the GraphMain class, only a portion of the graph shows up. I have tested the Main and Graph classe