Thursday, 9 October 2014

Sql Code

printed_flag    varchar2(1);
posted_flag    varchar2(1);
source_type    varchar2(10);   
BEGIN   
    printed_flag:=name_in('TGW_HEADER.PRINTED_FLAG');
    posted_flag:=name_in('TGW_HEADER.POSTED_FLAG');
    source_type:=name_in('TGW_HEADER.BS_BATCH_SOURCE_TYPE');
   
    IF posted_flag='N' and printed_flag='N' THEN
        SET_ITEM_INSTANCE_PROPERTY
('TGW_HEADER.CTT_TYPE_NAME_MIR',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY
('TGW_HEADER.CTT_TYPE_NAME_MIR',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
       
        SET_ITEM_INSTANCE_PROPERTY
('TGW_HEADER.TRX_DATE_MIR',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY
('TGW_HEADER.TRX_DATE_MIR',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
    END IF;
   
   
=========================================================
printed_flag    varchar2(1);
posted_flag    varchar2(1);
source_type    varchar2(10);   
BEGIN   
    printed_flag:=name_in('TGW_HEADER.PRINTED_FLAG');
    posted_flag:=name_in('TGW_HEADER.POSTED_FLAG');
    source_type:=name_in('TGW_HEADER.BS_BATCH_SOURCE_TYPE');

    IF posted_flag='N' and printed_flag='Y' THEN
        SET_ITEM_INSTANCE_PROPERTY('TGW_HEADER.INVOICE_CURRENCY_CODE_MIR',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TGW_HEADER.INVOICE_CURRENCY_CODE_MIR',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('ARCOMMON_EXCHANGE_RATE.RATE_TYPE_DSP',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('ARCOMMON_EXCHANGE_RATE.RATE_TYPE_DSP',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('ARCOMMON_EXCHANGE_RATE.RATE_DATE',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('ARCOMMON_EXCHANGE_RATE.RATE_DATE',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
    END IF;

    IF posted_flag='N' and printed_flag='N' and source_type='FOREIGN' THEN
        SET_ITEM_INSTANCE_PROPERTY('TGW_HEADER.INVOICE_CURRENCY_CODE_MIR',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TGW_HEADER.INVOICE_CURRENCY_CODE_MIR',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('ARCOMMON_EXCHANGE_RATE.RATE_TYPE_DSP',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('ARCOMMON_EXCHANGE_RATE.RATE_TYPE_DSP',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('ARCOMMON_EXCHANGE_RATE.RATE_DATE',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('ARCOMMON_EXCHANGE_RATE.RATE_DATE',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
    END IF;
END;



=================================================================================

rinted_flag    varchar2(1);
posted_flag    varchar2(1);
source_type    varchar2(10);   
BEGIN   
    printed_flag:=name_in('TGW_HEADER.PRINTED_FLAG');
    posted_flag:=name_in('TGW_HEADER.POSTED_FLAG');
    source_type:=name_in('TGW_HEADER.BS_BATCH_SOURCE_TYPE');

    IF (posted_flag='N' and printed_flag='Y') OR  (posted_flag='N' and printed_flag='N' and source_type='FOREIGN') THEN
        SET_ITEM_INSTANCE_PROPERTY('TGW_HEADER.RAC_BILL_TO_CUSTOMER_NAME_MIR',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TGW_HEADER.RAC_BILL_TO_CUSTOMER_NAME_MIR',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TGW_HEADER.RAC_BILL_TO_CUSTOMER_NUM_MIR',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TGW_HEADER.RAC_BILL_TO_CUSTOMER_NUM_MIR',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TGW_HEADER.SU_BILL_TO_LOCATION_MIR',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TGW_HEADER.SU_BILL_TO_LOCATION_MIR',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TGW_HEADER.RAA_BILL_TO_ADDRESS1_MIR',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TGW_HEADER.RAA_BILL_TO_ADDRESS1_MIR',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
    END IF;
END;

==================================================================================

printed_flag    varchar2(1);
posted_flag    varchar2(1);
source_type    varchar2(10);   
BEGIN   
    printed_flag:=name_in('TGW_HEADER.PRINTED_FLAG');
    posted_flag:=name_in('TGW_HEADER.POSTED_FLAG');
    source_type:=name_in('TGW_HEADER.BS_BATCH_SOURCE_TYPE');

    IF (posted_flag='N' and printed_flag='N' and source_type='FOREIGN' ) OR (posted_flag='N' and printed_flag='Y') THEN
        SET_ITEM_INSTANCE_PROPERTY('TLIN_LINES.ITEM_FLEX',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TLIN_LINES.ITEM_FLEX',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TLIN_LINES.QUANTITY',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TLIN_LINES.QUANTITY',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TLIN_LINES.UNIT_SELLING_PRICE',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TLIN_LINES.UNIT_SELLING_PRICE',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TLIN_LINES.TAX_CODE',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TLIN_LINES.TAX_CODE',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
    END IF;

END;

================================================================================

printed_flag    varchar2(1);
posted_flag    varchar2(1);
source_type    varchar2(10);   
BEGIN   
    printed_flag:=name_in('TGW_HEADER.PRINTED_FLAG');
    posted_flag:=name_in('TGW_HEADER.POSTED_FLAG');
    source_type:=name_in('TGW_HEADER.BS_BATCH_SOURCE_TYPE');

    IF (posted_flag='N' and printed_flag='N' and source_type='FOREIGN' ) OR (posted_flag='Y' and printed_flag='N') or (posted_flag='Y' or printed_flag='Y' ) or (posted_flag='N' and printed_flag='Y' )THEN
        SET_ITEM_INSTANCE_PROPERTY('TACC_ACC_ASSGN.ACCOUNTING_FLEX',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TACC_ACC_ASSGN.ACCOUNTING_FLEX',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TACC_ACC_ASSGN.AMOUNT',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TACC_ACC_ASSGN.AMOUNT',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TACC_ACC_ASSGN.PERCENT',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
        SET_ITEM_INSTANCE_PROPERTY('TACC_ACC_ASSGN.PERCENT',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
    END IF;
   
END;

1 comment:

  1. Regards
    Sridevi Koduru (Senior Oracle Apps Trainer Oracleappstechnical.com)
    LinkedIn profile - https://in.linkedin.com/in/sridevi-koduru-9b876a8b
    Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, Oracle Manufacturing, BI Publisher, OAF, ADF, SQL, PL/SQL, D2K at sridevikoduru@oracleappstechnical.com | +91 - 9581017828.

    ReplyDelete