Linking user table with system table

Hello, I'm trying to link a user table with IC table in order to asign many sales person to a customer.
I've created a new button in the IC form. When clicked a new form is opened to asign sales person to the IC. Now I need to retrieve the records assigned to this IC. How can I do that???
Regards.
Angel.

Hi Angel,
I would put a matrix in the new form where you could see/asign/delete the sales person.
Have a look at this post where you can find a great code from Sebastian Danober to fill a matrix from a recordset.
Another option could be to modify the existing IC form and add a new folder with a matrix where you can manage the sales person.
Check this other post with code for adding folder to an existing form.
Regards,
Ibai Peñ

Similar Messages

  • How to link TCJ_Documents table with BKPF table

    Dear all,
    i am new ABAPer, i need to join TCJ_Documents table with BKPF table.
    but, i can not find the relationship between this two tables.
    so, please help !
    thanks !

    Hi....
    There is a company code (BUKRS) in both tables.
    Also Fiscal year(GJAHR)...
    What is the problem with that?
    Sample code...
    data: begin of itab occurs 0,
          bukrs type bukrs,
          cjnr type cjnr,
          belnr type belnr_d,
          end of itab.
    start-of-selection.
    select p~bukrs p~belnr q~comp_code from bkpf as p
           inner join tcj_documents as q
           on p~bukrs = q~comp_code
           into table itab.
    loop at itab.
      write:/ itab-bukrs.
    endloop.
    Thanks,
    Naveen.i

  • Import tables with nested table : ORA-00600

    In Oracle 9.2
    Create object, type as table, and table with nested table (store as syms_ntab) are successfully.
    Also its export.
    In process of import on another server (also 9.2, 'fromuser=one touser=two') shows errors:
    . . importing table "SYMS_NTAB"
    IMP-00058: ORACLE error 600 encountered
    ORA-00600: internal error code, arguments: [kokeeafi1], [2], [2], [], [], [], [], []
    IMP-00075: Warning: The nested table may contain partial rows or duplicate rows
    But for all that table is created and error occur on phase inserting strings.
    What is this?
    In Oracle 8.0.5 i perform similar operation without error.

    From Oracle error messages and codes manual:
    ORA-00600 internal error code, arguments: [string], [string], [string], [string], [string], [string], [string], [string]
    Cause: This is the generic internal error number for Oracle program exceptions. It indicates that a process has encountered a low-level, unexpected condition. Causes of this message include:
    * timeouts
    * file corruption
    * failed data checks in memory
    * hardware, memory, or I/O errors
    * incorrectly restored files
    The first argument is the internal message number. Other arguments are various numbers, names, and character strings. The numbers may change meanings between different versions of Oracle.
    Action: Report this error to Oracle Support Services after gathering the following information:
    * events that led up to the error
    * the operations that were attempted that led to the error
    * the conditions of the operating system and databases at the time of the error
    * any unusual circumstances that occurred before receiving the ORA-00600 message
    * contents of any trace files generated by the error
    * the relevant portions of the Alter files
    Note: The cause of this message may manifest itself as different errors at different times. Be aware of the history of errors that occurred before this internal error.

  • Partition exchange error on table with nested table

    On Oracle 11.2.0.1, I have a partitioned table with some partitions that need to be 'archived' (in terms of moving partitions to an 'archive' table).
    I have a source table like:
    CREATE TABLE IS_PODACI245
      ID_OBJEKTA_IDENTIFIKACIJA  NUMBER(10),
      ID_OBJEKTA                 NUMBER(20),
      DATUM                      TIMESTAMP(6)       NOT NULL,
      TZ                         NUMBER(3),
      DATA1                      NUMBER(10),
      DATA2                      NUMBER(6),
      DATA3                      NUMBER(10),
      DATA4                      NUMBER,
      DATA5                      T_NTCIP_CLIMATE_TABLE
    NESTED TABLE DATA5 STORE AS IS_PODACI245_STORE_TABLE
    TABLESPACE DATA
    PARTITION BY RANGE (DATUM)
      PARTITION P_201107 VALUES LESS THAN (TIMESTAMP' 2011-08-01 00:00:00')
        LOGGING
        NOCOMPRESS
        TABLESPACE DATA, 
      PARTITION P_MAXVALUE VALUES LESS THAN (MAXVALUE)
        LOGGING
        NOCOMPRESS
        TABLESPACE DATA
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    CREATE INDEX IDX_IS_PODACI245_KOMPLEKS ON IS_PODACI245
    (ID_OBJEKTA_IDENTIFIKACIJA, ID_OBJEKTA, DATUM)
      TABLESPACE DATA
    LOCAL ( 
      PARTITION P_201107
        LOGGING
        NOCOMPRESS
        TABLESPACE DATA, 
      PARTITION P_MAXVALUE
        LOGGING
        NOCOMPRESS
        TABLESPACE DATA
    NOPARALLEL;
    CREATE OR REPLACE TYPE t_ntcip_climate_table as table of t_ntcip_climate_fmt;
    CREATE OR REPLACE TYPE t_ntcip_climate_FMT as object
    (  dev_index number(6)
    ,   dev_description varchar2(512)
    ,   dev_type number(10)
    ,   dev_status number(10)
    ,   dev_mfr_status varchar2(512)
    ,   dev_active number(3)
    ,   dev_test_activation number(10)
    /I would like to make exchange partition using stage table, and everything is going fine on all tables, but only on a few of them (listed source is one of them, and they're only tables with nested tables wihin), where I get an error.. but sometimes ;)
    on a statement like:
    ALTER TABLE IS_PODACI245_ARH EXCHANGE PARTITION P_201106  WITH TABLE IS_PODACI245_STAGE EXCLUDING INDEXES  WITHOUT VALIDATION;I got an error:
    ORA-00001: unique constraint (TXV.SYS_C0032911) violated
    it's an unique index between parent and nested table.
    what could cause that problem?

    Dear,
    I suppose that the unique constraint
    ORA-00001: unique constraint (TXV.SYS_C0032911) violatedis the one you 've created on the nested table IS_PODACI245_STORE_TABLE
    If so, why not disable that constraint and try again.
    I have never exchanged such a kind of partitioned table having a nested table in it. But, I could imagine that the cloned non partitioned table IS_PODACI245_STAGE should at least be the exact image of the partitioned table IS_PODACI245_ARH (of course without the partition part) but with the nested table part and including all indexes
    In addition, if you have a parent/child relationship between your partitioned tables, then there is a chronological order of exchange starting by the child and then finishing by the parent
    see the following link for more information about this order of exchange (and comment 2 for an example also)
    http://jonathanlewis.wordpress.com/2006/12/10/drop-parent-partition/#more-65
    Hope this helps
    Mohamed Houri

  • Help in joining nested table with regular table

    Im creating a nested table codelist as object prtcnpt_info. In a anonymous block im declaring t_code as nested table type codelist.
    Now when i try to join the nested table with the regular oracle DB table and i get error: PL/SQL: ORA-00904: "COLUMN_VALUE": invalid identifier.
    Please help me on this and provide tutorial link pertaining to this concepts..Below is the code i wrote
    --Code Start;
    create or replace type prtcnpt_info as object ( id number
    ,name varchar2(200)
    ,code varchar2(30));
    create type codelist is table of prtcnpt_info;
    declare
    t_code codelist;
    begin
    select prtcnpt_info(b.pid ,b.name ,pt.code) bulk collect into t_code
    from part pt
    ,mc_code b
    where pt.cd in ('AAA','BBB')
    and pt.ptype_id=b.pt_type_id;
    INSERT INTO table ( ID
    ,RUN_ID
    ,DATA
    ,P_ID
    SELECT id
         ,run_id
         ,data
         ,prtct.id ----> 1
    FROM table_2 t2
    ,(select column_value from table(t_code)) prtct
    WHERE prtct.id=t2.P_ID; ------> 2
    end;
    --Code End;
    also from the anonymous block
    1 => is this correct way to get value of id (b.pid) from the nested tablet_code aliased as prtct ?
    2 => is this correct way to join the nested table with regular table? i want to join the column id's in both the tables.
    Edited by: 914912 on Apr 30, 2012 2:11 AM

    When you create a table type without an object, i.e. a single column type like this you will get the column name as COLUMN_VALUE.
    SQL*Plus: Release 10.2.0.5.0 - Production on Mon Apr 30 07:38:32 2012
    Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create or replace type mytbl as table of varchar2(10)
      2  /
    Type created.
    SQL> var rc refcursor
    "afiedt.buf" 11 lines, 162 characters
      1  declare
      2     ltbl mytbl;
      3  begin
      4     select to_char(level) bulk collect into ltbl
      5       from dual
      6    connect by level <= 10;
      7     open :rc for
      8     select * from table(ltbl);
      9* end;
    10  /
    PL/SQL procedure successfully completed.
    SQL> print rc
    COLUMN_VAL
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    10 rows selected.And when you create a table type with object you will get the object column name.
    SQL> drop type mytbl
      2  /
    Type dropped.
    SQL> create type myobj as object (id varchar2(10))
      2  /
    Type created.
    SQL> create type mytbl as table of myobj
      2  /
    Type created.
    SQL> declare
      2     ltbl mytbl;
      3  begin
      4     select myobj(to_char(level)) bulk collect into ltbl
      5       from dual
      6    connect by level <= 10;
      7     open :rc for
      8     select * from table(ltbl);
      9  end;
    10  /
    PL/SQL procedure successfully completed.
    SQL> print rc
    ID
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    10 rows selected.
    SQL>

  • There is no entry for this function in Table 168F (system table). An error involving the screen control has probably occurred.

    Hi All,
    i created one  enchancement to ME21n screen,
    i added one screen at header
    When i running the the transaction ME41 it shows the following error.
    This function not defined
    Message no. 06006
    Diagnosis
    There is no entry for this function in Table 168F (system table). An error involving the screen control has probably occurred.
    Procedure
    Contact your system administrator.
    Am i need to add this functionalty to any  sap table.
    plz guide me on this.

    Hi Krishna
    Have you added any buttons in the custom screen if yes then you will have to maintain configuration data for Function code processing.
    Please search on SCN for the same
    Nabheet

  • Mix object tables with relational tables?

    Hallo,
    is it possible to mix object tables with relational tables in one database?
    I didn't succeed in assigning a foreign key from a relational table to an object table.
    Is this only working with column objects in relational tables?

    Hi
    is it possible to mix object tables with relational tables in one database?
    Every database contains both types of tables. So, it is basically not a problem.
    I didn't succeed in assigning a foreign key from a relational table to an object table.
    Is this only working with column objects in relational tables?It would be interesting to know how you tried... e.g. what error you get... Here an example (executed on 11.1).
    SQL> create or replace type tt as object ( n number );
      2  /
    SQL> create table ot of tt (constraint ot_pk primary key (n));
    SQL> create table rt (n number, constraint rt_ot_fk foreign key (n) references ot (n));
    SQL> insert into ot values (tt(1));
    SQL> insert into rt values (1);
    SQL> insert into rt values (2);
    insert into rt values (2)
    ERROR at line 1:
    ORA-02291: integrity constraint (OPS$CHA.RT_OT_FK) violated - parent key not foundHTH
    Chris

  • Join Istore table with AR tables

    Hi Gurus,
    How to join ibe_msites_b table with AR table. I am trying to get list of all customers from different mini sites. These are the AR tables i am using
    HZ_Cust_Accounts
    HZ_Parties
    Regards,

    The following query should give you resullts for B2C. Change the query based on your requirement incase if you want it for B2B. Please note that I haven't added alll the conditions. This should be your starting point.
    Hope this helps,
    RK
    SELECT imt.msite_name,
    hp.party_name
    FROM jtf_um_subscription_reg jusr,
    jtf_um_subscription_resp jure,
    fnd_responsibility fr,
    ibe_msite_resps_b imrb,
    ibe_msites_tl imt,
    fnd_user fu,
    hz_parties hp
    WHERE jusr.subscription_id = jure.subscription_id
    AND jure.responsibility_key = fr.responsibility_key
    AND fr.responsibility_id = imrb.responsibility_id
    AND imrb.msite_id = imt.msite_id
    AND imt.language = USERENV('LANG')
    AND fu.user_id =jusr.user_id
    AND fu.person_party_id = hp.party_id

  • Is any one created Table with in table using adv table with VOs without EOs

    If you have created Advnace table Master-Detail (Table with in table), please let me know the Controller code. I am using below. But getting Nullpointer excveption at innerTable.setAttributeValue(VIEW_LINK_NAME,"ViewLink1VL"); Please help me.
    ===========================
    OAWebBean outerTable = (OAWebBean)webBean.findChildRecursive("region2");
    OAWebBean innerTable = (OAWebBean)webBean.findChildRecursive("region4");
    if (outerTable != null)
    outerTable.setAttributeValue(CHILD_VIEW_ATTRIBUTE_NAME,"FLEX_VALUE_X");
    outerTable.setAttributeValue(VIEW_LINK_NAME,"ViewLink1VL");
    if (innerTable != null)
    innerTable.setAttributeValue(CHILD_VIEW_ATTRIBUTE_NAME,"FLEX_VALUE_X");
    innerTable.setAttributeValue(VIEW_LINK_NAME,"ViewLink1VL");
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("initGoodsQuery");
    ============================

    My problem was solved when i used ,"ViewLink1VL1" instead of ,"ViewLink1VL" in controller code.
    thanks.
    Gopi.

  • Best way to link user form with user table

    Hi all.
    What is the best way to link an user form with a user table (with all of the functions, add, update...)? I have created a simple form, and the question is next:
    depending the type object of the user table (document, master...) i have facilities to imlement the basic operations in the form?  if i create an UDO i have the functions but i want to use the form that i created with a screen painter.
    Thanks.

    Hi again i want add a new comment please.
    If i want do all functions (add,update...) of my form in my user table, and i want my user table is a <b>type document</b>? how can add new lines in my user table with objet <b>type document</b>? because when i make the instance i nedd to say what type of document is (item,order...) and when i do an add(), not add() in my user table. In what moment or how can assign that the add,update functions... affect in my table?
    Thanks again.

  • Flashbackup query with system tables

    Hello,
    When I try to execute a flasback query on a system table as user$ I get the error ORA-1466.
    Does it exist any way to get the rows of this table but in a certaing point of time?
    Regards,
    Juan

    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_flashback.htm#sthref1460

  • WD4A Dynamic ALV Table with dynamic tables

    Hi all,
    first I want give you the information what I try to do.
    I have an another WD4A application for administrative use in which I can assign certain tablefields to a certain user. You can say it's something like a customizing application.
    In the next application (with my issues) I will display the tables for the user, but these tables are not the complete table.
    I have a node in my context of the component controller which is bound to my ALV. I add during the runtime attributes to my node.
    * .... coding ....declaration
    * get the node
      lr_node = wd_context->get_child_node( 'M_TABLE' ).
      lr_node_info ?= lr_node->get_node_info( ).
    * remove the attributes, if exists
      lr_node_info->remove_dynamic_attributes( ).
    * .... coding ....
    *   add attributes
        LOOP AT l_t_m_table INTO l_s_m_table.
          CLEAR ls_attribute.
    *     name of the attribute
          MOVE l_s_m_table-NAME TO ls_attribute-NAME.
    *     DDIC type of the attribute
          MOVE l_s_m_table-TYPE_NAME TO ls_attribute-TYPE_NAME.
    *     If the DDIC has a gen namespace like /B135/ replace the / with _
          REPLACE ALL OCCURRENCES OF '/' IN ls_attribute-NAME WITH '_'.
    *     add the attribute
          lr_node_info->add_attribute( EXPORTING
                                         attribute_info = ls_attribute ).
        ENDLOOP.
    This coding works fine I get the columns in my ALV. Then I tried to fill my ALV table with data from a database table.
    I created dynamicly an internal table with the following coding:
    *   Create dynamic table
        CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
          EXPORTING
            IT_FIELDCATALOG = l_t_FLDCAT
          IMPORTING
            EP_TABLE = l_t_NEW_M_TABLE.
    *   assign the table
        ASSIGN l_t_NEW_M_TABLE->* TO <M_TABLE>.
    *   structure of table
        CREATE DATA l_s_NEW_M_TABLE LIKE LINE OF <M_TABLE>.
        ASSIGN l_s_NEW_M_TABLE->* TO <l_s_m_table>.
    * get data from database
    SELECT * FROM (l_m_table) INTO CORRESPONDING FIELDS OF TABLE <M_table> WHERE OBJVERS = 'A'.
    With this coding I get the data from the database and only the required fields that means I have e.g. an itab with columns1, columns3, columns4 from the database.
    I also added e.g. these columns  (columns1, columns3, columns4 from the database) to the node as attribute. Now it should be possible to bind the table to the structure with this coding:
    lr_comp_usage_m = wd_this->wd_cpuse_usage_alv_M_table( ).
    *   create component if not active
        IF lr_comp_usage_m->has_active_component( ) IS INITIAL.
          lr_comp_usage_m->create_component( ).
        else.
    * set data if node exists
          l_ref_interfacecontroller = wd_this->wd_cpifc_usage_alv_M_table( ).
          l_ref_interfacecontroller->set_data( lr_node ).
        endif.
    *   bind table
        lr_node->bind_table( <M_TABLE> ).
    Now, I get an error, which is caused by the table binding.
    In ST22 I get:
    Short text
        Line types of an internal table and a work area not compatible.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "CL_WDR_CONTEXT_NODE_VAL=======CP" had to be
         terminated because it has
        come across a statement that unfortunately cannot be executed.
    Error analysis
        The statement
           "INSERT wa INTO TABLE itab"
        requires the lines of the internal table "TABLE" and the
        work area " wa" to be compatible. Compatibility means
        equivalence in the context of ABAP/4 type checking.
        In this case, the condition is not satisfied because the internal table
        "TABLE" has the line type "u" and the length 28, but the work area " wa"
        has the type "C" and the length 2.
        (If the work area " wa" is the header line of the internal
        table "TABLE", the above inconsistency can arise if an internal
        table t with the line type T1 is passed to a subroutine (FORM or
        FUNCTION) as an actual parameter and the corresponding formal
        parameter p is declared in the subroutine by "TABLES p STRUCTURE T2".
        If then T1 and T2 are incompatible, the header line p
        has the type T2 (specifed by STRUCTURE), but the internal
        table p has the line type T1 (passed from the actual parameter)).
    Source Code Extract
    Line  SourceCde
        1 method if_wd_context_node~get_static_attributes_table .
        2
        3   field-symbols:
        4     <element> like line of me->collection,
        5     <static_attributes> type data,
        6     <table> type index table.
        7
        8 * check whether elements are supllied or not
        9   if me->elements_supplied = abap_false.
       10     me->supply_elements( ).
       11   endif.
       12
       13   clear table.
       14
       15   if me->table_ref is not initial.
       16     assign me->table_ref->* to <table>.
       17     table = <table>.
       18   else.
       19     loop at me->collection assigning <element> from from to to.
       20       assign <element>->static_attributes->* to <static_attributes>.
    error in line 21       insert <static_attributes> into table table.
       22     endloop.
       23   endif.
       24
       25 endmethod.
    Any suggestions? Is it allowed to use bind_table() with a field symbol?
    Another strange thing is that if I try the same with static itab and attributes during runtime it works, but only if the fields of the itab has the same name as the attributes, which means that I can not use itabs with fieldnames like /BI0/S_CUSTOMER and if I can not use them it's difficult to read data from database with SELECT * FROM ... INTO CORRESPONDING FIELDS OF TABLE itab.
    Thanks in advance for your suggestions!
    Best Regards,
    Marcel

    Hi Francois,
    I solve it with the RTTI and the method    
    lr_node_info = lr_node_info->add_new_child_node(
                          name = 'Dynamic_TABLE'
                          IS_MANDATORY = ABAP_false
                          IS_MULTIPLE = ABAP_true
                          STATIC_ELEMENT_RTTI = lr_struct_descr
                          IS_STATIC = ABAP_false
    I don't know why it doesn't work with adding attributes and binding the table after adding the attributes.
    Anyway thanks for your help.
    Best Regards,
    Marcel

  • Create View table with multiple table

    I want to create View table with relation with multiple tables.
    for ex
    table 1
    mrnno
    mrnqty
    table 2
    mrnno
    issqty
    table 3
    mrnno
    retqty
    want to create view table where i can see the sum (mrnqty), sum(issqty),sum(retqty) group by mrnno
    sandy

    Hi
    CREATE OR REPLACE FORCE VIEW my_view AS
    WITH t1 AS
    (SELECT mrnno,
                      SUM(mrnqty) sum1
    FROM table_1
    GROUP BY mrnno),
    t2 AS
    (SELECT mrnno,
                      SUM(issqty) sum2
    FROM table_2
    GROUP BY mrnno),
    t3AS
    (SELECT mrnno,
                      SUM(retqty) sum3
    FROM table_3
    GROUP BY mrnno)
    SELECT mrnno,
                    sum1,
                   sum2,
                   sum3
    FROM t1,t2,t3
    WHERE t1.mrnno = t2.mrnno
    AND       t1.mrnno = t3.mrnnoCheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Join EQUI table with other table so as get address detail.

    Hi All,
    Can any one help me in the following case :
    I have to pass Equipment No. EQUNR on the selection screen and get Address detail (city, region, state, country, zipcode )
    now I am getting all this address related field in KNA1 table. Also I am able to join this two table with
    KNA1-KUNNR join EQUI-KUNDE as common field.
    Turning point
    when I am passing test data of Equipment No. EQUNR 60099204 I am not getting the address detail,
    because after passing EQUNR I am not getting KUNNR.
    So can any one please help me in joining EQUI table to some other table with field name so that I can get the address detail.
    Thanks

    Hi,
    The join between the table EQUI-kunde  join  KNA1-kunnr is ok but it not working for every value.
    Example :-
    In EQUI table when we pass  Equnr - 60099204 we need to get some value in KUNDE field, then only it will join to KNA1 table. But this is not happening, I am not getting value for KUNDE, hence join is not performing.
    So I need some other solution so that when we pass EQunr we can get the address details
    one thing more equnr  60099204 is having address detail, if we'll check IE03 (transaction by clicking address envelop)
    Thx.

  • How to Compare Data length of staging table with base table definition

    Hi,
    I've two tables :staging table and base table.
    I'm getting data from flatfiles into staging table, as per requirement structure of staging table and base table(length of each and every column in staging table is 25% more to dump data without any errors) are different for ex :if we've city column with varchar length 40 in staging table it has 25 in base table.Once data is dumped into staging table I want to compare actual data length of each and every column in staging table with definition of base table(data_length for each and every column from all_tab_columns) and if any column differs length I need to update the corresponding row in staging table which also has a flag called err_length.
    so for this I'm using cursor c1 is select length(a.id),length(a.name)... from staging_table;
    cursor c2(name varchar2) is select data_length from all_tab_columns where table_name='BASE_TABLE' and column_name=name;
    But we're getting data atonce in first query whereas in second cursor I need to get each and every column and then compare with first ?
    Can anyone tell me how to get desired results?
    Thanks,
    Mahender.

    This is a shot in the dark but, take a look at this example below:
    SQL> DROP TABLE STAGING;
    Table dropped.
    SQL> DROP TABLE BASE;
    Table dropped.
    SQL> CREATE TABLE STAGING
      2  (
      3          ID              NUMBER
      4  ,       A               VARCHAR2(40)
      5  ,       B               VARCHAR2(40)
      6  ,       ERR_LENGTH      VARCHAR2(1)
      7  );
    Table created.
    SQL> CREATE TABLE BASE
      2  (
      3          ID      NUMBER
      4  ,       A       VARCHAR2(25)
      5  ,       B       VARCHAR2(25)
      6  );
    Table created.
    SQL> INSERT INTO STAGING VALUES (1,RPAD('X',26,'X'),RPAD('X',25,'X'),NULL);
    1 row created.
    SQL> INSERT INTO STAGING VALUES (2,RPAD('X',25,'X'),RPAD('X',26,'X'),NULL);
    1 row created.
    SQL> INSERT INTO STAGING VALUES (3,RPAD('X',25,'X'),RPAD('X',25,'X'),NULL);
    1 row created.
    SQL> COMMIT;
    Commit complete.
    SQL> SELECT * FROM STAGING;
            ID A                                        B                                        E
             1 XXXXXXXXXXXXXXXXXXXXXXXXXX               XXXXXXXXXXXXXXXXXXXXXXXXX
             2 XXXXXXXXXXXXXXXXXXXXXXXXX                XXXXXXXXXXXXXXXXXXXXXXXXXX
             3 XXXXXXXXXXXXXXXXXXXXXXXXX                XXXXXXXXXXXXXXXXXXXXXXXXX
    SQL> UPDATE  STAGING ST
      2  SET     ERR_LENGTH = 'Y'
      3  WHERE   EXISTS
      4          (
      5                  WITH    columns_in_staging AS
      6                  (
      7                          /* Retrieve all the columns names for the staging table with the exception of the primary key column
      8                           * and order them alphabetically.
      9                           */
    10                          SELECT  COLUMN_NAME
    11                          ,       ROW_NUMBER() OVER (ORDER BY COLUMN_NAME) RN
    12                          FROM    ALL_TAB_COLUMNS
    13                          WHERE   TABLE_NAME='STAGING'
    14                          AND     COLUMN_NAME != 'ID'
    15                          ORDER BY 1
    16                  ),      staging_unpivot AS
    17                  (
    18                          /* Using the columns_in_staging above UNPIVOT the result set so you get a record for each COLUMN value
    19                           * for each record. The DECODE performs the unpivot and it works if the decode specifies the columns
    20                           * in the same order as the ROW_NUMBER() function in columns_in_staging
    21                           */
    22                          SELECT  ID
    23                          ,       COLUMN_NAME
    24                          ,       DECODE
    25                                  (
    26                                          RN
    27                                  ,       1,A
    28                                  ,       2,B
    29                                  )  AS VAL
    30                          FROM            STAGING
    31                          CROSS JOIN      COLUMNS_IN_STAGING
    32                  )
    33                  /*      Only return IDs for records that have at least one column value that exceeds the length. */
    34                  SELECT  ID
    35                  FROM
    36                  (
    37                          /* Join the unpivoted staging table to the ALL_TAB_COLUMNS table on the column names. Here we perform
    38                           * the check to see if there are any differences in the length if so set a flag.
    39                           */
    40                          SELECT  STAGING_UNPIVOT.ID
    41                          ,       (CASE WHEN ATC.DATA_LENGTH < LENGTH(STAGING_UNPIVOT.VAL) THEN 'Y' END) AS ERR_LENGTH_A
    42                          ,       (CASE WHEN ATC.DATA_LENGTH < LENGTH(STAGING_UNPIVOT.VAL) THEN 'Y' END) AS ERR_LENGTH_B
    43                          FROM    STAGING_UNPIVOT
    44                          JOIN    ALL_TAB_COLUMNS ATC     ON ATC.COLUMN_NAME = STAGING_UNPIVOT.COLUMN_NAME
    45                          WHERE   ATC.TABLE_NAME='BASE'
    46                  )       A
    47                  WHERE   COALESCE(ERR_LENGTH_A,ERR_LENGTH_B) IS NOT NULL
    48                  AND     ST.ID = A.ID
    49          )
    50  /
    2 rows updated.
    SQL> SELECT * FROM STAGING;
            ID A                                        B                                        E
             1 XXXXXXXXXXXXXXXXXXXXXXXXXX               XXXXXXXXXXXXXXXXXXXXXXXXX                Y
             2 XXXXXXXXXXXXXXXXXXXXXXXXX                XXXXXXXXXXXXXXXXXXXXXXXXXX               Y
             3 XXXXXXXXXXXXXXXXXXXXXXXXX                XXXXXXXXXXXXXXXXXXXXXXXXXHopefully the comments make sense. If you have any questions please let me know.
    This assumes the column names are the same between the staging and base tables. In addition as you add more columns to this table you'll have to add more CASE statements to check the length and update the COALESCE check as necessary.
    Thanks!

Maybe you are looking for