Unable to update a record using PAI, in Module pool

Hi Experts,
                    I m unable to update the records in to the table using P A I in module pool, could any one help me out dear.
The prg is as follows:
INCLUDE MZFIRSTPAGETOP                          .    " global Data
TABLES: ZCHP_CUST_INFO.
DATA:   CNAME LIKE ZCHP_CUST_INFO-CREATED_BY,
        REQTYP LIKE ZCHP_CUST_INFO-REQUEST_TYPE,
        DESC LIKE ZCHP_CUST_INFO-SHORT_TEXT,
        PRIO_TYPE LIKE ZCHP_CUST_INFO-PRIORITY_TYPE,
        EFFECTIVE_DATE like ZCHP_CUST_INFO-REQUIRED_STR_DAT,
        COMM_TYP like ZCHP_CUST_INFO-MODE_OF_COMM,
        COMM like ZCHP_CUST_INFO-ADDRESS.
*&      Module  STATUS_0100  OUTPUT
      text
MODULE STATUS_0100 OUTPUT.
  SET PF-STATUS 'FOR1000'.
  SET TITLEBAR '1000'.
ENDMODULE.                 " STATUS_0100  OUTPUT
INCLUDE MZFIRSTPAGEO01                          .  " PBO-Modules     *
INCLUDE MZFIRSTPAGEI01                          .  " PAI-Modules     *
INCLUDE MZFIRSTPAGEF01                          .  " FORM-Routines   *
*&      Module  USER_COMMAND_1000  INPUT
      text
MODULE USER_COMMAND_1000 INPUT.
CASE SY-UCOMM.
  WHEN 'SUBMIT'.
Updating the record.
        ZCHP_CUST_INFO-REQ_NUM = C_KNUMV.
        ZCHP_CUST_INFO-CREATED_BY = CNAME.
        ZCHP_CUST_INFO-REQUEST_TYPE = REQTYP.
        ZCHP_CUST_INFO-PRIORITY_TYPE = PRIO_TYPE.
        ZCHP_CUST_INFO-SHORT_TEXT = DESC.
        ZCHP_CUST_INFO-CREATED_ON = EFFECTIVE_DATE.
        ZCHP_CUST_INFO-MODE_OF_COMM = COMM_TYP.
        ZCHP_CUST_INFO-ADDRESS = COMM.
INSERT ZCHP_CUST_INFO.
COMMIT WORK.
WHEN 'RESET'.
       CLEAR: CNAME,REQTYP,PRIO_TYPE,
DESC,EFFECTIVE_DATE,COMM_TYP,COMM.
  WHEN 'CANCEL'.
        LEAVE PROGRAM.
ENDCASE.
ENDMODULE.                 " USER_COMMAND_1000  INPUT
Thanks in advance,
Sunil

Hi Kal chand,
                  This is the whole prg where the records are not updated. But the ref number is updated.
INCLUDE MZFIRSTPAGETOP                          .    " global Data
TABLES: ZCHP_CUST_INFO.
DATA: OKCODE LIKE SY-UCOMM.
CONSTANTS: LC_NUMBER_RANGE TYPE INRI-NRRANGENR VALUE '01',
           LC_COND_OBJECT TYPE INRI-OBJECT VALUE 'KONV'.
DATA: L_IS_REPL_DELIV TYPE XFLAG,
      C_KNUMV TYPE I.
DATA:   CNAME LIKE ZCHP_CUST_INFO-CREATED_BY,
        REQTYP LIKE ZCHP_CUST_INFO-REQUEST_TYPE,
        DESC LIKE ZCHP_CUST_INFO-SHORT_TEXT,
        PRIO_TYPE LIKE ZCHP_CUST_INFO-PRIORITY_TYPE,
        EFFECTIVE_DATE like ZCHP_CUST_INFO-REQUIRED_STR_DAT,
        COMM_TYP like ZCHP_CUST_INFO-MODE_OF_COMM,
        COMM like ZCHP_CUST_INFO-ADDRESS.
*&      Module  STATUS_0100  OUTPUT
      text
MODULE STATUS_0100 OUTPUT.
  SET PF-STATUS 'FOR1000'.
  SET TITLEBAR '1000'.
ENDMODULE.                 " STATUS_0100  OUTPUT
INCLUDE MZFIRSTPAGEO01                          .  " PBO-Modules     *
INCLUDE MZFIRSTPAGEI01                          .  " PAI-Modules     *
INCLUDE MZFIRSTPAGEF01                          .  " FORM-Routines   *
*&      Module  USER_COMMAND_1000  INPUT
      text
MODULE USER_COMMAND_1000 INPUT.
CASE SY-UCOMM.
  WHEN 'SUBMIT'.
*FOR INCREMENTING THE VALUE.
C_KNUMV = C_KNUMV + 1.
USED FM TO GENERATE NUMBERS.
CALL FUNCTION 'NUMBER_GET_NEXT'
     EXPORTING
       nr_range_nr = lc_number_range
       object      = lc_cond_object
     IMPORTING
       number      = c_knumv.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Updating the record.
        ZCHP_CUST_INFO-REQ_NUM = C_KNUMV.
        ZCHP_CUST_INFO-CREATED_BY = CNAME.
        ZCHP_CUST_INFO-REQUEST_TYPE = REQTYP.
        ZCHP_CUST_INFO-PRIORITY_TYPE = PRIO_TYPE.
        ZCHP_CUST_INFO-SHORT_TEXT = DESC.
        ZCHP_CUST_INFO-CREATED_ON = EFFECTIVE_DATE.
        ZCHP_CUST_INFO-MODE_OF_COMM = COMM_TYP.
        ZCHP_CUST_INFO-ADDRESS = COMM.
*ENDIF.
INSERT ZCHP_CUST_INFO.
COMMIT WORK.
WHEN 'RESET'.
       CLEAR: CNAME,REQTYP,PRIO_TYPE,
DESC,EFFECTIVE_DATE,COMM_TYP,COMM.
  WHEN 'CANCEL'.
        LEAVE PROGRAM.
ENDCASE.
regards,
Sunil

Similar Messages

  • Updating a record using pay element using the API (Almost Done)

    Hi Everyone,
    I have a question about updating a record using the PAY_ELEMENT_ENTRY_API.update_element_entry
    I have process that doesn't error out, but its doesn't seem to update the record. So my question is, is the query below the correct way to get the element name and object version number when using this API? If not, what do I need to do?
    BEGIN
    SELECT MAX(pee.element_entry_id)
    INTO x_element_id_mgr
    FROM pay_element_types_f pet,
    pay_element_links_f pel,
    pay_element_entries_f pee,
    per_all_assignments_f paaf,
    per_all_people_f papf
    WHERE pee.element_link_id = pel.element_link_id
    AND pel.element_type_id = pet.element_type_id
    AND paaf.assignment_id = pee.assignment_id
    AND papf.person_id = paaf.person_id
    AND pet.element_name = 'Mgr Rec Pct'
    AND sysdate BETWEEN pee.effective_start_date AND pee.effective_end_date
    AND sysdate BETWEEN pel.effective_start_date AND pel.effective_end_date
    AND sysdate BETWEEN pet.effective_start_date AND pet.effective_end_date
    AND sysdate BETWEEN paaf.effective_start_date AND paaf.effective_end_date
    AND sysdate BETWEEN papf.effective_start_date AND papf.effective_end_date
    AND paaf.assignment_id = c_staging.assignment_id
    AND papf.person_id = c_staging.person_id;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    --ROLLBACK TO s1;
    v_error_message := 'For employee number '||c_staging.employee_number||' No data found for element name Mgr Rec Pct' || SUBSTR(sqlerrm, 1, 200);
    DBMS_OUTPUT.PUT_LINE('Error occurred : ' || v_error_message);
    WHEN OTHERS THEN
    --ROLLBACK TO s1;
    v_error_message := 'For employee number '||c_staging.employee_number||' Error found for element name Mgr Rec Pct' || SUBSTR(sqlerrm, 1, 200);
    DBMS_OUTPUT.PUT_LINE('Error occurred : ' || v_error_message);
    END;
    --- Get OVN
    BEGIN
    SELECT MAX(Object_version_number)
    INTO x_ele_object_version_number
    FROM pay_element_entries_f
    WHERE element_entry_id = x_element_id_mgr;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    v_error_message := 'For employee number '||c_staging.employee_number||' Error in getting the OVN for Mgr Rec Pct ' || SUBSTR(sqlerrm, 1, 200);
    DBMS_OUTPUT.PUT_LINE('Error occurred : ' || v_error_message);
    WHEN OTHERS THEN
    v_error_message := 'For employee number '||c_staging.employee_number||' Error in getting the OVN for Mgr Rec Pct' || SUBSTR(sqlerrm, 1, 200);
    DBMS_OUTPUT.PUT_LINE('Error occurred : ' || v_error_message);
    END;

    Your SQL isn't bad, although you're including loads of tables you don't need to so it's probably not as fast as it could be. I'm not sure you know what element entry to update so let's look at an example:
    -- | Element Entry Id | OVN | Start Date | End Date    | Pay Value |
    -- +------------------+-----+------------+-------------+-----------+
    -- | 123                2    1-Jan-2009   31-Jan-2011   USD 400
    -- | 123                1    1-Feb-2009   18-Jun-2011   USD 500
    -- | 123                1    19-Jun-2011  25-Jun-2011   USD 600
    -- | 123                5    26-Jun-2011  31-Dec-4712   USD 700Here the one element entry (Id 123) has 4 effective rows. The employee gets $400 in Jan 2009, $500 from Feb 2009 to mid-June 2011, $600 for a few days later in June 2011 and then $700 from 26th June 2011 onwards.
    So your question to the forum is which one do I update. Well, that depends which one you want to update. If you want to update the 1st Jan 2009 to 31st Jan 2011 you'd pass element_entry_id => 123, ovn => 2, effective_date => to_date('1-Jan-2009', 'DD-MON-YYYY') and datetrack_mode => 'CORRECTION'.
    If you wanted to update the $700 row you'd pass OVN 5 and an effective date of 26th June 2011. And so-on.
    Now in your SQL you're filtering based on sysdate, which means you'd be updating the $500 row (ovn=1). Is that what you want?
    I have simplified your SQL as follows:
    SELECT pee.element_entry_id
          ,pee.object_version_number
    INTO   x_element_id_mgr
          ,x_ele_object_version_number
    FROM   pay_element_entries_f pee
          ,pay_element_types_f pet
    WHERE  pee.assignment_id = c_staging.assignment_id
    AND    pee.element_type_id = pet.element_type_id
    AND    pet.element_name = 'Mgr Rec Pct'
    AND    trunc(sysdate) BETWEEN
           pee.effective_start_date AND pee.effective_end_date
    AND    trunc(sysdate) BETWEEN
           pet.effective_start_date AND pet.effective_end_date;This selects both the entry Id and OVN in one go; there's no need to have 2 SQL statements. If multiple entries are allowed, this SQL could return more than one row so just watch out for that. If you don't want the row as of sysdate change the two sysdate joins accordingly.
    I hope that helps.

  • Need to update multiple records using store procedure

    Hi i am trying to update multiple records using store procedure but failed to achieve pls help me with this
    for example my source is
    emp_name sal
    abhi 2000
    arti 1500
    priya 1700
    i want to increase salary of emp whose salary is less than 2000 it means rest two salary should get update..using stored procedure only
    i have tried following code
    create or replace procedure upt_sal(p_sal out emp.sal%type, p_cursor out sys_refcursor)
    is
    begin
    open p_cursor for
    select sal into p_sal from emp;
    if sal<2000 then
    update emp set sal= sal+200;
    end i;f
    end;
    and i have called the procedure using following codes
    set serveroutput on
    declare
    p_sal emp.sal%type;
    v_cursor sys_refcursor;
    begin
    upt_sal(p_sal,v_cursor);
    fetch v_cursor into p_sal;
    dbms_output.put_line(p_sal);
    end;
    the program is executing but i should get o/p like this after updating
    1700
    1900
    but i am getting first row only
    2000
    and record is not upsating...please help me with this
    thanks

    Hi Alberto,
    thanx for your valuable suggestion. but still i have doubt. the code which i have mentioned above might be simple but what if i have big requirement where i need update the data by using loops and conditional statement.
    and i have similar kind of requirement where i need to deal with procedure which returns more than one row
    my source is
    empno ename salary
    111,abhi,300
    112,arti,200
    111,naveen,600
    here i need to write a store procedure which accepts the empno (111) as input para and display ename and salary
    here i have written store procedure like this
    create or replace procedure show_emp_det(p_empno in emp.empno%type, p_ename out emp.ename%type,p_salary out emp.salary%type, p_cursor out sys_refcursor)
    is
    begin
    open p_cursor for
    select ename,salary into p_ename,p_salary from emp where empno=p_empno;
    end;
    and i have called this by using
    declare
    p_salary emp.salary%type;
    p_ename emp.ename%type
    v_cursor sys_refcursor;
    begin
    show_emp_det(111,p_ename,p_salary,v_cursor);
    fetch v_cursor into p_ename,p_salary;
    dbms_output.put_line(p_ename);
    dbms_output.put_line(p_salary);
    end;
    here i should get
    abhi,300
    naveen,600
    but i am getting first row only
    abhi,300
    but i want to fetch both rows...pls help me to find the solution

  • FRM-40509: ORACLE error : Unable to update the record.

    Hi,
    I am having the following code in delete button.
    declare
         v_button  NUMBER;
    begin
      IF :CHNG_CNTRL_JOB_DTLS.SENT_DATE IS NULL THEN
                   v_button := fn_display_warning_alert( 'Do you want to delete the version ?');
                   IF ( v_button = alert_button1 )
                        THEN
                          message('before insert');
                          insert into chng_cntrl_job_dtls_log
                          select * from chng_cntrl_job_dtls
                          where job_name = :CHNG_CNTRL_JOB_DTLS.job_name
                          and job_version_no = :CHNG_CNTRL_JOB_DTLS.job_version_no
                          and sent_date is null;
                          message('before delete');
                          delete from CHNG_CNTRL_JOB_DTLS
                          where job_name = :CHNG_CNTRL_JOB_DTLS.job_name
                          and job_version_no = :CHNG_CNTRL_JOB_DTLS.job_version_no
                          and sent_date is null;
                          message('before commit');
                          silent_commit;
                          go_item('CHNG_CNTRL_JOB_DTLS.JOB_NAME');
                          P_DELETE_SET_PROPERTY;
                          clear_form;
                   ELSIF ( v_button = alert_button2 )
                        THEN
                          null;
                END IF;
         ELSE
                p_display_alert('Version '||:CHNG_CNTRL_JOB_DTLS.JOB_VERSION_NO||' for the job name '||:CHNG_CNTRL_JOB_DTLS.JOB_NAME||' cannot be deleted.','I');
      END IF;
         exception
              when others then
              message ('Exception in delete version button');
              end;when i am trying to save it says " *FRM-40509: ORACLE error : Unable to update the record*." .
    i am getting message till before commit.
    i am not able to check the error message in help as it is diabled in our form builder.
    I have checked the privileges also. they are fine.
    Please advice.
    Edited by: Sudhir on Dec 7, 2010 12:26 PM

    This error does not come from your procedure code, but from Forms itself. If you are in a database block, change something, and do a commit (either via a Forms key or in your own procedure), Forms commits the changes. For some reason this is not possible. You can see the database error via the Display Error key (often Shift-F1).
    I see in the OP that this key is disabled. Change the on-error code then:
    begin
       message(dbms_error_code||'-'||dbms_error_text);
       raise form_trigger_failure;     
    end;     Edited by: InoL on Dec 7, 2010 8:50 AM

  • Use of application module pool and ADF Busines Components

    Hi to all;
    Lets suppose an web application with about 10 CRUD forms and 15 to 20 reports or forms just to query and show data;
    That's clear to me, all the advantages of using App modules pool.
    But for that reports ..... Just an Read only and Forward Only data ?
    I was wondering, if it will be more effective and lightweight if we just take an JNDI JDBC connection query data and show it.
    This imaginary application will make use of application module pool to provide that 10 CRUD web forms and in other hand, will have for reports,JNDI data sources;
    What are your opinion about having this two architectural approach working together in one application ?
    Very thanks;
    Marcos Ortega
    Brazil;

    Hi Deepak;
    BC4J in my opinion is great and i am proud to share this opinion with all of you;
    As a meter of fact, i post this thread to help me better understand BC4J architecture.
    I think that my doubt main point is ...
    Are application modules pool's life cycle an extra work , when the job is just to read and show data ?
    Perhaps, an document about statefull and/or stateless application service release, help me;
    IMHO;
    cached data most of the time must to be discarted for reports, always we want to query database directly, View's object ClearCache() method would be called to reports.
    I think that it's different, when we are talking about sequent requests when we need to span the session, views and entities states.
    Forwards Thanks;

  • How to insert new record or update existing record using a complex view?

    Currently I created this screen, there is no problems on display data, only on the update funtionality (it means insert / update / delete on the table for which the view is based on).
    I have a table and a complex view in order to display the information from the table in a tabellar form (i.e up to 70 record in same "record" in the form, one for each item)
    The view is like this
    select a.f1, a.f2, get_value(a.pk1,1) a1, get_value(a.pk1,2) a2, get_value(a.pk1,3) a3............
    from my_table a
    where a.proj_id = user
    and I want to permit the update of the field a1, a2, a3 in a multiposition canvas (tabellar).
    I created an INSTEAD-OF trigger.
    But it not work only in the form. I receive the error FRM-40654 when I try to change the existing value in the running form based on that view.
    The view is woking and updatable using sql-plus.
    If I query
    select * from ALL_UPDATABLE_COLUMNS where table_name = 'SPV_BOQ_BOM_POS_ACTIVITIES';
    in which 'SPV_BOQ_BOM_POS_ACTIVITIES' is the name of my view.
    The question is: why if the view is updatable using SQL*Plus, is not updatable using Oracle Form 10gR2 ?
    Someone could help me asap?
    Thanks

    I removed on the datablock three items that are not showed, one of this is the Sysdate of update on the table for which the view is based.
    I removed also the on-lock trigger and the update from the form is NOT working fine.
    But for now I can still mantaing the ON-LOCK trigger.
    Is not a priority to remove this trigger.
    I still have the problem when the field is null, it mean that in the table SP_BOQ_BOM_POS_ACTIVITIES the record not exist.
    I try now to explayn better.
    SPV_BOQ_BOM_POS_ACTIVITIES is the name of the view.
    SP_BOQ_BOM_POS_ACTIVITIES is the name of the table.
    This are the desc
    desc SPV_BOQ_BOM_POS_ACTIVITIES
    Describing SPV_BOQ_BOM_POS_ACTIVITIES....
    NAME Null? Type
    BOQ_HEADER_ID NOT NULL NUMBER(12,0)
    BB_ID NOT NULL NUMBER(12,0)
    BOQ_ID NOT NULL NUMBER(12,0)
    PROJ_ID NOT NULL VARCHAR2(10)
    ACT_GROUP_CODE VARCHAR2(30)
    TOTAL_QTY NUMBER
    ACT_CODE_1 VARCHAR2(4000)
    QTY_1 NUMBER
    ACT_CODE_2 VARCHAR2(4000)
    QTY_2 NUMBER
    ACT_CODE_3 VARCHAR2(4000)
    QTY_3 NUMBER
    ACT_CODE_4 VARCHAR2(4000)
    QTY_4 NUMBER
    ACT_CODE_5 VARCHAR2(4000)
    QTY_5 NUMBER
    ACT_CODE_6 VARCHAR2(4000)
    QTY_6 NUMBER
    USR_ID NOT NULL VARCHAR2(10)
    LMOD NOT NULL DATE
    INT_REV NOT NULL NUMBER(6,0)
    The field QTY_1, QTY_2.... QTY_6 are calculated with a customer stored function from the table SP_BOQ_BOM_POS_ACTIVITIES.
    Also the field ACT_CODE_1, ACT_CODE_2, .... ACT_CODE_6 are calculated with a customer stored function from the table SP_BOQ_BOM_POS_ACTIVITIES.
    desc SP_BOQ_BOM_POS_ACTIVITIES
    Describing SP_BOQ_BOM_POS_ACTIVITIES....
    NAME Null? Type
    BBPA_ID NOT NULL NUMBER(12,0)
    BOQ_HEADER_ID NOT NULL NUMBER(12,0)
    BB_ID NOT NULL NUMBER(12,0)
    BOQ_ID NOT NULL NUMBER(12,0)
    PROJ_ID NOT NULL VARCHAR2(10)
    ACT_GROUP_CODE NOT NULL VARCHAR2(30)
    ACT_CODE NOT NULL VARCHAR2(30)
    QTY NUMBER(12,0)
    FLG_MANUAL_CHANGE VARCHAR2(1)
    USR_ID NOT NULL VARCHAR2(10)
    LMOD NOT NULL DATE
    INT_REV NOT NULL NUMBER(6,0)
    If I use SQL Navigator this insert working fine
    insert into SPV_BOQ_BOM_POS_ACTIVITIES
    (BOQ_HEADER_ID, BB_ID, BOQ_ID, PROJ_ID, ACT_GROUP_CODE, ACT_CODE_1, QTY_1)
    values (5050, 5015, 30486, 'B39368', 'TEST', '0101010101010101', 1709)
    1 row(s) inserted
    Instead using the Screen, at runtime, I receive the message:
    FRM-40400 Transation Complete: 1 records applied and saved
    but nothing is saved in the table SP_BOQ_BOM_POS_ACTIVITIES, and the view SPV_BOQ_BOM_POS_ACTIVITIES contain the calculated QTY_1 for the 'key', with null value.
    Moreover If in the field QTY_1 (NUMBER) I put a character, instead a Number, just to see if the Screen attempts or not an UPDATE or AN INSERT, the message is FRM-40509: Oracle Error. UNABLE TO UPDATE RECORD. Why happen an Update and not an INSERT using the Screen?
    In effect, the trial using SQL navigator of the following statement
    insert into SPV_BOQ_BOM_POS_ACTIVITIES
    (BOQ_HEADER_ID, BB_ID, BOQ_ID, PROJ_ID, ACT_GROUP_CODE, ACT_CODE_1, QTY_1)
    values (5050, 5015, 30486, 'B39368', 'TEST', '0101010101010101', 'r');
    I got Invalid Number and it's ok as answer from the database.
    Edited by: fmariani on 30-apr-2009 1.51

  • Updating a record using variables

    I want to use a variable(s) to update my record. I get a Java excpetion when using this code:
    <%@ page import="java.sql.*"%>
    <%@ include file = "/html/common/init.jsp" %>
    <% String ticketid = request.getParameter("ticketid"); %>
    <% String comment = request.getParameter("comment"); %>
    <% String userid = user.getUserId(); %>
    <% String comment_body = "comment_body" %>
    <%
    Class.forName("com.mysql.jdbc.Driver");
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/helpdesk", "root", "password");
    Statement updStmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    ResultSet updRs = updStmt.executeQuery("SELECT * FROM HISTORY WHERE (ticketid) = ('"+ticketid+"')");
    updRs.next();
    updRs.updateString "('"+comment_body+"', '"+comment+"')";
    updRs.updateRow();
    con.close();
    %>
    Here is the exception;
    An error occurred at line: 7 in the jsp file: /Projects/Help Desk/PostComments.jsp
    Generated servlet error:
    C:\Program Files\Liferay\server\default\work\jboss.web\localhost\_\org\apache\jsp\Projects\Help_0020Desk\PostComments_jsp.java:546: ';' expected
    String comment_body = "comment_body"
    ^
    An error occurred at line: 10 in the jsp file: /Projects/Help Desk/PostComments.jsp
    Generated servlet error:
    C:\Program Files\Liferay\server\default\work\jboss.web\localhost\_\org\apache\jsp\Projects\Help_0020Desk\PostComments_jsp.java:558: not a statement
    updRs.updateString "('"+comment_body+"', '"+comment+"')";
    ^
    An error occurred at line: 10 in the jsp file: /Projects/Help Desk/PostComments.jsp
    Generated servlet error:
    C:\Program Files\Liferay\server\default\work\jboss.web\localhost\_\org\apache\jsp\Projects\Help_0020Desk\PostComments_jsp.java:558: ';' expected
    updRs.updateString "('"+comment_body+"', '"+comment+"')";
    ^
    3 errors

    Thanks for the insult.<rant>
    Your problem was that you were missing a semi-colon at the end of line, which every Java statement requires. The error messages that you posted would tell most people who have more than casual experience with compiling Java that you have a trivial syntax problem.
    The people who take the time to answer the questions in this forum are mostly experienced professionals who answer questions on a volunteer basis out of the goodness of their heart. It takes time, it takes work, and we get the gratification of helping people, learning about new problems, and learning the tricks that the other pros know that we don't. Therefore it is frustrating to see a problem that ought to be solvable by anyone who's gotten past their first program harder than "hello world".
    However, I don't see anything insulting in our responses so far, or about saying that the impression I have from this and all your other posts is that you don't have the first idea about how to do what you're trying to do and you want this forum to design your application for you. While design questions are certainly appropriate in the forum, both the basic level and the number of your questions suggest that you really need to spend some time getting educated, by reading books, all the Java "how to" articles on the web, or examining the code of all the open source projects that happen to do similar things. Or you should go to school, hire a tutor, or a mentor within your development environment. You're acting like you expect the forum to do your work for you, and be polite and happy about it.
    I appreciate that trying to learn all these areas of Java at once is very hard and can be frustrating; it's taken me about 5 years to get to "above average" in some areas and I still have an enourmous amount to learn about other areas, even though I started as a senior programmer who has been working in non-Java, non-web areas for 25 years. Learning new technologies takes an enormous amount of work; your posting of an issue that many college freshman solve in their first "hands-on" project suggests to me that you are utterly unwilling to do your own work or take the time to think about your problems before posting. I write that not to insult you - it's truly how I feel - but to help you understand why you might not be getting the answers you seek in this forum; for many of us, you're just asking too much and whining about "insults" doesn't help your cause.
    Sorry if we hurt your feelings. After that rant, I'm going to attempt to restrict my responses to the technical issues at hand.
    </rant>

  • Why can't I select or update the Record using the PreparedStatement?

    the DB is oracle9i,here is the test table
    test
    id number;
    name char(10);
    intro char(10);
    I have insert a record in the table.
    Now I will select or update the record by using the PreparedStatement here is my code:
    sqlStr = "update test set intro = ? where name =?";
    PreparedStatement stmt = conn.prepareStatement(sqlStr);
    stmt.setString(1,"my name is irixwang");
    stmt.setString(2,"irixwang");
    int is = stmt.executeUpdate();
    if (is >=1 )
    System.out.println("ok");
    It will not work ,but where I change the update condiction as followed:
    sqlStr = "update test set intro = ? where id =?";
    PreparedStatement stmt = conn.prepareStatement(sqlStr);
    stmt.setString(1,"my name is irixwang");
    stmt.setInt(2,100);
    int is = stmt.executeUpdate();
    It works well,why?
    please help me!thk!!!!

    I doubt it works "well" in either case since you are inserting a string that is longer than 10 characters into a field that only holds 10 characters. But to your question....
    A char data type holds a fixed number of characters - in your case 10.
    Because it holds 10 characters it will never hold 9, regardless of what you think is in the field it will always have 10 characters in it. The value you are using for query for name is 9 characters. Since 9 characters, regardless of content, will never be equal to 10 characters there is no way that it will update.
    So your choice is to either use a varchar, which holds a variable number of characters, or to always use 10 characters for your query (pad it with spaces.)

  • Updating current record using SET_CUSTOM_PROPERTY in a multi-record form

    Hi,
    I have a multi record form and am using the SET_CUSTOM_PROPERTY method in the when validate trigger of an item. The problem is that it updates all records in the form instead of updating just the current record.
    Any inputs to resolve this would be helpful.
    Thanks

    I cannot reproduce the issue here.
    I have modified the sample dialog shipped with th article to have a block that displays 2 records
    <p>See the screenshot here</p>
    Here is the code in the When-Button-Pressed trigger:
      Set_Custom_Property( 'BLZ.BEAN', 1, 'READIMGFILE', 'd:/coyote.jpg' ) ;
      Set_Custom_Property( 'BLZ.BEAN', 2, 'READIMGFILE', 'd:/oracle_community.gif' ) ;So everything is ok for me.
    Francois

  • Update Multiple records using NW CE WebDyn Pro 7.2 interface ITEMDETAILS

    We are trying to use SAP Netweaver CE 7.2 and NetWeaver Design Studio 7.2 with the Web Dynpro application interfaces configured to connect to our MDM 7.1 SP06 repositories to develop web screens that allow our end users the ability to maintain MDM repository data without the use of DataManager.
         Our first application was to be a simple one to show the business the benefit of SAP Netweaver. Itu2019s very easy to use the interfaces for SEARCH, RESULTSET, ITEMDETAILS, MATCH and MERGE if you plan to maintain one record at a time. We would like to update many records at the same time.
    Using the configuration described previously, I find that I am able to select multiple records at one time using the RESULTSET interface and the Context folder of u201CSelectedRecordsu201D but I am not able to pass multiple records at one time to the context u201CIODatau201D used by the ITEMDETAILS interface and allow my end users to see and update multiple records at one time.
    If I can pass multiple records from RESULTSET to ITEMDETAILS for display and update would you please provide me with an example of how I would do this in NetWeaver Design Studio for NW CE 7.2..
    If I can NOT pass multiple records from RESULTSET to ITEMDETAILS for display and update, Would I then have to write my own wrapper application to read multiple records selected using the RESULTSET interface and the develop my own UPDATE view to display and update more than one record at a time. This would be time consuming since I would also have to write my own back out procedures and validation of update procedures that already happen within ITEMDETAILS.  Do you happen to have any CE application examples that show how this is done for a NW CE MDM repository that I can see? The current documentation u201CHow to Build Web Applications Using MDM Web Dynpro Components. pdfu201D falls short in the area of updating multiple records.
    Thank you in Advance

    Bugs aside, if it's VERY noisy, that might just be the out-of-sync problem (something I'm very familiar with now).
    Search the forum for "aggregate sync" and you should get some clues, if this is indeed the problem.
    Short of it is, you need to sync the two devices together. Easiest way seems to be to connect the two devices via S/PDIF and set Clock Source to S/PDIF for the "slave" device (set in Audio Midi).
    You can also just set the Clock Source as the "master" device in the drop down, bypassing the need for the S/PDIF cable altogether, but I haven't tried this myself.
    Macbook Pro CD / iMac C2D   Mac OS X (10.4.8)  

  • Update Multiple Records Using ASPVBscript

    I am trying to display multiple records on a page with a
    checkbox for each record, the checked value = Y. Then select
    multiple checkboxes and update each record at one time. I am using
    MS SQL as my DB. Is there an extention or command that I can use to
    accomplish this. Can anyone help.
    Thanks

    You need to give distinct values to your checkboxes and value
    fields. This
    can be done inside the DW Repeat Region loop code as it
    generates the rows.
    You then set another loop for the update. It is quite
    straightforward
    really.
    Have a look at Julian's site, here:
    http://www.charon.co.uk/content.aspx?CategoryID=27&ArticleID=41
    Also, there are a couple of links at the bottom of the above
    page. They use
    slightly different approaches and are usefull too.
    "StarM3d" <[email protected]> wrote in
    message
    news:f470in$p4v$[email protected]..
    >I am trying to display multiple records on a page with a
    checkbox for each
    > record, the checked value = Y. Then select multiple
    checkboxes and
    > update
    > each record at one time. I am using MS SQL as my DB. Is
    there an
    > extention or
    > command that I can use to accomplish this. Can anyone
    help.
    >
    > Thanks
    >
    >

  • Update sap table using a function module call by php code

    Hello,
    I m trying to update the table VBAP using a function module ZZ_SET_DISTANCE  call by a php code.
    But I have this problem:
    the saprfc seems to work well but when I look to the table VBAP the fields have not been update.
    I tried the function module in debug mode and it work good. The fields are update.
    I also handle the saprfc call function and the return SAPRFC_OK
    This are the function module ZZ_SET_DISTANCE, and the php code
    //PHP CODE
    $fce = saprfc_function_discover($sap,"ZZ_SET_DISTANCE");
                  if (! $fce ) {echo "Echec d'ouverture du module fonction "; exit;}
                   saprfc_import ($fce,"COMMANDE", '0000001998');
                   saprfc_table_init($fce,"TBLE_CMDE");
                        $val=array();
                        $val['NUM_POST']='000030';
                        $val['HN_EXP']='';
                        $val['ST_EXP']='';
                        $val['PC_EXP']='';
                        $val['CI_EXP']='';
                        $val['CO_EXP']='';
                        $val['HN_REC']='';
                        $val['ST_REC']='';
                        $val['PC_REC']='';
                        $val['CI_REC']='';
                        $val['CO_REC']='';
                        $val['DIST']='popo';
                        saprfc_table_append ($fce,"TBLE_CMDE", $val);
                 $rfc_rc = saprfc_call_and_receive ($fce);
                 echo "\n".$rfc_rc;
                 if ($rfc_rc != SAPRFC_OK) { if ($sap == SAPRFC_EXCEPTION ) echo ("Exception raised: ".saprfc_exception($fce)); else echo (saprfc_error($fce)); }else{echo '/execution de la function ;}
                 saprfc_function_free($fce);
    //FUNCTION MODULE ZZ_SET_DISTANCE
    FUNCTION ZZ_SET_DISTANCE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(COMMANDE) TYPE  VBELN
    *"  TABLES
    *"      TBLE_CMDE STRUCTURE  ZADD_COM_LOXAN
    DATA : NUMC TYPE VBELN.
    NUMC = COMMANDE .
    WHILE STRLEN( NUMC ) < 10 .
      CONCATENATE '0' NUMC INTO NUMC .
    ENDWHILE .
    DATA tble_addrcomm LIKE LINE OF TBLE_CMDE .
    LOOP AT  TBLE_CMDE INTO  tble_addrcomm.
      DATA : NUMP TYPE POSNR.
      NUMP = tble_addrcomm-NUM_POST.
      WHILE STRLEN( NUMP ) < 6 .
      CONCATENATE '0' NUMP INTO NUMP .
      ENDWHILE .
      UPDATE VBAP SET ARKTX = tble_addrcomm-DIST
      WHERE VBELN EQ COMMANDE
      AND POSNR EQ NUMP.
    ENDLOOP.
    ENDFUNCTION.
    Is anybody can help me?
    thank.

    Marie, create a Blog please, about more details for dummies....
    1) how to connect to sap system?
    2) you run the php code where? in a webserver or where?
    3) wich is the url for run the FM: ZZ_SET_DISTANCE
    4) you placed some dlls files on the web server?
    please is interesting this...
    Thanks

  • Data type selection Problem in ztable to use in the Module Pool Program

    Dear Experts,
    I have created a z-table which is used in Module Pool Program in which i have to save the information saved by the endusers in z-table. But the problem comming is that the amount of information saved by the endusers is so havey & our table is just limited for the 50 characters which is not sufficiet. So I urge you to please tell me what & which type of data type should I have to use to store maximum amount of information in our zt-able which is available in SAP ECC6.0.
    Thanks & Regards,
    Akg

    Dear Akg,
    u can resolve ur problem in following ways,
    1. You can declare the field in a table without an Data element.
          i.e. In the length field . using F4 help in length field how many characters u want u enter.
    2. In the same u can search for an standard data element and use the same.
    3. Creating an custom data element .
    Reward if helps to u!!!
    Regards,
    MNR

  • Using images in module pool programming.

    Can anyone tell the way to display an image in a module pool program screen?
    If its not too much of a headache, please give a detailed code.

    Hi Sahil,
                  Well you might want to take a look at the following link. I used SE78 to upload the picture and then used the picture in the module pool screen. I think that you can upload almost any picture using se78.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/uploading%2bse78%2bpictures%2bin%2bscreen
    Edited by: Aditya  Niyogi on May 26, 2008 11:25 AM

  • BADI's being used in MP000100 (module pool program for Infotype 1)

    Hi,
    In module pool program MP000100( for Infotype 1 i.e. HR related), what are the BADI's being used in PBO module of screen no- 2000 ?
    I need to add some codes, if there is no BADI then where i can add codes as i need to default organizational field according to position ID field ?
    Thanking you in anticipation.

    >
    Vaibhav Kumar wrote:
    > I need to add some codes, if there is no BADI then where i can add codes as i need to default organizational field according to position ID field ?
    > Thanking you in anticipation.
    Why do you need a BAdI for that? Your Business/Functional Analyst should be able to handle it using a feature via the Tcode PE03.
    BTW, HRPAD00INFTY is one that can be useful.
    ~Suresh

Maybe you are looking for