Update 2 fields in 1 table

I need to update an Oracle 8i database. I need to update 2 fields in 1 table with about 2,000 rows of data.
Right now the date is stored in an Excell file in columns A and B.
I need Something like:
Update Table1
set field1 with value from A:1,
set field2 with value from B:1
repeated with A:2,B:2 and so on

I believe you could use sql loader to get your excel file in but here is a way I cheat to do it.
I save the excel file as a comma deliminated file (I think it is .csv)
then I open it up and copy and paste it into the following. (the part that says paste flat file here)
this is assuming 8i supports model clause I'm unsure on that point.
create or replace view view_xl_file_to_table as
select * from
with t as (select
--- copy paste your flat file here
' Bob,Jones,12345,Employee
  Fred,Thebes,32,Manager
  John,Smith,12,Employee
  Karl,Cane,432,Employee
  George,Johnson,54,Manager
  ' flat_text_file from dual
select flat_text_file text_file_turned_into_row,
        substr(flat_text_file, 1, instr(flat_text_file,',',1,1)-1) col1, -- get text up to the first comma
        substr(flat_text_file, instr(flat_text_file,',',1,1)+1, instr(flat_text_file,',',1,2) - instr(flat_text_file,',',1,1)-1  ) col2, --2nd comma
        substr(flat_text_file, instr(flat_text_file,',',1,2)+1, instr(flat_text_file,',',1,3) - instr(flat_text_file,',',1,2)-1  ) col3, --3rd
        substr(flat_text_file, instr(flat_text_file,',',1,3)+1, instr(flat_text_file,',',1,4) - instr(flat_text_file,',',1,3)-1  ) col4,
        substr(flat_text_file, instr(flat_text_file,',',1,4)+1, instr(flat_text_file,',',1,5) - instr(flat_text_file,',',1,4)-1  ) col5,
        substr(flat_text_file, instr(flat_text_file,',',1,5)+1, instr(flat_text_file,',',1,6) - instr(flat_text_file,',',1,5)-1  ) col6,
        substr(flat_text_file, instr(flat_text_file,',',1,6)+1, instr(flat_text_file,',',1,7) - instr(flat_text_file,',',1,6)-1  ) col7
  from t
-- first turn the carriage return into seperate rows
model return updated rows
dimension by (0 d)
measures (flat_text_file, 0 position_of_return )  -- the position of return is where the next carriage return is
rules iterate(1000) until position_of_return[iteration_number+1] = 0
position_of_return[iteration_number + 1] = instr(flat_text_file[0],chr(10),1,iteration_number + 1), -- find the next carriage return
-- get the text between the previous carriage return and the next and make it a row
flat_text_file[iteration_number + 1] = replace(substr( flat_text_file[0],
                                            position_of_return[iteration_number],
                                            position_of_return[iteration_number + 1] - position_of_return[iteration_number]
                                           ),chr(10))||',' 
)now I have a view and I could anything I want with it and I just drop it when I'm done.
Edited by: pollywog on Apr 19, 2010 7:57 AM

Similar Messages

  • How to update fields in multiple tables ?

    Dear all,
    What is the fastest way to update fields in multiple tables... from a single change table...as below is my code to update the fields but it is taking long time to update as i need to keep log file if any one update fails....
    CREATE OR REPLACE
    package body DO_DC_NAME_UPDATE_OTHER_TAB
    as
    type rowidArray is table of rowid index by binary_integer;
    type custRec is record
    n_cust_ref_no dbms_sql.number_table,
    v_name dbms_sql.varchar2_table,
    v_name_chg dbms_sql.varchar2_table,
    rowid rowidArray,
    changed dbms_sql.varchar2_table
    procedure VALIDATE_CUST_NAME( p_n_cust_ref_no in number,p_v_name_chg in out NOCOPY varchar2, p_changed in out NOCOPY varchar2 )
    is
    begin
    FOR cr_cust IN (SELECT --a.n_cust_ref_no,a.v_name,UPD_V_NAME, a.n_weight,a.V_LASTUPD_INFTIM
    from GNMT_CUSTOMER_MASTER_CHG where n_cust_ref_no=p_n_cust_ref_no)
         loop
    -- v_name
    if nvl(trim(cr_cust.v_name),0) != nvl(p_v_name_chg,0)
    then
              p_v_name_chg := p_v_name_chg;
              --p_v_name := p_v_name;
              p_changed := 'Y';
    end if;
         end loop;
    end;
    procedure DO_NAME_UPDATE_OTHER_TAB
    is
    l_record custRec;
    l_array_size number default 20000;
    l_done boolean;
    l_cnt number default 1;
    cursor c is select a.n_cust_ref_no, a.v_name,a.v_name_chg, a.rowid, 'N'
                        from GNMT_CUSTOMER_MASTER_CHG a--,GNMT_CUSTOMER_MASTER b
                        where a.v_name <> trim(a.v_name_chg); --and  a.n_cust_ref_no in (1434775,1561181,1601870);
    begin
    open c;
    loop
    dbms_application_info.set_client_info
    ( 'processing ' || l_cnt || ' thru ' || (l_cnt+l_array_size-1) );
    fetch c bulk collect into l_record.n_cust_ref_no, l_record.v_name,l_record.v_name_chg,l_record.rowid, l_record.changed
    LIMIT l_array_size;
    l_done := c%notfound;
    --dbms_output.put_line ('message10');
    for i in 1 .. l_record.n_cust_ref_no.count
    loop
    VALIDATE_CUST_NAME(l_record.n_cust_ref_no(i),l_record.v_name_chg(i),l_record.changed(i) );
    end loop;
    --dbms_output.put_line (l_record.n_cust_ref_no(i)||','||l_record.V_OCCUP_CODE(i)||','||l_record.CHANGED(i));
    /*forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_CUSTOMER_MASTER q
    set q.v_name = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_name) = l_record.v_name(i)
    and l_record.changed(i) = 'Y';*/
    -- update v_name in all the related tables
    forall i in 1 .. l_record.n_cust_ref_no.count
    update ADE_CUSTOMER_MASTER q
    set q.v_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_name) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_POLICY_DETAIL q
    set q.v_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_name) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_QUOTATION_DETAIL q
    set q.v_NAME =l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_name) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update NBDT_BENEFICIARY q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSDT_NOMINATION_TRANSACTION q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSMT_POLICY_BENEFICIARY q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSMT_POLICY_TRUSTEE q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSMT_QUOTATION_BENEFICIARY q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSMT_QUOTATION_TRUSTEE q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNDT_BLACKLIST_DETAIL q
    set q.v_FNAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_FNAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_FNAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update INDT_LIAM_DETAIL q
    set q.v_FNAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_FNAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_FNAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_POLICY q
    set q.V_PAYER_NAME = l_record.v_name_chg(i)
    where q.N_PAYER_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_PAYER_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PAYER_NAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_QUOTATION q
    set q.V_PAYER_NAME = l_record.v_name_chg(i)
    where q.N_PAYER_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_PAYER_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PAYER_NAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_QUOTATION q
    set q.V_PROPOSER_NAME = l_record.v_name_chg(i)
    where q.N_PROPOSER_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_PROPOSER_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PROPOSER_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_POLICY q
    set q.V_PROPOSER_NAME = l_record.v_name_chg(i)
    where q.N_PROPOSER_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_PROPOSER_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PROPOSER_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update CLMT_CLAIM_MASTER q
    set q.V_CLIENT_NAME = l_record.v_name_chg(i)
    where q.N_CLIENT_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_CLIENT_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_CLIENT_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update CLMT_CLAIM_MASTER q
    set q.V_INTIMATOR_NAME = l_record.v_name_chg(i)
    where q.N_CLIENT_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_INTIMATOR_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_INTIMATOR_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PYMT_VOU_MASTER q
    set q.V_PAYEE_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_PAYEE_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PAYEE_NAME is not null;
    /*forall i in 1 .. l_record.n_cust_ref_no.count
         INSERT INTO GNMT_CUSTOMER_MASTER_LOG
              (N_CUST_REF_NO, V_TITLE_CODE, V_NAME, D_BIRTH_DATE, V_SEX, V_RELIGION_CODE, V_NATION_CODE, V_OCCUP_CODE, V_ALIVE, V_SMOKER,
              N_NO_STICKS, D_DEATH_DATE, V_BUMI_NON_BUMI, V_AGE_ADMITTED, V_SHORT_NAME, V_FIRST_NAME, V_LAST_NAME, V_EMAIL, V_DESIGNATION,
              N_HEIGHT,N_WEIGHT,V_TITLE_CODE_CHG, V_NAME_CHG, D_BIRTH_DATE_CHG, V_SEX_CHG,V_RELIGION_CODE_CHG,V_NATION_CODE_CHG, V_OCCUP_CODE_CHG, V_ALIVE_CHG,
              V_SMOKER_CHG, N_NO_STICKS_CHG, D_DEATH_DATE_CHG,V_BUMI_NON_BUMI_CHG, V_AGE_ADMITTED_CHG, V_SHORT_NAME_Chg, V_FIRST_NAME_Chg,
              V_LAST_NAME_Chg, V_EMAIL_Chg, V_DESIGNATION_Chg,N_HEIGHT_Chg,N_WEIGHT_Chg, V_UPD_STATUS_DC,-- V_LASTUPD_PROG, V_LASTUPD_INFTIM,
              V_LASTUPD_USER_DC, V_LASTUPD_PROG_DC,V_LASTUPD_INFTIM_DC
              SELECT N_CUST_REF_NO, V_TITLE_CODE, V_NAME, D_BIRTH_DATE, V_SEX, V_RELIGION_CODE, V_NATION_CODE, V_OCCUP_CODE, V_ALIVE, V_SMOKER,
              N_NO_STICKS, D_DEATH_DATE, V_BUMI_NON_BUMI, V_AGE_ADMITTED, V_SHORT_NAME, V_FIRST_NAME, V_LAST_NAME, V_EMAIL, V_DESIGNATION,
              N_HEIGHT,N_WEIGHT,V_TITLE_CODE_CHG, V_NAME_CHG, d_birth_date_chg, V_SEX_CHG, V_RELIGION_CODE_CHG,V_NATION_CODE_CHG, V_OCCUP_CODE_CHG, V_ALIVE_CHG,
              V_SMOKER_CHG, N_NO_STICKS_CHG, D_DEATH_DATE_CHG, V_BUMI_NON_BUMI_CHG, V_AGE_ADMITTED_CHG, V_SHORT_NAME_Chg, V_FIRST_NAME_Chg,
              V_LAST_NAME_Chg, V_EMAIL_Chg, V_DESIGNATION_Chg,N_HEIGHT_Chg,N_WEIGHT_Chg--, V_LASTUPD_USER, V_LASTUPD_PROG, V_LASTUPD_INFTIM
              ,'PROCESSED'
              ,user,--P_USER,
              'DC_PAKAGE',
              sysdate--P_DATE
              FROM GNMT_CUSTOMER_MASTER_CHG where n_cust_ref_no =l_record.n_cust_ref_no(i)
              --and n_cust_ref_no not in (select n_cust_ref_no from GNMT_CUSTOMER_MASTER_LOG);*/
    exit when (l_done);
    l_cnt := l_cnt + l_array_size;
    end loop;
    commit;
    end;
    end;
    thank You

    Dear SeánMacGC thanks for reply,
    But "a.changed" is not a field in GNMT_CUSTOMER_MASTER_CHG. what i am doing in this procedure is i am collecting bulck data and validating field by field from GNMT_CUSTOMER_MASTER_CHG with GNMT_CUSTOMER_MASTER table as their structure is same.. if v_name is not same as v_name_chg then i am setting changed flag to "Y" changed is "changed dbms_sql.varchar2_table" and updating GNMT_CUSTOMER_MASTER in bluck where changed flag ='Y'...
    type custRec is record
    n_cust_ref_no dbms_sql.number_table,
    v_name dbms_sql.varchar2_table,
    v_name_chg dbms_sql.varchar2_table,
    rowid rowidArray,
    *changed dbms_sql.varchar2_table*
    i cannot use simple SQL as i need to validate field for each records with GNMT_CUSTOMER_MASTER_CHG and insert into log file as well.....
    to run this procedure:
    execute DO_DC_NAME_UPDATE_OTHER_TAB.DO_NAME_UPDATE_OTHER_TAB;
    Thanks...

  • Updating fields in selected table

    I am obtaining the values for a report from a table. After I
    have selected the values I need to update a particular field in
    the table for each row selected signifying that these records
    have already been queried by the report. Where is the best place
    to put this update statement?

    This can be done in After Report Trigger.
    Note: However, you will have to test it using Reports Runtime.
    If you try running the report from Report Builder then the
    update will not work.

  • Trigger to update field on a table with the sum of fields on another table

    My experience creating triggers and pl/sql in general can best be described in oracle terms as null. I've been practicing by creating tables and applications on my personal home server to help me with some of my work related tasks. Right now I'm trying to create a trigger that will, after insert, update, delete on the assignment_time_track table update the time_spent field on the assignments table with the sum of the time_spent fields on the assignment_time_track table. Hopefully that run on sentence there is clear to people other than myself. I've attempted to script this on my own using the trigger creation tool for Oracle Database Express Edition but I get the following error:
    Trigger create was not successful for the following reason:
    ORA-06552: PL/SQL: Compilation unit analysis terminated ORA-06553: PLS-320: the declaration of the type of this expression is incomplete or malformed
    Here is my attempt at creating the trigger on my own.
    create or replace trigger "ASSIGNMENT_TIME_TRACK_T1"
    AFTER
    insert or update or delete on "ASSIGNMENT_TIME_TRACK"
    for each row
    begin
    update assignments
    set time_spent = (select sum(time_spent)
    from assignment_time_track
    where assignment_time_track.name = assignments.name);
    end;
    If what I've posted isn't clear or more detail is needed, let me know and I'll respond with a complete description of both tables and my goals for each table. Thanks in advance for any help. I will also gladly accept links to tutorials or lessons that explain how to do this sort of thing.
    Edited by: bobonthenet on Mar 9, 2009 2:01 PM

    Hi,
    If the assignments table has only one row per assignment, why is the primary key the combination of name and time_spent? If you have two two assignments called "Lab Report", isn't it possible that you would spend the same amount of time on each of them? I suggest using a sequence to assign an arbitrary id number to each assignment, and use that as the primary key.
    What does each row in assuignment_time_track represent? It sounds like it is a chunk of time spent on one assignment (that is, you want to know that you spent 90 minutes on Tudesday morning working on some assignment, and that you spent another 30 minutes on Tuesday afternoon working on the same assignment). If so, then there should be a foreign key constraint in assignment_time_track referencing the primary key of assignemnt, and not the other way around.
    Alex is right; you can get the total time spent on each project in a query or view; there is no need to replicate that data.
    If you're new to Oracle and SQL, you should invest your time in getting more experience with the basics: everyday things like queries (using joins and GROUP BY) and views, and not spend much time on things that aren't used that much, like triggers.
    If you really did have to copy the data, then you could have a trigger on assignemnt_time_track that kept the total in assignment up to date, like this:
    UPDATE  assignment
    SET     total_time_spent = total_time_spent
                    + NVL (:NEW.time_spent, 0)
                             - NVL (:OLD.time_spent, 0);I suggest you name the column in assignment something different than the column in assignment_time_track, to reduce the risk of confusion. Also, since they represent different things, the same name can't be the most descripttive for each of them.
    In case you're wondering about the use of NVL, above: It allows the same statement to take care of the situation when you INSERT, UPDATE or DELETE a row in assignment_time_track. That is, if you UPDATE a row in assignment_time_track, and change the time_spent from 60 to 90, then you want to add the new time (90) and subtract the old time (60) fro the total_time_spent in assignment: that is, total_time_spent would increase by 30. If you INSERT a new row into assignment_time_track with time_spent=30, you just need to add the new time_spent (30): there is nothing to subtract. But rather than write an IF statement and a second UPDATE for that situation, you can just rely on hte fact that all :OLD values are NULL iwhen INSERTing, and treat that NULL as a 0. Likewise, when DELETing, all :NEW values are NULL..

  • UPDATE field in internal table?

    Hi,
    I have an internal table with XXXXXXXX records. I have to UPDATE 1 field with the same value.
    Is there a faster way?
        LOOP AT lt_order_adm_h INTO wa_order_adm_h.
          wa_order_adm_h-process_type = 'Z002'.
          MODIFY lt_order_adm_h FROM wa_order_adm_h TRANSPORTING process_type.
        ENDLOOP.
    tnx, Adibo.

    HI Adibo,
    Try below
    data: lv_tabix type i.  "take this index aswell for better perfromance.
        LOOP AT lt_order_adm_h INTO wa_order_adm_h .
          lv_index = sy-tabix.
          wa_order_adm_h-process_type = 'Z002'.
          MODIFY lt_order_adm_h FROM wa_order_adm_h index lv_index TRANSPORTING process_type.
        ENDLOOP.
    or you can do one more thing.
    if you want to modify only process_type  field ( which is initail ) for whole table.
    just do below
    wa_order_adm_h-process_type = 'Z002'.
    modify lt_order_adm_h from wa_order_adm_h tranporting process_type where process_type is '  ' .
    any ways modify is the faster way.
    Regards
    Edited by: Prasanth on Mar 4, 2009 5:35 PM

  • A field of the table in sql server db can't be updated with the db adapter

    Hi all,
    I am using db adapter to update data in bpel. The database is sql server.
    But on the running time, i find a field which named 'JDBCT1' can't be updated. all the other fields of this table can be updated properly.
    For the operation type, i have tried the update only and execute pure sql. None of them works.
    The version of SOA is 11.1.1.6.
    Can any one give some solutions?
    It's urgent, thank you!

    Hi,
    Pls check the data type in your mapping file and data type in table. It might be mismatched.
    thanks

  • Updation of Custom Fields in AFRU table Using Customerexit

    Hi all,
    I added two fields in CO11n Tcode using SCREEN EXIT - CONFPP07 and iam trying to update these two fields in AFRU table
    using CONFPP05.  But iam unable to update these two field .
    see this code in CONFPP05
      LOOP AT afrud_tab.
        afrud_tab-zzshift = wa_afrud-zzshift1 .
        afrud_tab-zzoperator = wa_afrud-zzoperator1 .
        MODIFY afrud_tab.
      ENDLOOP.
    Plz help me regarding this..

    Thanks for reply
    Ya i added two fields in confpp07 .
    see the code :
    *&  Include           ZXCOFTOP
    tables : afrud.
    DATA : WA_AFRUD TYPE AFRUD,
            IT_AFRUD TYPE TABLE OF AFRUD.
    Include           ZXCOFU24
    MOVE afrud-zzshift1 TO wa_afrud-zzshift1.
    MOVE afrud-zzoperator1 TO wa_afrud-zzoperator1.
    Even though it is not updating . except these two fields.
    Regards,
    Srinivas

  • How to update a custom field of MARC table using BAPI_MATERIAL_SAVEREPLICA

    Hi,
    I want to update a custom field (Appended field) of MARC table using  BAPI_MATERIAL_SAVEREPLICA. Please help me in this issue. I cannot use BAPI_MATERIAL_SAVEDATA as this updated the MARC table record by record. I have to update bulk records at a time.
    Thanks
    Rahul.

    Hi,
    Use the Documentation given for struture in BAPI docuemntation...
    For loading data into custom fields of MARC use the structure - BAPI_TE_MARC.
    First, structures BAPI_TE_<NAME> (<NAME> = MARA, MARC, MARD, MBEW, MLGN, MLGT, MVKE, MARM, MAKT) and the appropriate check structures BAPI_TE_<NAME> (<NAME> = MARAX, for example) have to be extended by the customer to include the required fields. The structures that are delivered as standard only contain the relevant key fields. When new fields are added to this structure, you should ensure that a field has the same name as the field in the database table. Furthermore, the fields in the structures BAPI_TE_<NAME> can only be CHARACTER fields. Data element BAPIUPDATE is to be used for the fields in the check structure (exception to this: key fields.)
    Parameters EXTENSIONIN and EXTENSIONINX are used for transferring data to the method. Field STRUCTURE contains the name of the structure (for example, BAPI_TE_MARA or BAPI_TE_MARAX). This names is used to identify the work area (for example,  WA_BAPI_TE_MARA or WA_BAPI_TE_MARAX) to which the data is transferred. The remaining fields in parameters EXTENSIONIN or EXTENSIONINX contain data for the key fields (for example, the material number) and the data for customer-specific fields. The number of characters reserved in both parameters for the contents of the customer-specific fields must match the number of characters for the relevant field in the work area. If the number of required characters is less, the remaining characters are left blank. Only when all characters have been filled can the contact for an additional field be transferred. Bear in mind that only data for which an appropriate indicator has been set in the work area can be updated to the database.
    Regards,
    Bhargava

  • How to update field values in a database table using module pool prg?

    hi
    how to update field values in a database table using module pool prg?
    we created a customized table, and we put 2 push buttons in screen painter update and display.
    but update is not working?
    data is enter into screen fields and to internal table, but it is not updated in database table.
    thanks in adv
    vidya

    HI,
    we already used the update statement. but its not working.
    plz check this.
    *& Module Pool       ZCUST_CALL_REC
    PROGRAM  ZCUST_CALL_REC.
    TABLES: ZCUST_CALL_REC,ZREMARKS.
    data:  v_kun_low like ZCUST_CALL_REC-kunnr ,
           v_kun_high like ZCUST_CALL_REC-kunnr,
           v_bud_low like ZCUST_CALL_REC-budat,
           v_bud_high like ZCUST_CALL_REC-budat.
    ranges r_kunnr for ZCUST_CALL_REC-kunnr  .
    ranges r_budat for zcust_call_rec-budat.
    DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
          JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
    *data:begin of itab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of itab.
    *data:begin of Jtab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of Jtab.
    CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
    CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
    *start-of-selection.
    *&      Module  USER_COMMAND_9000  INPUT
          text
    MODULE USER_COMMAND_9000 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    WHEN 'ENQUIRY'.
    perform multiple_selection.
    perform append_CUSTOMER_code.
    PERFORM SELECT_DATA.
    call screen '9001'.
    WHEN 'UPDATE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
          perform update on commit.
    WHEN 'DELETE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
    *&      Module  STATUS_9000  OUTPUT
          text
    MODULE STATUS_9000 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
          text
    MODULE USER_COMMAND_9001 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    endcase.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Module  STATUS_9001  OUTPUT
          text
    MODULE STATUS_9001 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    move itab-MANDT   to zcust_call_rec-MANDT.
    move itab-kunnr   to zcust_call_rec-kunnr.
    move itab-budat   to zcust_call_rec-budat.
    move itab-code    to zcust_call_rec-code.
    move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  USER_COMMAND_9002  INPUT
          text
    module  USER_COMMAND_9002 input.
    CASE sy-ucomm.
       WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          SET SCREEN 0.
          LEAVE SCREEN.
          CLEAR sy-ucomm.
       WHEN 'UPDATE'.
             perform move_data.
         UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
            IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
            ENDIF.
      WHEN 'DELETE'.
             perform move_data.
             DELETE ZCUST_CALL_REC FROM TABLE ITAB.
              IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
            ENDIF.
    endcase.
    endmodule.                 " USER_COMMAND_9002  INPUT
    *&      Module  STATUS_9002  OUTPUT
          text
    module STATUS_9002 output.
      SET PF-STATUS 'ZCUSTOMER1'.
    SET TITLEBAR 'xxx'.
    endmodule.                 " STATUS_9002  OUTPUT
    *&      Module  update_table  OUTPUT
          text
    module update_table output.
         move itab-MANDT   to zcust_call_rec-MANDT.
         move itab-kunnr   to zcust_call_rec-kunnr.
         move itab-budat   to zcust_call_rec-budat.
         move itab-code    to zcust_call_rec-code.
         move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    endmodule.                 " update_table  OUTPUT
    ***Selection Data
    FORM SELECT_DATA.
    SELECT  mandt kunnr budat code remarks  FROM zcust_call_rec INTO
                            table itab
                             WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
    ENDFORM.
    ****append vendor code
    FORM APPEND_CUSTOMER_CODE.
    clear r_kunnr.
    clear itab.
    clear r_budat.
    refresh r_kunnr.
    refresh itab.
    refresh r_kunnr.
    IF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                  EXPORTING
                                      input         = v_kun_high
                                  IMPORTING
                                      OUTPUT        = r_kunnr-high.
                     r_kunnr-option = 'BT'.
                     r_kunnr-sign = 'I'.
                     append r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
          PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        IF SY-SUBRC = 0.
                             MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
                              CALL SCREEN '9000'.
                        ENDIF.
    PERFORM V_BUDAT.
    ENDIF.
    ENDFORM.
    FORM V_BUDAT.
    IF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'BT'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-HIGH = v_bud_HIGH.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
              ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                   IF SY-SUBRC = 0.
                       MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
                      CALL SCREEN '9000'.
                    r_budat-low = ''.
                    r_budat-option = ''.
                    r_budat-sign = ''.
                    ENDIF.
            ENDIF.
    ENDFORM.
    *&      Form  update
          text
    -->  p1        text
    <--  p2        text
    form update .
    commit work.
    endform.                    " update
    *&      Form  move_data
          text
    -->  p1        text
    <--  p2        text
    form move_data .
       clear itab.
      refresh itab.
           move-corresponding  zcust_call_rec to itab.
           MOVE ZCUST_CALL_REC-MANDT   TO ITAB-MANDT.
           MOVE ZCUST_CALL_REC-KUNNR   TO ITAB-KUNNR.
           MOVE ZCUST_CALL_REC-BUDAT   TO ITAB-BUDAT.
           MOVE ZCUST_CALL_REC-CODE    TO ITAB-CODE.
           MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
         APPEND ITAB.
         delete itab where kunnr is initial.
    endform.                    " move_data
    thanks in adv
    vidya

  • To Update Custom field in mch1 table through MIGO Tcode

    Dear champs,
    I have added one custom field in mch1 table ( date ).
    Now , In MIGO Tcode when i am doing posting, MCH1 table is also updated.
    I want to know how to update my custom field in mch1 table at the time of posting.
    Please tell me where to write logic to update mch1 table.
    Regards,
    Satyen Trivedi

    Hi Satyen,
           what data has to be update in MCH1 table new field, for this did you added any screen or you want to implement your own custom logic.
    1) if you implemented the screen , then you have to write logic there itself.
    2) If you want to update through custom logic , then you takeup with the  Enhancements or BADI.
    Regards,
    Krishna

  • How to update and retrieve the table control entries and field entries.

    Hello everyone,
    i have a requirement,
    i have    company code , plant, fiscal year, posting period  fields in the selection screen and then below that i have a  table control which contains 4 fields  invoice no., check number, check date and amount.
    i have to enter the values and when i press  SAVE button , these values have to update in a custom table which i had created.
    please send me the coding how to do this object.
    will be rewarded.
    thanks in advance.

    Hi Suresh
      this is actual requirement
    in the CAT2.
    1. Add a new column for WBS description and derive the value as per the FS
    2. Retrieve project number and description and update in the column specified
    3. When a service order is selected it should do the same for 2.
    4. Finally repeat for the worklist view (which is the section above)
       here i am able to display values at data entry area
    for service order and network but not worklist area ?
        updation is not coming, can u plz go throw it..
    Thanks
    Chinna

  • Custom field in BP_PDBGP table not getting updated

    Hi,
    i am working in Contract management in SRM 7.0 Pack 6. I have aadded a custom field in partner table which appears in the partner table of contract header. It is a checkbox. when i check it the value gets saved in BBPPDBGP table for the first time after that if i try to uncheck it the value is not getting updated. I checked in the BBP_DOC_CHANGE_BADI, the value which is getting passed is correct but it doesn't update the databse accordingly.
    Any suggestions? is this a standard bug?
    Neha

    Hi Virendra,
    Thanks a lot for your suggestion.
    Where should i check? If the data passing to BBP_DOC_CHANGE_BADI is correct then that means at the webdynpro side there should not be any problem and as per the standard after doc_change also it should save properly. i also checked the badi there is not dependent coding done over there. DOC_SAVE badi is also inactive for contract business object. Hence, i am not getting any clue where could be the problem.
    Let me know if you want more details inorder to analyse this problem.
    Thanks &Regards,
    Neha

  • I want to update date field in oracle table using database adaptor

    Hi Guys,
    I want to update date in oracle table field which is 'DATE' type , but i am getting following error.
    Pure SQL Exception.
    Pure SQL Execute of update crp3apps.IFACE_SO_DATE_CHANGES set PROCESSED_DATE=? where CTRL_ID=? failed. Caused by java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string
    The Pure SQL option is for border use cases only and provides simple yet minimal functionality. Possibly try the "Perform an operation on a table" option instead.
    </summary>
    </part>
    - <part name="detail">
    <detail>
    ORA-01830: date format picture ends before converting entire input string
    </detail>
    i am formated the date using following code and assigned to one variable.
    ora:formatDate(ora:getCurrentDateTime(),'dd-MMM-yyyy hh:mm:ss ')
    this is update query
    update crp3apps.IFACE_SO_DATE_CHANGES set PROCESSED_DATE=#date where CTRL_ID=#id
    Please provide solution.
    regards
    janardhan

    The thing is that XSLT often doesn't deliver the functionality required when it comes to times.
    You suggest appening "Z" to the time but this means that the time is now in UTC time. What if the system from where the date is being converted is running in NZ using local time? Other systems that recieve the date (and correctly handle the time zone) will now have a time that is out by a number of hours.
    You often can't ignore the time zone (drop the 'Z') as if you send the time to a system it has to either assume the time is local to it (which may not be the case... the other system coudl be in a different time zone) or assume the time is UTC (I think crossfire does this by default).
    Typically can't just append a time zone (e.g. +11:00) either as many places have daylight savings so the value to appended is variable (you then need some way of determining what the value is... either Java Embedding or a Service).
    As you mention it does depend on the use case but in many circumstances using Jaba Embedding, not as suggested above but with the appropriate Java.util.Calendar classes, is the best way to handle date and time in BPEL. Even still you need to ascertain the format of times external to the system and ensure you parse them correctly.
    ANd even if you do all this you can still run into problems. I've seen a real world example where two systems which both handled time zones correctly and had previously been working together for quite a while, satrted reporting different times. It turns out that only one of them had had the most recent Java Time Zone patches applied and there had been a change in the dates for daylight savings here (Australia). Be warned!

  • How to update field in table FAGLFLEXA/FAGLFLEXT

    Hi Gurus,
         we are stay in ECC 5.00. The new g/l have activated but we have not assigned the relevant scenario to the ledger (Refer note no 990612)
         now we have assinged following field:
         FIN_CCA: RCNTR (Cost center), SCNTR (Sender cost center)
         FIN_CONS: RASSC (Trading partner), RMVCT (Transaction Type)
         FIN_GSBER: RBUSA (Business area), SBUSA (Trading partner's business area)
         FIN_PCA: PRCTR (Profit Center), PPRCTR (Partner Profit Ctr)
         FIN_SEGM: SEGMENT (Segment), PSEGMENT (Partner segment)
         FIN_UKV: RFAREA (Functional Area), SFAREA (Partner Functional Area)
         our problem is the data was posted before that does not update fields in table FAGLFLEXA/FAGLFLEXT,How to update field in table FAGLFLEXA/FAGLFLEXT?
    Thanks,

    Hello Jenjira,
    Since this was a question asked few years back, I think you can share your experience with activation of a Scenario subsequent to Go-Live of new GL functionality (We are contemplating activation of one more scenario for Functional Area updation in new GL. 4 update scenarios were activated at time of New GL Implementation 4 years ago).
    Please share following:
    1. Impact of this subsequent activation on Open documents in the live system.
    2. How you addressed the issues arising on Point 1.
    3. Any support that you got from SAP Support Team on issues thereof.
    Any inputs will be of great help.

  • Value in cusotm subtotal field is not updating in LIS (S) tables

    Hello Experts,
    All the existing subtotal vlues (provided by SAP) we have consumed based on the pricing procedure's requriement and we have created a new Z subtotal field (like ZZKZWI11) in pricing, it is working fine and the values are getting updated in VBAP and VBRP tables under the Z subtotal field for all the transactions.
    I have included these new subtotal field in LIS table (S503 copy of S003).  But the values are not getting upated in LIS table (S503).  I have executing the statistical update of order and invoice with OLI7 and OLI9 transactions respectively.  The all the data is updating in the S503 table except the new subtotal field.
    Please let me know how to flow the data into this new subtotal field???
    Thanks,
    Sreehari.

    The same way like from any other custom field. Have you searched SCN for similar questions before posting? Google -> 'SIS custom field site:sap.com' finds this old post and others.
    SAP Help article was moved, here is the new link: http://help.sap.com/saphelp_46c/helpdata/en/fb/23ee347a34d111a4620060b03c3b0e/frameset.htm

  • Ideal way to update a field in a table

    Hi All,
    We need to update a field in a table which have some 8 million records.
    The value of the field needs to be updated in all the above mentioned records.
    Now, we have an input file with all the primary key fields and the field to be updated.
    Can any one suggest the ideal way to update the field.
    1.     Updating the database for each record.
    Loop at itab.
    Update…….
    Endloop.
    2.     Updating the database with a set of 100 records.
    We are planning to schedule the job in the background.
    Thanks for your help.
    Regards,
    Krishna

    Hi,
    be very carefull with the update, ´cause you can damage 8 million records !!
    You better use instruction Update for this:
    update mytable set field = value where conditions.
    Try to use all key fields in the conditions and never use something like
    update mytable set: field1 = value1
                        field2 = value2
                        field3 = value3 where conditions.
    The loop in your case 1 is not absolutely necessary, ´cause you update a whole bunch of records at once with the conditions in Update.
    Test the changes in the development system before you do it in production

Maybe you are looking for

  • INDesgin image links broken after saving file across systems

    Hi We have a scenario involving 3 components: 1. Linux file server running both SMB and AFP (sharing the same directory thru both protocols) 2. MacOS 10.5 (Leopard) with INDesign CS3 connecting to the Linux server thru AFP 3. Windows 2003 server runn

  • How can I update iLife on my new MBA 11" i7?

    I just purchased a fully loaded MBA yesterday.  When attempting to upgrade the software, I noticed iTunes and Remote Desktop but that's all.  After logging into the AppStore to download previously purchased items, I noticed updates were available for

  • Installing SJE Web server 6.1 on HP-UX  PA_RISC 11i

    I am trying to install SJE Web server 6.1 on HP-UX PA_RISC 11i; as i install all the related packages and resourcse at HP and try the install again but it keep on gigving me this error. Any body have tried sucessfull clean install on this version of

  • LMS 3.2 Common Services User Defined Groups problem

    CiscoWorks LMS 3.2 is installed on Windows 2008 64-bit server. All devices are added into appropriate User defined group in Groups/Common Services. All groups are fine except that Members of group named Switch-HO-access have been copied also to group

  • Cancel J1IS Excise Invoice

    Dear All, I have created an outgoing Excise Invoice through J1IS and also POsted it.. But due to some reason, i have to Cancel the Excise Invoice Document that was created.. So i went to J1IS and Cancelled the Excise INvoice. The Excise Invoice shows