How to debug and find the exact constraint violation error

{122712 14:22:36:ErrorCode -1 with ErrorMessage as ORA-00001: unique constraint (OPS$CMS.PK_TB_ML_EXER_UPLOAD) violated has occured for [SSO16063259009], [CMSCOST_USER] pk_xop_subsales.pr_process_exer }
{PROCEDURE pr_process_exer(
p_voucher_num           tb_xop_order_manager_t.voucher_num%TYPE,
p_status_type           tb_xop_order_manager_t.status_type%type,
p_dest                    tb_xop_order_manager_t.dest%type,
p_reference_key            tb_xop_order_manager_t.reference_key%type,
p_seq_num                tb_xop_order_manager_t.seq_num%type,
p_return_code            tb_xop_order_manager_t.return_code%type,
p_reason_desc           tb_xop_order_manager_t.reason_desc%type,
p_activity_qty            tb_xop_order_manager_t.activity_qty%type,
p_leaves_qty            tb_xop_order_manager_t.leaves_qty%type,
p_exec_price            tb_xop_order_manager_t.exec_price%type,
p_current_status        tb_xop_order_manager_t.current_status%type,
p_err_cur          OUT  ref_cursor)
IS
CURSOR get_order_dtls(v_voucher_num tb_xop_order_manager_t.voucher_num%type)
IS
SELECT *
FROM   tb_xop_order_manager_t
WHERE  voucher_num = v_voucher_num;
CURSOR get_mail_cd(v_opt_num OPTIONEE.opt_num%TYPE) IS
      SELECT mail_cd, sp_mail_cd
      FROM XOP_OPTIONEE
      WHERE opt_num = v_opt_num;
cursor get_opt_dtls(v_opt_num OPTIONEE.opt_num%TYPE) IS
select
SUBSTR(trim(O.name_first) || ' ' || trim(O.name_mi) || ' ' ||
          trim(O.name_last), 1, 35) p_name,
        SUBSTR(O.address1, 1, 35) opt_addr1,
          SUBSTR(O.address2, 1, 35) opt_addr2,
          SUBSTR(O.address3, 1, 35) opt_addr3,
          SUBSTR(O.address4, 1, 35) opt_addr4,
          SUBSTR(O.address5, 1, 35) opt_addr5,
          SUBSTR(O.address6, 1, 35) opt_addr6,
        SUBSTR(trim(O.city) || ' ' || trim(O.state) || ' ' ||
        trim(O.zip) || ' ' || trim(O.country), 1, 35) city_state_zip_country,
        trim(O.city) city,
        trim(O.state) state,
        trim(O.zip) zip,
        trim(O.country) country
from  optionee o
where o.opt_num = v_opt_num;
--CQ:PCTUP00210726- Added wire instructions audit for deleted wire info.
CURSOR c_wire_instruction (
      in_wire_seq_no           TB_XOP_WIRE_INSTRUCTIONS.wire_seq_no%TYPE ) IS
      SELECT ml_brok_acct_num,
             ssn,
             plan_num,
             instr_type,
             aba_routing_num,
             swift_routing_code,
             bank_name,
             bank_acct_num,
             name_on_account,
             bank_addr_1,
             bank_addr_2,
             bank_addr_3,
             city,
             state,
             country,
             zip,
             bank_ident_num,
             addtl_info
        FROM TB_XOP_WIRE_INSTRUCTIONS
       WHERE wire_seq_no = in_wire_seq_no
       UNION
       SELECT ml_brok_acct_num,
             ssn,
             plan_num,
             instr_type,
             aba_routing_num,
             swift_routing_code,
             bank_name,
             bank_acct_num,
             name_on_account,
             bank_addr_1,
             bank_addr_2,
             bank_addr_3,
             city,
             state,
             country,
             zip,
             bank_ident_num,
             addtl_info
        FROM TB_XOP_WIRE_INSTRUCTIONS_AUDIT
       WHERE wire_seq_no = in_wire_seq_no;
CURSOR c_order_qty IS
SELECT order_qty
FROM tb_xop_order_manager
WHERE voucher_num = p_voucher_num;
v_order_qty     tb_xop_order_manager.order_qty%TYPE;
v_wire_instruction             c_wire_instruction%ROWTYPE;
v_order_dtls      get_order_dtls%rowtype;
v_opt_dtls        get_opt_dtls%rowtype;
v_settle_dt       tb_ml_exer_upload.settle_dt%type;
v_cusip_num       corp.cusip_num%type;
v_err_cd          number(12):=0;
v_err_msg         varchar2(4000);
v_compy_nme       tb_fc_Compy.compy_nme%type;
v_ml_sec_num      tb_fc_compy.ml_sec_num%type;
v_mail_cd         xop_optionee.mail_cd%type;
v_count1            PLS_INTEGER := 0;
v_sum_activity_qty  tb_xop_order_manager_t.activity_qty%TYPE;
v_transact_no       PLS_INTEGER;
v_ivr_plan_num      tb_fc_compy.ivr_plan_num%TYPE;
wait_for_more       EXCEPTION;
exceeds_order_qty   EXCEPTION;
--Added for CQ# PCTUP00481233
v_sub_totfee number;
v_sub_fixedfee1 number;
v_sub_fixedfee2 number;
v_sub_fixedfee3 number;
v_sub_secfee number;
v_sub_feenum number;
--Added for CQ# PCTUP00481233
v_fixedfee1 tb_xop_order_manager_t.fixed_fee1%TYPE; --SPIF# 43161- variable to hold fixed fee1
BEGIN
    OPEN c_order_qty;
    FETCH c_order_qty INTO v_order_qty;
    CLOSE c_order_qty;
    dbms.output.put_line('completed1');
    IF v_order_qty <> p_activity_qty THEN
      dbms.output.put_line('completed2');
        IF p_status_type = 'EO' AND v_order_qty < p_activity_qty THEN
            RAISE exceeds_order_qty;
              dbms.output.put_line('completed3');
        ELSIF p_status_type = 'EO' AND v_order_qty > p_activity_qty THEN
            -- Partial Execution
            INSERT INTO tb_xop_hold_multi_orders
                ( voucher_num
                , reference_key
                , seq_num
                , return_code
                , reason_desc
                , status_type
                , activity_qty
                , leaves_qty
                , exec_price
                , current_status
                , waiting
                ,activ_dt )
            VALUES
                ( p_voucher_num
                , p_reference_key
                , p_seq_num
                , p_return_code
                , p_reason_desc
                , p_status_type
                , p_activity_qty
                , p_leaves_qty
                , p_exec_price
                , p_current_status
                , 'Y'
                ,SYSTIMESTAMP );
                  dbms.output.put_line('completed4');
        ELSE
            IF p_status_type = 'BE' THEN
                SELECT COUNT(1) INTO v_count1
                FROM tb_xop_hold_multi_orders
                WHERE voucher_num = p_voucher_num;
                  dbms.output.put_line('completed5');
                IF v_count1 > 0 THEN
                    INSERT INTO tb_xop_hold_multi_orders
                        ( voucher_num
                        , reference_key
                        , seq_num
                        , return_code
                        , reason_desc
                        , status_type
                        , activity_qty
                        , leaves_qty
                        , exec_price
                        , current_status
                        , waiting
                        ,activ_dt)
                    VALUES
                        ( p_voucher_num
                        , p_reference_key
                        , p_seq_num
                        , p_return_code
                        , p_reason_desc
                        , p_status_type
                        , (-1) * p_activity_qty
                        , p_leaves_qty
                        , p_exec_price
                        , p_current_status
                        , 'Y'
                        ,SYSTIMESTAMP );
                    UPDATE tb_xop_hold_multi_orders
                    SET waiting = 'Y'
                    WHERE voucher_num = p_voucher_num;
                      dbms.output.put_line('completed6');
                END IF;
            END IF;
        END IF;
          dbms.output.put_line('completed7');
        SELECT SUM(NVL(activity_qty,0)) INTO v_sum_activity_qty
        FROM tb_xop_hold_multi_orders
        WHERE waiting = 'Y'
        AND voucher_num = p_voucher_num;
        IF v_sum_activity_qty > 0 THEN
            IF v_sum_activity_qty <> v_order_qty THEN
                RAISE wait_for_more;
            ELSE
                -- final order in the partial execution; complete the process
                UPDATE tb_xop_hold_multi_orders
                SET waiting = 'N'
                    , process_dt = SYSDATE
                WHERE voucher_num = p_voucher_num;
            END IF;
        END IF;
    END IF;
    UPDATE tb_xop_order_manager_t
    SET activ_dt = TO_CHAR( SYSDATE, 'YYYY-MM-DD HH24:MI:SS' ) || '.000'
        , dest = p_dest
        , reference_key = p_reference_key
        , seq_num = p_seq_num
        , return_code = p_return_code
        , reason_desc = p_reason_desc
        , status_type = p_status_type
        , activity_qty = v_order_qty --p_activity_qty
        , leaves_qty = 0 --p_leaves_qty
        , exec_price = p_exec_price
    WHERE voucher_num = p_voucher_num;
    dbms.output.put_line('completed8');
     * SPIF# 43161- Update of current status to PO moved at the end, same as how PROD works.
IF (p_status_type = 'EO') THEN
  BEGIN
    select cusip_num
      into   v_cusip_num
      from   corp;
  EXCEPTION
      WHEN NO_DATA_FOUND THEN
          SELECT cusip_num
            INTO v_cusip_num
            FROM tb_xop_espp_compy
           WHERE compy_acronym = replace(replace(user,'CMS'),'_USER');
      WHEN OTHERS THEN
          NULL;
  END;
   select compy_nme,ml_sec_num, ivr_plan_num
   into   v_compy_nme,v_ml_sec_num, v_ivr_plan_num
   from   tb_fc_compy
   where compy_acronym = replace(replace(user,'CMS'),'_USER')
   UNION ALL
   select compy_nme, je_ml_security_number, ivr_plan_num
   from tb_xop_espp_compy
   where compy_acronym = replace(replace(user,'CMS'),'_USER');
--   where  ivr_plan_num = replace(substr(p_voucher_num,1,7),'SSO','XOP');
  open get_order_dtls(p_voucher_num);
  FETCH get_order_dtls INTO v_order_dtls;
   v_settle_dt := fn_xop_bankopen_bizday(TRUNC(v_order_dtls.exer_date + 1));
   v_settle_dt := fn_xop_bankopen_bizday(TRUNC(v_settle_dt + 1));
   v_settle_dt := fn_xop_bankopen_bizday(TRUNC(v_settle_dt + 1));
   FOR c_mail_cd IN get_mail_cd(v_order_dtls.opt_num)
   LOOP
     v_mail_cd := c_mail_cd.mail_cd;
     -- Do we need to get sp_mail_cd and overlay with the sp_mail_cd in order_manager_t???
   END LOOP;
   OPEN get_opt_dtls(v_order_dtls.opt_num);
   FETCH get_opt_dtls INTO v_opt_dtls;
   CLOSE get_opt_dtls;
  v_fixedfee1 := nvl(v_order_dtls.fixed_fee1, 0);
   * SPIF# 43161- atleast one handling fee per day of transaction
  v_fixedfee1 := pk_xop_enh_exerupdate.chrg_tranxfixed_fee(v_fixedfee1,
                                                           v_order_dtls.symbol,
                                                           v_order_dtls.corp_acronym,
                                                           v_order_dtls.opt_num);
  --Insert into tb_ml_exer_upload
  --Added for CQ# PCTUP00481233
   Pk_Xop_Transactmodel.GET_FEE(v_order_dtls.GROUP_ID,v_order_dtls.SVC_ID,'SQ',v_order_dtls.opts_exer,
                                round(v_order_dtls.exec_price, 4),v_sub_totfee,v_sub_fixedfee2,v_sub_fixedfee1,
                                v_sub_fixedfee3,v_sub_secfee,v_sub_feenum,lpad(v_order_dtls.ssn,9,0));
   v_order_dtls.sec_fee:=v_sub_secfee;
   UPDATE tb_xop_order_manager_t
    SET sec_fee=v_sub_secfee
    WHERE voucher_num = p_voucher_num;
    dbms.output.put_line('completed8');
  --- End CQ # PCTUP00481233
  INSERT INTO tb_ml_exer_upload
                        (exer_num,exer_seq,
                         exer_dt, written_flag, backout_flag, output_line,
                         je_flag, opts_exer,
                         tot_tax,shrs_sold,comm_value,tot_fee,
                         mkt_prc,exer_type, soc_sec,
                         name_first, name_mi,
                         name_last,check_addr_1,check_addr_2,check_addr_3,
                         check_addr_4,check_addr_5,city,state,zip,country,
                         city_state_zip_country,
                         p_name,opt_addr1,opt_addr2,opt_addr3,opt_addr4,
                         opt_addr5,opt_addr6,
                         settle_dt,send_to_citibank_flag,
                         dom_chek_distr,foreign_currency_code,
                         distribution_method,wire_seq_no,
                         cusip_num, ml_retail_account,multi_curr_handling_fee,
                         ml_sec_num, corp_name,upd_optionee_addr,
                         outbound_flag, -- make it N
                         corp_symbol,taxwire_approve, -- make it not applicaplabe
                         exersource,
                         mail_cd, sp_mail_cd,
                         backup_withholding,
                         user_id,
                         acct_num_othr)
   VALUES(v_order_dtls.exer_num,0,v_order_dtls.exer_date,'N','N',NULL,
-- PG 12/12/05 Changed to populate the je_flag based on dom_chek_distr         'D',
-- PG 12/16/05 JE should not be generated for international checks.. So 'Y' always
          'Y', --je_flag
          v_order_dtls.opts_exer,0,--total tax will be 0.
          v_order_dtls.opts_exer, --shrs_sold,
          v_order_dtls.comm_value,
          --SPIF# 43161- replaced nvl(v_order_dtls.fixed_fee1, 0) with v_fixedfee1
          v_fixedfee1 + nvl(v_order_dtls.fixed_fee3,0) + nvl(v_order_dtls.sec_fee,0), --v_order_dtls.fees_amt,
          round(v_order_dtls.exec_price, 4),v_order_dtls.exer_type,
          LPAD(v_order_dtls.ssn,9,'0'), --v_order_dtls.ssn, Modified by Suresh on 02/08/07 for SPIF # 37210
          v_order_dtls.name_first,v_order_dtls.name_mi,v_order_dtls.name_last,
          v_order_dtls.check_addr_1,v_order_dtls.check_addr_2,v_order_dtls.check_addr_3,
          v_order_dtls.check_addr_4,v_order_dtls.check_addr_5,nvl(v_order_dtls.city,v_opt_dtls.city),
          nvl(v_order_dtls.state,v_opt_dtls.state),nvl(v_order_dtls.zip,v_opt_dtls.zip),
          nvl(v_order_dtls.country,v_opt_dtls.country),
          SUBSTR(nvl(v_order_dtls.city||v_order_dtls.state||v_order_dtls.zip||v_order_dtls.country,
              v_opt_dtls.city_state_zip_country),1,34), -- COLUMN LENGTH MAX IS 35
          v_opt_dtls.p_name,v_opt_dtls.opt_addr1,v_opt_dtls.opt_addr2,v_opt_dtls.opt_addr3,
          v_opt_dtls.opt_addr4,v_opt_dtls.opt_addr5,v_opt_dtls.opt_addr6,
          v_settle_dt,decode(v_order_dtls.distribution_method,'W','Y','D','Y','C','Y','D'),
          v_order_dtls.dom_chek_distr,v_order_dtls.foreign_currency_code,
          v_order_dtls.distribution_method,v_order_dtls.wire_seq_no,
          v_cusip_num,v_order_dtls.acct_num,v_order_dtls.multi_curr_handling_fee,
--          nvl(fn_get_sec_num(replace(substr(p_voucher_num,1,7),'SSO','XOP'),v_order_dtls.symbol),v_ml_sec_num),
          nvl(fn_get_sec_num(v_ivr_plan_num, v_order_dtls.symbol),v_ml_sec_num),
          v_compy_nme,v_order_dtls.upd_optionee_addr,
          'N', --'N' is for outbound flag.
          v_order_dtls.symbol,'D', --'D' for taxwires disabled
          'S', -- 'S' for source being subsequent sale.
          v_mail_cd,  --need to get mail_Cd??
          v_order_dtls.sp_mail_cd,v_order_dtls.backup_withholding,
          user,v_order_dtls.acct_num_othr);
IF (NVL(v_order_dtls.wire_seq_no,0) > 0) THEN
   OPEN c_wire_instruction(v_order_dtls.wire_seq_no);
   FETCH c_wire_instruction INTO v_wire_instruction;
   CLOSE c_wire_instruction;
  INSERT INTO TB_XOP_TRANSACT_WIRE_INSTR
                       (user_id, exer_num, wire_seq_no, ml_brok_acct_num, ssn,
                        plan_num, instr_type, aba_routing_num,
                        swift_routing_code, bank_name, bank_acct_num,
                        name_on_account, bank_addr_1, bank_addr_2, bank_addr_3,
                        city, state, country, zip, bank_ident_num, addtl_info )
                    VALUES
                       (USER,v_order_dtls.exer_num, v_order_dtls.wire_seq_no,
                        v_wire_instruction.ml_brok_acct_num, v_wire_instruction.ssn,
                        v_wire_instruction.plan_num, v_wire_instruction.instr_type, v_wire_instruction.aba_routing_num,
                        v_wire_instruction.swift_routing_code, v_wire_instruction.bank_name, v_wire_instruction.bank_acct_num,
                        v_wire_instruction.name_on_account, v_wire_instruction.bank_addr_1, v_wire_instruction.bank_addr_2,
                        v_wire_instruction.bank_addr_3, v_wire_instruction.city, v_wire_instruction.state, v_wire_instruction.country, v_wire_instruction.zip,
                         v_wire_instruction.bank_ident_num, v_wire_instruction.addtl_info);
        dbms.output.put_line('completed10');
END IF;
/* PG 01/05/06 Call the check conversion only for international checks and wires */
IF v_order_dtls.dom_chek_distr = 'N' AND v_order_dtls.distribution_method IN ('W', 'D', 'C') THEN
    /* PG 12/20/05 To process subsequent sales with wire or foreign currency distribution */
     v_transact_no := 88;
     pk_xop_citibank_forex.pr_cashconversion_ins_request( v_order_dtls.acct_num
                                                          , LPAD(v_order_dtls.ssn,9,'0') --v_order_dtls.ssn, Modified by Suresh on 02/15/07 for SPIF # 37210
                                                          , v_order_dtls.distribution_method
                                                          , v_order_dtls.foreign_currency_code
                                                          , v_order_dtls.wire_seq_no
                                                          , ROUND((v_order_dtls.opts_exer * round(v_order_dtls.exec_price, 4)),2)
                                                            - ROUND(v_order_dtls.comm_value,2)
                                                            - ROUND(nvl(v_order_dtls.fixed_fee1,0) + nvl(v_order_dtls.fixed_fee3,0) + nvl(v_order_dtls.sec_fee,0),2)
                                                            - nvl(v_order_dtls.multi_curr_handling_fee,0)
                                                            - nvl(v_order_dtls.backup_withholding,0) -- net proceeds
                                                          , v_order_dtls.multi_curr_handling_fee --handling fee
                --Modified by Bhaskar/Suresh on 03/02/2006    --, v_order_dtls.login_name
                                                          , CASE v_order_dtls.login_name WHEN 'CLIENT/' THEN v_order_dtls.login_name||'SSO' ELSE v_order_dtls.login_name||'/SSO' END
                                                          , v_transact_no -- transact_no as place holder for exer_type 88
                                                          , v_order_dtls.check_addr_1
                                                          , v_order_dtls.check_addr_2
                                                          , v_order_dtls.check_addr_3
                                                          , v_order_dtls.check_addr_4
                                                          , v_order_dtls.upd_optionee_addr
                                                          , v_order_dtls.city
                                                          , v_order_dtls.state
                                                          , v_order_dtls.zip
                                                          , v_order_dtls.country
                                                          , v_order_dtls.login_ipaddress
                                                          , v_order_dtls.fcnum
                                                          , v_order_dtls.opt_num
                                                          , v_settle_dt,
                                                          p_exer_num => v_order_dtls.exer_num
END IF;
COMMIT;
close get_order_dtls;
END IF;
  * SPIF# 43161- Update to current status into PO is moved to this part, same as PROD.
UPDATE tb_xop_order_manager_t
SET exec_dttime = decode(p_status_type,'EO',to_char(sysdate,'DD-MON-YYYY HH24:mi:ss'),null)
     , exer_date  = TRUNC(SYSDATE)
     , cancel_dttime = decode(p_status_type,'CX',to_char(sysdate,'DD-MON-YYYY HH24:mi:ss'),'UR',to_char(sysdate,'DD-MON-YYYY HH24:mi:ss'),null)
     , current_status = 'PO'
     , sum_status = decode(p_status_type,'EO','X','C')
     , sum_stat_dttime = SYSDATE
WHERE voucher_num = p_voucher_num;
      v_err_cd := sqlcode;
      v_err_msg := sqlerrm;
      open p_err_cur for select v_err_cd err_code,v_err_msg err_msg from dual;
EXCEPTION
        dbms.output.put_line('completed200');
/* PG 02/10 handled 'partial fill order' exception */
  when wait_for_more then
      v_err_cd := 0;
      v_err_msg := 'ORA-0000: normal, successful completion';
      pr_xop_log_errors('Partially filled; Waiting for more - Activity qty:' || to_char(v_sum_activity_qty)|| ' pk_xop_subsales.pr_process_exer');
      open p_err_cur for select v_err_cd err_code,v_err_msg err_msg from dual;
  when exceeds_order_qty then
      v_err_cd := sqlcode;
      v_err_msg := sqlerrm;
      open p_err_cur for select v_err_cd err_code,v_err_msg err_msg from dual;
      pr_xop_log_errors('Activity quantity exceeded the Order_qty - Activity qty: ' || to_char(p_activity_qty) || ' pk_xop_subsales.pr_process_exer');
  when others then
      v_err_cd := sqlcode;
      v_err_msg := sqlerrm;
      open p_err_cur for select v_err_cd err_code,v_err_msg err_msg from dual;
      pr_xop_log_errors('ErrorCode '||SQLCODE||' with ErrorMessage as '||SQLERRM||' has occured for '||user||'pk_xop_subsales.pr_process_exer');
            dbms.output.put_line('completed125');
END pr_process_exer;
Hi friends, any1 help me out how to define the ref-cursor in declaration section, and how to find at what situation the constraint error occurred..

956684 wrote:
Hi,.
Friends plz help me out ..how to debug and find the exact position of the constraint violation..thank you for the help..There isn't a way to trace it unless you have caught the exception raised.
As a way to start the debug, you will have to monitor
1. All DML's against the Table on which you have constraint. More specifically, the DML's that act on the column you have constraint on.
2. Use Exception Handling, to log the Error and the data that causes the constraint to fail.
3. Do not forget to monitor the Triggers, if they are used, that would write some data into the column you have constraint on.
Or
Another way to trace is:
select *
  from user_source
where lower(text) like '%your_table_name%';
order by type, name, line;Look at the lines, exclude that are in Declaration or in SELECT statements and target the DML's.
Looking at the un-formatted code you posted, this statement looks like a culprit.
INSERT INTO tb_ml_exer_upload
(exer_num,exer_seq,
exer_dt, written_flag, backout_flag, output_line,
je_flag, opts_exer,
tot_tax,shrs_sold,comm_value,tot_fee,
mkt_prc,exer_type, soc_sec,
name_first, name_mi,
name_last,check_addr_1,check_addr_2,check_addr_3,
check_addr_4,check_addr_5,city,state,zip,country,
city_state_zip_country,
p_name,opt_addr1,opt_addr2,opt_addr3,opt_addr4,
opt_addr5,opt_addr6,
settle_dt,send_to_citibank_flag,
dom_chek_distr,foreign_currency_code,
distribution_method,wire_seq_no,
cusip_num, ml_retail_account,multi_curr_handling_fee,
ml_sec_num, corp_name,upd_optionee_addr,
outbound_flag, -- make it N
corp_symbol,taxwire_approve, -- make it not applicaplabe
exersource,
mail_cd, sp_mail_cd,
backup_withholding,
user_id,
acct_num_othr)
VALUES(v_order_dtls.exer_num,0,v_order_dtls.exer_date,'N','N',NULL,
-- PG 12/12/05 Changed to populate the je_flag based on dom_chek_distr 'D',
-- PG 12/16/05 JE should not be generated for international checks.. So 'Y' always
'Y', --je_flag
v_order_dtls.opts_exer,0,--total tax will be 0.
v_order_dtls.opts_exer, --shrs_sold,
v_order_dtls.comm_value,
--SPIF# 43161- replaced nvl(v_order_dtls.fixed_fee1, 0) with v_fixedfee1
v_fixedfee1 + nvl(v_order_dtls.fixed_fee3,0) + nvl(v_order_dtls.sec_fee,0), --v_order_dtls.fees_amt,
round(v_order_dtls.exec_price, 4),v_order_dtls.exer_type,
LPAD(v_order_dtls.ssn,9,'0'), --v_order_dtls.ssn, Modified by Suresh on 02/08/07 for SPIF # 37210
v_order_dtls.name_first,v_order_dtls.name_mi,v_order_dtls.name_last,
v_order_dtls.check_addr_1,v_order_dtls.check_addr_2,v_order_dtls.check_addr_3,
v_order_dtls.check_addr_4,v_order_dtls.check_addr_5,nvl(v_order_dtls.city,v_opt_dtls.city),
nvl(v_order_dtls.state,v_opt_dtls.state),nvl(v_order_dtls.zip,v_opt_dtls.zip),
nvl(v_order_dtls.country,v_opt_dtls.country),
SUBSTR(nvl(v_order_dtls.city||v_order_dtls.state||v_order_dtls.zip||v_order_dtls.country,
v_opt_dtls.city_state_zip_country),1,34), -- COLUMN LENGTH MAX IS 35
v_opt_dtls.p_name,v_opt_dtls.opt_addr1,v_opt_dtls.opt_addr2,v_opt_dtls.opt_addr3,
v_opt_dtls.opt_addr4,v_opt_dtls.opt_addr5,v_opt_dtls.opt_addr6,
v_settle_dt,decode(v_order_dtls.distribution_method,'W','Y','D','Y','C','Y','D'),
v_order_dtls.dom_chek_distr,v_order_dtls.foreign_currency_code,
v_order_dtls.distribution_method,v_order_dtls.wire_seq_no,
v_cusip_num,v_order_dtls.acct_num,v_order_dtls.multi_curr_handling_fee,
-- nvl(fn_get_sec_num(replace(substr(p_voucher_num,1,7),'SSO','XOP'),v_order_dtls.symbol),v_ml_sec_num),
nvl(fn_get_sec_num(v_ivr_plan_num, v_order_dtls.symbol),v_ml_sec_num),
v_compy_nme,v_order_dtls.upd_optionee_addr,
'N', --'N' is for outbound flag.
v_order_dtls.symbol,'D', --'D' for taxwires disabled
'S', -- 'S' for source being subsequent sale.
v_mail_cd, --need to get mail_Cd??
v_order_dtls.sp_mail_cd,v_order_dtls.backup_withholding,
user,v_order_dtls.acct_num_othr);What is the Table structure of tb_ml_exer_upload and what columns do you have constraints on?
Which column of the table tb_ml_exer_upload is your Primary Key (because constraint name mentions pk_tb_ml_exer_upload)?
Edited by: Purvesh K on Jan 4, 2013 12:57 PM

Similar Messages

  • How to find the exact user exit in enhancement.

    Hi All,
    I am in learning phase. I am working on TCODE VA01 and want to change the PO Date. But i am unable to find out the exact user exit.  If somebody could guide me that what is the procedure to find the exact user exit for a perticular field or like that.  I am know how to find all the enhancements in the TCODE.

    hi
    Run this program and give the tcode and it will list down all the user exits for that Tcode.
    REPORT z_find_userexit NO STANDARD PAGE HEADING.
    TABLES : tstc, tadir,            modsapt,            modact,            trdir,             tfdir,      enlfdir,     tstct.   
    DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
    DATA : field1(30).
    DATA : v_devclass LIKE tadir-devclass.
    SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK a01.
    START-OF-SELECTION.
      SELECT SINGLE * FROM tstc    WHERE tcode EQ p_tcode.
      IF sy-subrc EQ 0.
        SELECT SINGLE * FROM tadir       WHERE pgmid    = 'R3TR'         AND object   = 'PROG'
             AND obj_name = tstc-pgmna.
        MOVE : tadir-devclass TO v_devclass.
        IF sy-subrc NE 0.
          SELECT SINGLE * FROM trdir         WHERE name = tstc-pgmna.
          IF trdir-subc EQ 'F'.
            SELECT SINGLE * FROM tfdir          WHERE pname = tstc-pgmna.
            SELECT SINGLE * FROM enlfdir          WHERE funcname = tfdir-funcname.
            SELECT SINGLE * FROM tadir          WHERE pgmid    = 'R3TR'            AND object   = 'FUGR'
                AND obj_name = enlfdir-area.
            MOVE : tadir-devclass TO v_devclass.
          ENDIF.
        ENDIF.
        SELECT * FROM tadir      INTO TABLE jtab      WHERE pgmid    = 'R3TR'        AND object   = 'SMOD'
            AND devclass = v_devclass.
        SELECT SINGLE * FROM tstct      WHERE sprsl EQ sy-langu        AND tcode EQ p_tcode.
        FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
        WRITE:/(19) 'Transaction Code - ',    20(20) p_tcode,    45(50) tstct-ttext.    SKIP.
        IF NOT jtab[] IS INITIAL.
          WRITE:/(95) sy-uline.
          FORMAT COLOR COL_HEADING INTENSIFIED ON.
          WRITE:/1 sy-vline,      2 'Exit Name',      21 sy-vline ,      22 'Description',      95 sy-vline.
          WRITE:/(95) sy-uline.
          LOOP AT jtab.
            SELECT SINGLE * FROM modsapt        WHERE sprsl = sy-langu AND        name = jtab-obj_name.
            FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
            WRITE:/1 sy-vline,   2 jtab-obj_name HOTSPOT ON,  21 sy-vline , 22 modsapt-modtext, 95 sy-vline.
          ENDLOOP.
          WRITE:/(95) sy-uline.
          DESCRIBE TABLE jtab.
         SKIP.
         FORMAT COLOR COL_TOTAL INTENSIFIED ON.
          WRITE:/ 'No of Exits:' , sy-tfill.
        ELSE.
          FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
          WRITE:/(95) 'No User Exit exists'.
        ENDIF.
      ELSE.
        FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
        WRITE:/(95) 'Transaction Code Does Not Exist'.
      ENDIF.
    AT LINE-SELECTION.
      GET CURSOR FIELD field1.
      CHECK field1(4) EQ 'JTAB'.
      SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
      CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    Regards
    Sajid
    Edited by: shaik sajid on Jun 26, 2009 12:06 PM
    Edited by: shaik sajid on Jun 26, 2009 12:10 PM

  • How to find the exact user exit for our requirement?

    Dear Mr. keerthi,
    can you please explain me how to find the exact user exit for our requirement?

    Hi sandip
    There is more than one method in which you can check for user-exits.The following method is used very often.
    <b>How to find the exact user-exit for your requirement.</b>
    1.     You can check the user exists using transaction SE85.
    2.     Repository Information System -> Enhancements -> Customer exits
    3.     You can search the user-exits by package name.
    4.     Double click on each exit name to check the function module exits.
    <b>The procedure to find the package name.</b>
    Execute transaction SE93 
    Enter the tcode of the transaction for which you want to check the user exit.
    Example: if you want to find the user-exit for purchase orders while changing, enter ME22n  and press display.
    You will get to see the package name
    But you need to confirm that the user exit will get triggered at the appropriate event.
    ( example: you might want some validations to be done ON SAVE of a purchase order)
    <b>Checking if the user-exit is getting triggered or not.</b>
    1.     Open the user exit function module (that you have got in step 4) in Tcode SE37.
    2.     Click on where used button. In the pop up that immediately appears choose only programs .
    3.     You will get a list of programs. Double click on the program name.
    4.     You will get the list of location where this function module user exit is used.
    5.     Place session break points at each of these location ( at each CALL FUNCTION statement)
    6.     Now go to your transaction ( say change purchase order tcode:Me22n) and check if the user exit is getting triggered on appropriate event.
    regards,
    Prasad

  • How to find the exact package that I need?

    How can I find the exact package that I need, for example, in Ubuntu, I can add launcher in System -> Preferences -> Main Menu, but in Arch, I can not find this Main Menu, I know I need to install something, but don't know where to go?

    Ghost1227 wrote:depends... where are you now?
    LOL
    pacman -Ss <package-name>
    would help you out. You can also put in part of the name and it will return all the matches. As for a GUI -- you don't get that by default in Arch.
    There is a GUI wrapper for pacman called shaman, but iirc, it uses kdelibs and integrates well with KDE. It looks like you are using Gnome, but you can use shaman in Gnome too.

  • How can i find the exact BADI For a Particular Transaction

    hi ppl,
    How can i find the exact BADI For a Particular Transaction. Is there any Standard transaction or Programs to do this or suggest some other way.

    Use this code:
    *& Report  ZGET_BADI
    REPORT  ZGET_BADI.
    TABLES : TSTC,
    TADIR,
    MODSAPT,
    MODACT,
    TRDIR,
    TFDIR,
    ENLFDIR,
    SXS_ATTRT ,
    TSTCT.
    DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA : FIELD1(30).
    DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS : P_TCODE LIKE TSTC-TCODE,
    P_PGMNA LIKE TSTC-PGMNA .
    DATA wa_tadir type tadir.
    START-OF-SELECTION.
    IF NOT P_TCODE IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    ELSEIF NOT P_PGMNA IS INITIAL.
    TSTC-PGMNA = P_PGMNA.
    ENDIF.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'PROG'
    AND OBJ_NAME = TSTC-PGMNA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM TRDIR
    WHERE NAME = TSTC-PGMNA.
    IF TRDIR-SUBC EQ 'F'.
    SELECT SINGLE * FROM TFDIR
    WHERE PNAME = TSTC-PGMNA.
    SELECT SINGLE * FROM ENLFDIR
    WHERE FUNCNAME = TFDIR-FUNCNAME.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'FUGR'
    AND OBJ_NAME EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT in ('SMOD', 'SXSD')
    AND DEVCLASS = V_DEVCLASS.
    SELECT SINGLE * FROM TSTCT
    WHERE SPRSL EQ SY-LANGU
    AND TCODE EQ P_TCODE.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
    WRITE:/(105) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    *Sorting the internal Table
    sort jtab by OBJECT.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type C.
    clear : wf_smod, wf_badi , wf_object2.
    *Get the total SMOD.
    LOOP AT JTAB into wa_tadir.
    at first.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Enhancement/ Business Add-in',
    41 SY-VLINE ,
    42 'Description',
    105 SY-VLINE.
    WRITE:/(105) SY-ULINE.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 wf_object2,
    105 SY-VLINE.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE MODTEXT into wf_txt
    FROM MODSAPT
    WHERE SPRSL = SY-LANGU
    AND NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    when 'SXSD'.
    *For BADis
    wf_badi = wf_badi + 1 .
    select single TEXT into wf_txt
    from SXS_ATTRT
    where sprsl = sy-langu
    and EXIT_NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    endcase.
    WRITE:/1 SY-VLINE,
    2 wa_tadir-OBJ_NAME hotspot on,
    41 SY-VLINE ,
    42 wf_txt,
    105 SY-VLINE.
    AT END OF object.
    write : /(105) sy-ULINE.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) SY-ULINE.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    data : wf_object type tadir-object.
    clear wf_object.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(8) EQ 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    when 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
    endcase.
    Regards
    Vinayak

  • I have multiple iPhoto libraries w/ duplicates in several. How can I consolidate and find the dupes? Some photos are versions of the original.

    I have multiple iPhoto libraries w/ duplicates in several. How can I consolidate and find the dupes? Some photos are versions of the original. On my iMac, I also have many folders containing some of the same photos. My computer is used for both personal and business purposes. My libraries should be separated, one for each.

    To merge libraries use iPhoto Library Manager - http://www.fatcatsoftware.com/iplm/ -  or Aperature
    To find duplicates within an iPhoto library use iPhoto Library Manager - http://www.fatcatsoftware.com/iplm/ - 
    Photos that are not in an iPhoto library can be imported telling iPhoto not to import duplicates (an imperfect procews) and then IPLM can find the duplicates
    As to keeping seperate libraries - only you can do that - IPLM can move photos between libraries for you but only you can know which photos should be in which library
    LN

  • How do I find the exact resolution of a photo I just took?

    I Can't figure out how to find the exact resolution of a photo I just took. How do I find this? from my phone

    Japib wrote:
    hi,
    did you get your question answered?
    Don't fish for points.  If the OP thinks you answered the question or were helpful, then they'll act accordingly.

  • How to find the exact word in a long text?

    Hi,
    Scenario:
    I have long text containing the system status of the equipment.
    Issue:
    I need to find the exact word from the list of the statuses. I have tried to use the FIND keyword but it does not work for all the cases.
    Example:
              FIND 'REL' IN <status_list> IGNORING CASE.
              if sy-subrc = 0.
              " do something
              endif.
    If the status list contains the word 'RELR', the sy-subrc is set to 0 (which may be because it searches the list based on a pattern) but I want to get the exact match.
    Can anybody suggest me on this.
    Regards
    s@k

    >
    siemens.a.k wrote:
    > Dear Kiran, Vasuki,
    >
    > The data type of status list is char with length 40.
    > The status list:
    >
    > Case 1: list -  REL  MANC NMAT PRC  SETC
    > FIND 'REL ' IN <status_list> IGNORING CASE
    > the sy-subrc is set to 0
    >
    > Case2: list - CRTD MSCP NMAT PRC  RELR SETC
    > FIND 'REL ' IN <status_list> IGNORING CASE
    > the sy-subrc is still set to 0 even though the list does not contain the word 'REL'
    >
    > I have also tried using
    > if <status_list> CS 'REL'
    > and
    > if <status_list> CS 'REL '
    >
    >
    > Please do let me know if I am anyway unclear about issue...:)
    >
    > Regards
    > s@k
    This is becacuse when you check
    > Case2: list - CRTD MSCP NMAT PRC  RELR SETC
    It is having RELR so that is the reason you are getting subrc = 0.
    >Ok try CS it should work perfectly.
    It seems... CS also not the correct answer
    (It will count RELR)  below thread sachin is correct ...Do that way ....
    Regards
    sas
    Regards
    Sas
    Edited by: saslove sap on Jan 25, 2010 6:58 AM

  • When typing I will sometimes look at the document and find the curser moved and the typing is going on in a different area.  How do I stop that curser movement?

    When typing I will sometimes look at the document and find the curser moved.  The typing has been happening in the wrong place.  How do I stop the curser movement while typing?

    You're not the only person asking this question. You might want to read this post, which contains possible solutions, and references support documents:
    https://discussions.apple.com/thread/2322020?start=0&tstart=0
    Others have the same question as you. Post here if this information answered your question; post also if you have any additional questions!

  • How do I get rid of all the Itunes store ads on my Iphone?  And find the playlist I just "synched" in I-tunes?

    How do I get rid of all the Itunes store ads on my Iphone?  And find the playlist I just "synched" in I-tunes?

    Uninstalling and reinstalling iTunes does not create duplicates.
    Only the user importing content multiple times creates duplicates.
    Delete the duplicates and stop importing the same content multiple times.

  • HT203477 Trying to make a Master copy. But I keep getting this The operation could not be completed because an error occurred when creating frame 2846 (error-1).How to correct it find the frame or?. I shot both 720p and 1080i also pictures Trying to do 10

    Trying to export my project as a mastercopy but keep getting error message  "creating frame 2846 error 1" I don't know what to do? do I try and find the frame and if I do how.

    I have the same error but i dont know how to thrash the render files and switch off background rendering.
    my problem is in the frame 6150 how to fix this problem. i need your help because i have to present this work for tomorrow

  • TS2972 used to be able to pick out which songs in iTunes in my computer were not on a 2nd computer on homeshare in iTunes 10.  Now with V11, cant find the button that compares two libraries and finds the songs that are different.  Anyone know how to do th

    Used to be able to pick out which songs in iTunes in my computer were not on a 2nd computer on homeshare in iTunes 10.  Now with V11, cant find the button that compares two libraries and finds the songs that are different.  Anyone know how to do this now?

    Jneklason wrote:
    ~snip~
    I know this email is confusing and really hard to understand...perhaps now you will know how i've been feeling--lost and confused with all the mis-information, with a hit and miss phone, and out of time with all the 1 1/2 hr to 2 hrs EACH wasted on this issue.
    On top of all this, I can't even find out how to file a complaint with anyone higher up than Customer Service.
    I hate to tell you this, but you didn't write an email. You wrote a discussion post on the Verizon Wireless Community forum which is a public peer to peer forum. Unfortunately since you didn't mark your post as a question, the VZW reps that roam this community won't ever see your post. Before you re-post it, don't. Duplicate posts get removed from the community.
    I see there were several missteps both by the reps and yourself in your post. First you should have insisted on returning the phone within the 14 day return policy period. Second which Samsung Galaxy mini model did you purchase? The S3 mini or the S4 mini? Did you do any research prior to deciding on this device. The reps at that time deflected the easiest course of action, by trying to get you to replace the phone under insurance instead of returning the phone. The Early Edge payment option requires the current phone on the line using the early Edge must be returned to Verizon Wireless. Did you once considered going to a third party site like Swappa to purchase a gently used device for your daughter?

  • How do I search and find the latest albums of a particular genre (Circuit)?

    Hello,
    I'm new to iTunes and the music I want to buy is Circuit Party (House).
    All I want to do is log on and search for and find the latest Circuit Party music albums. Unfortunately, sometimes I will do a search and a song and its album will show up, but the album is not appearing in the "New and Noteworthy" section, even though it is a new release.
    What I have been doing as a workaround is to visite another site which has the latest Circuit music albums and then switching back to iTunes Store to search for each specific album. This is a slow process and a pain!
    I figure I must not be doing something right with the iTunes store, so if you can tell me the best way to find my music, I would really appreciate it!
    Thanks!

    Hi Tom,
    As I can see from what you posted, this correction seems a program correction. You can use SNOTE transaction to apply it. Just download the OSS Note and apply it. The transaction it's pretty simple to use.
    Otherwise if you don't have SNOTE installed you can find them in the following places:
    SELECT_STATE_FOR_CONDTAB_BUILD - This is a function you should find this through the se37.
    Hope it helps.
    Regards,
    Gilberto Li

  • How can I select an area of a picture (larger than one pixel) and find the average RGB values of all the pixels contained inside the area?

    I'm analysing the differences between several different images and I would like to select a large area of each (such as with lasso tool) and find the average RGB value of all of the pixels within the selection area made/

    With the selection you could do a copy paste and use the histogram of the new layer set the histogram source to selected layer.  The eye dropper sample size may also to get the average  of a square area around a point.

  • Finding the exact path of a file using a Java program

    Can anyone tell me how to find the exact path of a file which is saved in a directory other than the one in which the main file is saved? I know there is a class called File which has many methods like isAbsolutePath() and isPath() but they return the path in which the main class is located

    actually i m trying to write a program which will
    take a name of a file or a directory from the console
    and it should give the entire path of that file or
    directory and this file need not be stored in the
    path of the main class.....It can be stored in any
    drives of my PC....Ok, then the console input needs to be an absolute path or a path relative to some given directory (usually the one from which the application is started). Java cannot magically guess absolute paths if you just provide a file name. E.g. if I'd use your program and would provide as input "build.xml", how should the program know which file by that name I mean (there are lots of build.xml files in different locations on my machine)?

Maybe you are looking for

  • ACE30: Setting timezone issue

    Hi Guys, This would seem trivial however I can't seem to set the appropriate timezone as indicated below: Trying to set the timezone on our ACE30 modules (running A5(1.2): clay1-ace/Admin(config)# clock timezone AEST +10                              

  • Why would Safari 6 not cache certain cacheable resources?

    In our web application, which uses GWT, we have many Javascript resources. In the case of the GWT module's Javascript, the resource is 790kB (226kB gzipped). All the other Javascript and stylesheet resources are cached, but Safari 6 doesn't cache thi

  • After upgrade to 10.6.5 cannot connect to a port

    Let me apologise upfront - I don't speak the Apple language but need some help. I have upgraded to 10.6.5 (tried update and then also combo). I need to access my work e-mail remotely. This was not a problem before upgrade. It accesses via a port on t

  • What nforce product is used in the dv6768se?

    I am wanting to update the nForce driver on this laptop, but don't know the chipset info.

  • Regarding Patch Information

    Hi, Patch ID 8527948 for hyperion 9.3.1 While installing patch, i need to stop all the services or not. Thanks, PC