Adding column dynamically

Hi all
I have a requirement of adding the columns to a Classic Table at run time.. the number of columns are not fixed. the number of The data in there columns will be dispaled from the view initialized at run time.
I tried searching out threads on adding column dynamically but didtn get one..
pls help me out ..
naveen

Of course you can add columns dynamically, but this always needs to be from the same VO, a OA table cannot be based on more than one VO.
So if it all the columns are from the same VO, why take the pain of adding and removing columns, why not just either render it or hide it.
Thanks
Tapash

Similar Messages

  • Adding column dynamically in alv

    *& Report  ZSP_BSID
    REPORT  ZSP_BSID.
    TYPE-POOLS:SLIS.
    "type-pools:abap.
    TABLES: BSID.
       "CONSTANTS : lc_structure TYPE tabname VALUE  'ZSXX'.
    TYPES: BEGIN OF TY_bsid," OCCURS 0,
             bukrs TYPE bsid-bukrs,
             kunnr TYPE bsid-kunnr,
             monat TYPE bsid-monat,
             TEXT TYPE C,
            total type n,
        END OF TY_bsid.
           "monat like bsid-monat,
    *      jan  TYPE  bsid-monat,
    *       feb  TYPE  bsid-monat,
    *       mar  TYPE  bsid-monat,
    *       apr  TYPE bsid-monat,
    *       may  TYPE  bsid-monat,
    *       jun  TYPE  bsid-monat,
    *       jul  TYPE  bsid-monat,
    *       aug  TYPE  bsid-monat,
    *       sep  TYPE  bsid-monat,
    *      oct  TYPE  bsid-monat,
    *      nov  TYPE  bsid-monat,
    *      dec  TYPE bsid-monat,
    DATA: FCAT TYPE SLIS_FIELDCAT_ALV,
           IT_FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:  T_EVENT TYPE SLIS_T_EVENT,
       W_EVENT TYPE SLIS_ALV_EVENT.
    DATA: SORT TYPE SLIS_SORTINFO_ALV,
           IT_SORT TYPE SLIS_T_SORTINFO_ALV.
    DATA:  MONAT(2) TYPE c.
    "CALL SCREEN 2000.
    "DATA: FLAG.
    "data: lv_pos type i.
    DATA: IT_BSID TYPE TY_BSID OCCURS 0 with header line.
    "data: it_color TYPE TABLE OF lvc_s_scol.
    DATA: WA_BSID TYPE TY_bsid.
      SELECTION-SCREEN: BEGIN OF BLOCK A WITH FRAME TITLE B.
        SELECT-OPTIONS: CMP_CODE FOR BSID-BUKRS." OBLIGATORY.
        SELECT-OPTIONS: CUST_NME FOR BSID-KUNNR." OBLIGATORY.
        SELECT-OPTIONS: MONTH FOR BSID-MONAT.
        SELECTION-SCREEN: END OF BLOCK A.
    data: num1(2) type c,
           num2(2) type c.
           "monat type n.
         num1 = MONTH-low.
         num2 = MONTH-high.
      monat = num2 - num1(01) + 1.
    field-symbols: <it_bsid> type STANDARD TABLE.
        START-OF-SELECTION.
        PERFORM SELECT.
        PERFORM FIELDCAT.
        PERFORM DISPLAY.
        "PERFORM DISPLAY1.
       "perform format_field_catolog.
    "   PERFORM DISPLAY1.
    *&      Form  SELECT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM SELECT.
       SELECT bukrs kunnr monat FROM BSID INTO TABLE IT_BSID
    *    WHERE BUKRS IN CMP_CODE AND
    *         kunnr IN CUST_NME and
              where monat eq MONTH.
    ENDFORM.
                        " SELECT
      "create DATA w_dref TYPE STANDARD TABLE OF (month).
    *ASSIGN w_dref->* to <it_bsid>.
    *SELECT * FROM (month) into table <it_bsid>.
    *&      Form  FIELDCAT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form FIELDCAT .
    "do 12 times.
      " result = sy-index ** 12.
    fcat-col_pos       = '1'.
       fcat-tabname       = 'IT_BSID'.
       fcat-fieldname     = 'BUKRS'.
       fcat-seltext_m     = 'CUSTOMER NAME'.
       fcat-hotspot       =   'X'.
       fcat-emphasize    = 'C666'.
       APPEND FCAT TO it_fcat.
       CLEAR fcat.
       fcat-COL_POS = '2'.
    fcat-SELTEXT_L = 'COMPANY CODE'.
    fcat-FIELDNAME = 'KUNNR'.
      APPEND FCAT TO IT_FCAT.
       CLEAR  FCAT.
    "do 12 times.
      " result = sy-index ** 12.
      DO MONAT times.
       "RESULT = SY-INDEX ** 12.
    "WRITE:/ sy-index EQ RESULT.
       fcat-col_pos       = '3'.
       fcat-tabname       = 'IT_BSID'.
       fcat-fieldname     = 'MONAT'.
       fcat-seltext_m     = 'MONTH'.
         APPEND FCAT TO it_fcat.
       CLEAR fcat.
    enddo.
    *fcat-col_pos       = '4'.
    *  "fcat-tabname       = 'IT_BSID'.
    *  fcat-fieldname     = 'MONAT'.
    *  "FCAT-no_totalline  = 'X'.
    *  fcat-seltext_m     = 'TOTAL'.
    *  FCAT-DO_SUM        =  'X'.
    *  FCAT-NO_OUT       =  'X'.
    *"  fcat-hotspot       =   'X'.
    * " fcat-emphasize    = 'C666'.
    *  APPEND FCAT TO it_fcat.
    *  CLEAR fcat.
    *fcat-col_pos       = '4'.
    *  "fcat-tabname       = 'IT_BSID'.
    *  fcat-fieldname     = 'MONAT'.
    *  "FCAT-no_totalline  = 'X'.
    *  fcat-seltext_m     = 'TOTAL'.
    *  FCAT-DO_SUM        =  'X'.
    *  "FCAT-NO_OUT       =  'X'.
    *"  fcat-hotspot       =   'X'.
    * " fcat-emphasize    = 'C666'.
    *  APPEND FCAT TO it_fcat.
    *  CLEAR fcat.
    *SORT-fieldname = 'MONAT'.
    *SORT-SUBTOT  = 'X'.
    *APPEND SORT TO IT_SORT.
    *CLEAR SORT.
    endform.
                       " FIELDCAT
    *&      Form  DISPLAY
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form DISPLAY .
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                = ' '
    *     I_BUFFER_ACTIVE                   = ' '
          I_CALLBACK_PROGRAM                = SY-REPID
    *     I_CALLBACK_PF_STATUS_SET          = ' '
    *     I_CALLBACK_USER_COMMAND           = ' '
    *     I_CALLBACK_TOP_OF_PAGE            = ' '
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
    *     I_GRID_TITLE                      =
    *     I_GRID_SETTINGS                   =
    *     IS_LAYOUT                         =
          IT_FIELDCAT                       = IT_FCAT
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS                 =
          IT_SORT                           = IT_SORT
    *     IT_FILTER                         =
    *     IS_SEL_HIDE                       =
    "     I_DEFAULT                         = 'X'
    *     I_SAVE                            = ' '
    *     IS_VARIANT                        =
    "     IT_EVENTS                         = T_EVENT
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT                          =
    *     IS_REPREP_ID                      =
    *     I_SCREEN_START_COLUMN             = 0
    *     I_SCREEN_START_LINE               = 0
    *     I_SCREEN_END_COLUMN               = 0
    *     I_SCREEN_END_LINE                 = 0
    *     I_HTML_HEIGHT_TOP                 = 0
    *     I_HTML_HEIGHT_END                 = 0
    *     IT_ALV_GRAPHICS                   =
    *     IT_HYPERLINK                      =
    *     IT_ADD_FIELDCAT                   =
    *     IT_EXCEPT_QINFO                   =
    *     IR_SALV_FULLSCREEN_ADAPTER        =
    *   IMPORTING
    *     E_EXIT_CAUSED_BY_CALLER           =
    *     ES_EXIT_CAUSED_BY_USER            =
         TABLES
           t_outtab                          = IT_BSID
    *   EXCEPTIONS
    *     PROGRAM_ERROR                     = 1
    *     OTHERS                            = 2
       IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    endform.                    " DISPLAY
    *&      Form  FORMAT_FIELD_CATOLOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    *form FORMAT_FIELD_CATOLOG .
    *  beg_month = listbox1.
    *end_month = listbox2 .
    *dO.
    *if beg_month gt end_month.
    *  exit.
    *ENdif.
    *enddo.
    *endform.                    " FORMAT_FIELD_CATOLOG
    *CALL FUNCTION 'HR_E_NUM_OF_DAYS_OF_MONTH'
    *  EXPORTING
    *    p_fecha              = SY-DATUM
    ** IMPORTING
    **   NUMBER_OF_DAYS       =
    *&      Form  DISPLAY1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    *form DISPLAY1 .
    *CALL FUNCTION 'MONTH_PLUS_DETERMINE'
    *  EXPORTING
    *    months        = 12
    *    olddate       = SY-DATUM
    * IMPORTING
    *   NEWDATE       = RESULT.
    *endform.                    " DISPLAY1
    "DATA: T_OUTPUT TYPE REF TO DATA.
    "FIELD-SYMBOLS: &LTT_OUTPUT&GT TYPE TABLE.
    "Call Method CL_ALV_TABLE_CREATE->CREATE_DYNAMIC_TABLE
    "Exporting
    "IT_FIELDCATALOG = T_FIELDCAT
    "Importing
    "EP_TABLE = T_OUTPUT.
    "ASSIGN T_OUTPUT->* TO &LT;T_OUTPUT&GT;.
    "*&      Form  DISPLAY1
    "*       text
    "*  -->  p1        text
    "*  <--  p2        text
    "form DISPLAY1 .
    "CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    " EXPORTING
    "*   I_BUFFER_ACTIVE              =
    "   I_STRUCTURE_NAME             = sy-repid
    "*   I_CLIENT_NEVER_DISPLAY       = 'X'
    "*   I_BYPASSING_BUFFER           =
    "*   I_INTERNAL_TABNAME           =
    "  CHANGING
    "    ct_fieldcat                  = it_fcat
    "* EXCEPTIONS
    "*   INCONSISTENT_INTERFACE       = 1
    "*   PROGRAM_ERROR                = 2
    "*   OTHERS                       = 3
    "IF sy-subrc <> 0.
    "* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    "*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    "ENDIF.
    "endform.                    " DISPLAY1
    please check the code....

    Hi Suprit Patil,
    First you need to create table with   CL_ALV_TABLE_CREATE->CREATE_DYNAMIC_TABLE to assign value to field.
    Now logic is simple.
    Create fieldcat, add aditional field to fieldcat ( in your case months ), now create table with this fieldcat. You need to add your dynamic field to fieldcat manualy.
    select needed data to template table. now to assign field to created table you need to now fieldname.
    Here is the example : http://scn.sap.com/message/14468651#14468651
    and adding this example to assign sipecific field:
    FIELD-SYMBOLS  : <field> TYPE any.
    in your loop. assign your dynamic field like this : you need to know field name.
    ASSIGN COMPONENT 'FIELDNAME' OF STRUCTURE <fs_line> TO <field>.
    for example : fieldname = 'FEB'.
    ASSIGN COMPONENT 'FEB' OF STRUCTURE <fs_line> TO <field>.
    IF bsid-monat EQ '02'.
         <field> = bsid-wrbtr.
    ENDIF.
    Regards
    Tolga

  • Adding columns dynamically

    Hello all,
    i have problem i need your help on the same.i have three tables
    prod,prod_attribute,prod_attributeval
    Table will hold the values like
    prod
    prod_id prod_desc
    1 shirt
    2 Pant
    3 Trouser
    prod_attribute
    attribute_id name prod_id
    1 color 1
    2 size 1
    3 color 2
    4 color 3
    5 size 3
    6 type 3
    prod_attributeval
    attribute_val_id name attribute_id prod_id
    1 red 1 1
    2 XXl 2 1
    3 blue 3 2
    4 black 4 3
    5 xl 5 3
    6 sample 6 3
    i want o/p like
    prod_id prod_desc attribute_id color size type
    1 shirt 1 red xxl null
    2 pant 2 blue null null
    3 trouser 3 black xl sample
    if this not the right forum for this question plz guide me the correct forum
    Thanks in advance

    user8963876 wrote:
    Hello all,
    i have problem i need your help on the same.i have three tables
    prod,prod_attribute,prod_attributeval
    Table will hold the values like
    prod
    prod_id prod_desc
    1 shirt
    2 Pant
    3 Trouser
    prod_attribute
    attribute_id name prod_id
    1 color 1
    2 size 1
    3 color 2
    4 color 3
    5 size 3
    6 type 3
    prod_attributeval
    attribute_val_id name attribute_id prod_id
    1 red 1 1
    2 XXl 2 1
    3 blue 3 2
    4 black 4 3
    5 xl 5 3
    6 sample 6 3
    i want o/p like
    prod_id prod_desc attribute_id color size type
    1 shirt 1 red xxl null
    2 pant 2 blue null null
    3 trouser 3 black xl sample
    if this not the right forum for this question plz guide me the correct forum
    Thanks in advanceThat scarily looks like your heading toward an Entity Attribbute Value model design for your database. Warning!. . . . DON'T DO IT!
    EAV databases are notoriously poor in performance, difficult to maintain (even though the design is supposed to make maintenance easier) and removes any ability for the database engine to utilise simple SQL queries.
    Take a read of this: [Bad CaRMa|http://www.simple-talk.com/opinion/opinion-pieces/bad-carma/]
    I've come across a database that is designed using EAV and whilst, in principle it's a simple application and business process that should be able to run on a single medium level server, the EAV model has caused it to require the two most powerful servers in the company with other load balancing hardware... and still the application for the users runs slowly. There are very few applications (if any) that EAV is suitable for.

  • Adding the columns dynamically in crystal report

    Hi,
      I am developing a application using asp.net and crystal report. In a report the column is created dynamically( ie, the report gets input from a sp which returns N no. of columns). Since i dont know the column name and no. of columns at design time i am not able to create the report. If any of you have any idea on adding the columns dynamically please send me the code or the link.
    Thanks
    Sankar

    Hello Sankar,
    please see CS code for VS 2005 below to add a database field to a report using inproc RAS.
    This sampels retrieves the table column name from the database and adds it to the report.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.DataDefModel;
    namespace CS_Add_Field_inproc
        public partial class Form1 : Form
            // CR Declarations
            ReportDocument boReportDocument;
            ISCDReportClientDocument boReportClientDocument;
            CrystalDecisions.ReportAppServer.ReportDefModel.Section boSection;
            CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject boFieldObject;
            public Form1()
                InitializeComponent();
                //Create a new ReportDocument
                boReportDocument = new ReportDocument();
                // load the RPT file
                boReportDocument.Load("..
    AddField.rpt");
                //Access the ReportClientDocument in the ReportDocument (EROM bridge)
                boReportClientDocument = boReportDocument.ReportClientDocument;
                //Get the first section in the details section
                   boSection = boReportClientDocument.ReportDefController.ReportDefinition.DetailArea.Sections[0];
                   //Create the field object that we will add to the report and set all of its properties
                   boFieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
                //Set which field to use for the data to be displayed
                   boFieldObject.DataSourceName = "{Customer.City}";
                   boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeStringField;
                   boFieldObject.Left = 4 * 1440; //1440 twips per inch
                   boFieldObject.Width = 3 * 1440;
                   boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
                   boFieldObject.FontColor.Font.Name = "Arial";
                   boFieldObject.FontColor.Font.Size = 10;
                   boFieldObject.Format.HorizontalAlignment = CrystalDecisions.ReportAppServer.ReportDefModel.CrAlignmentEnum.crAlignmentLeft;
                   //Add the object to the report
                   boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;
            private void button1_Click(object sender, EventArgs e)
                //Get the first section in the details section
                boSection = boReportClientDocument.ReportDefController.ReportDefinition.DetailArea.Sections[0];
                //Create the field object that we will add to the report and set all of its properties
                boFieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
                //Set which field to use for the data to be displayed
                boFieldObject.DataSourceName = "{Customer.City}";
                boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeStringField;
                boFieldObject.Left = 4 * 1440; //1440 twips per inch
                boFieldObject.Width = 3 * 1440;
                boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
                boFieldObject.FontColor.Font.Name = "Arial";
                boFieldObject.FontColor.Font.Size = 10;
                boFieldObject.Format.HorizontalAlignment = CrystalDecisions.ReportAppServer.ReportDefModel.CrAlignmentEnum.crAlignmentLeft;
                //Add the object to the report
                boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;

  • Adding column headings

    I am using RAS server to create dynamic columns in my report. But the column headings are not coming.
    Isnt there any way to set the heading for the newly added columns?   
    Any idea what i am missing?   
    Here is a code i am using
        Private Sub AddTableFromDataSet(ByVal ds As System.Data.DataSet, ByVal crTable As CrystalDecisions.ReportAppServer.DataDefModel.ISCRTable)
            ' Add the dataset as a data source to the report
            m_boReportClientDocument.DatabaseController.AddTable(crTable, DBNull.Value)
            m_boReportClientDocument.DatabaseController.SetDataSource(DataSetConverter.Convert(ds), "TEST")
            Dim ifield As Integer
            ' Add a field to the report canvas
            Dim CrField As CrystalDecisions.ReportAppServer.DataDefModel.ISCRField
            For Each dtfield In m_boReportClientDocument.Database.Tables(0).DataFields
                ifield = m_boReportClientDocument.Database.Tables(0).DataFields.Find(dtfield.Name.ToString, CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, CeLocale.ceLocaleUserDefault)
                CrField = DirectCast(m_boReportClientDocument.Database.Tables(0).DataFields(ifield), Field)
                CrField.HeadingText = CrField.Name
                CrField.Description = "TEST"
                m_boReportClientDocument.DataDefController.ResultFieldController.Add(-1, CrField)
            Next
        End Sub
    Thanks in advance

    You either have to add the heading yourself, or you can use
    reportClientDoc.ReportDefController.ReportObjectController.AddByName("{Orders.OrderID}", "OrderID")
    This doesn't let you set anything about the objects, so it would probably be better to add them separately.

  • Stock Requirement List - MD04 - adding columns in this list

    Dear All,
    I am working on the Stock Requirement list ( transactioncode MD04) and the customer wants to add columns with the fields STPO-DATUV ,date of change of a drawing, and the drawing number with revision level STPO-YY_DZEINR.
    There is a badi MD_ADD_COL_EZPS which provides in adding columns, but according the structures MDPSX , MDEZX and MDSUX there are no fields in thoser structures, which directly match with the required fields; somebody has a clue to help me out and get it working.
    For instance: Vendor- and Customer data  can be added by using the pushbuttons and those fields are available from above mentioned structures.
    Thanks in advance and kindest regards,
    Rene.

    Hi Utpal Mishra
    You guessed correctly. I missed to inform our Strategy. We are using Strategy group  11  Make-to-stock prod./gross reqmts plnning.
    User is not able to do PGI or create delivery. He says I have enough stock in MMBE but why system is not allowing.
    Here there are some pending document like -
    1. Pending sales order
    2. Pending deliveries (picking not done)
    2. Delivery created & Picking Done but PGI not done. These things will have a commitment against the stock. But we are interested in getting these document numbers, so that we can take come action against them.
    MD04 simply shows the mrp element as order / delivery but the document number is not available. How to find these documents.
    Please help. Is there any table or a standard transaction ??
    Thanks

  • Adding Columns to the matrix in SAP B1 user form using Visual studio 2010

    Hi,
    Using Visual studio 2010, I have created a SAP B1 user form( b1f ) with one matrix.Matrix is having 5 columns. Its working properly. Later, I want to add few more columns. Then I added columns to the matrix as I have created columns initially. But, it does not saves.
    i.e, Whenever I run, In B1 I could see only old columns. Newly created columns are not showing.So, I closed the .net project and opened again. Created columns are not showing in visual studio b1f itself. So, I created again and saved. But, its not saving.I tried it many times.
    What I am missing?
    Any help is appreciated.
    Thanks in advance,
    Parvatha Solai.N

    Hi Parvatha,
    Are you using B1 Studio? Anyway try to clean the solution first then rebuild it. This would re-copy files to the output directory, that contain your changes.
    Best regards,
    Pedro Magueija

  • When adding columns, why do I get overrides on style?

    Hi all,
    When I'm adding columns in a certain document I end up with the new columns having overrides on them. How can I avoid this?
    The columns I added are seen in the middle.
    As you can see the they all get a "shift down" by -22 pt.
    I use this shift down on some other place in the document, but the table columns are clean from that kind of override, and just by selecting a column and adding 4 new columns "to the right" of that column, I would expect the new ones to get the exact same properties as the one selected.
    Can anyone try to explain what might be wrong with my document or way of working?
    Adding info: It seems there's something in the styles - many properties on them... This has noting to do with cells specifically. Just adding a textbox results renders the text this way as well, with the baseline shift (only no override symbol).
    Best regards,
    Andreas

    Ah... now I get it. The default styles of the document were set to a specific paragraph style and another character style.
    Setting the defaults to [Basic Paragraph] and None respectively seems to put everything in order.
    (You set a default by clicking outside the document so that nothing is selected, and then you select the styles [Basic paragraph] and None)
    Case closed.

  • Discoverer 10.1.2 does not refresh new added column

    Hello,
    I need help to add a new item to EUL Business Area folder for a new added column in the database table.
    When I refresh the folder in the BA EUL, the result shows no difference between the folder and the underlying table in the database; however, when I quey the table in the database, a new column is there. The refresh of the folder in the Discoverer Admin tool cannot find the newly added column. Weird!! The first time saw this problem.
    Could someone shine some light on it? Would be really appreciate it!
    Ping

    I have a slightly different problem and can't solve it! When I refresh the EUL, the result shows the differences between the folder and the underlying tables in the database. However, it does not refresh the EUL in Discoverer Administrator 10g. Nothing happens! When I try to refresh again, the same list is shown... Does anyone know what could be happening?
    Thanks

  • How to get added columns in the after DDL trigger?

    As title, I want to get information, like name/type/.., about the added columns by sql statement "alter table *** add (***)" in the after ddl trigger. But looks like dba_tab_columns view doesn't include the added columns.
    Thanks

    Hi
    Hi try other versions of the trigger like
    create or replace trigger addl_trigger
    after alter on schema
    declare
    TYPE attrs_cur IS REF CURSOR;
    m_cur attrs_cur;
    m_event varchar2(50);
    m_user varchar2(50);
    m_owner varchar2(50);
    m_user1 varchar2(50);
    m_type varchar2(50);
    m_name varchar2(50);
    m_column varchar2(50);
    m_cnt NUMBER;
    m_stmt varchar2(512);
    number_of_modified_objects BINARY_INTEGER;
    t ora_name_list_t;
    begin
    m_event:=ora_sysevent;
    m_user:=SYS_CONTEXT('USERENV','SESSION_USER');
    m_user1:=ora_login_user;
    m_owner:=ora_dict_obj_owner;
    m_type:=ora_dict_obj_type;
    m_name:=ora_dict_obj_name;
    if (m_type='TABLE' and m_event='ALTER')
    then
              execute immediate 'select count(*) from dba_tab_columns where owner=:1 and table_name=:2' into m_cnt
              using m_owner,m_name;
              insert into log values (m_cnt);
              dbms_output.put_line('->'||m_cnt);
              OPEN m_cur FOR 'select c.name from sys.col$ c, sys.obj$ o, sys.user$ u where o.obj# = c.obj# and o.owner# = u.user# and u.name=:1 and o.name=:2' using m_owner,m_name;
              LOOP
                        FETCH m_cur INTO m_stmt;
                        EXIT WHEN m_cur%NOTFOUND;
                        insert into log values (m_stmt);
                        --dbms_output.put_line(m_stmt||'**************');
                        END LOOP;
    end if;
    but all versions continue to insert only the already existing columns. I think that Oracle actualize the dictionary first after this system event.
    Bye, Aron

  • SSAS Tabular - Adding Column to a table gives error "Object reference not set to instance of object"

    If I make changes to a table in SSAS Tabular Visual Studio, the newly added column gives error as "Object
    reference not set to instance of object"

    Hi VikasJain13,
    According to your description, you get the "Object reference not set to instance of object" error when adding columns in Tabular. Right?
    Generally, it throws this error when the internal code is accessing the property of an empty object. As you mentioned it happens when you make changes on a table, mostly it means that table is already a empty object. Please re-process your tabular to see
    if this table is still existing. 
    If you have any question, please feel free to ask.
    Simon Hou
    TechNet Community Support

  • How to add column dynamically based on user input in oracle?

    **how to add column dynamically based on user input in oracle?**
    I am generating monthly report based on from_date to to_date below is my requirement sample table
    EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE | 01-OCT-12 | 02-OCT-12 | 03-OCT-12
    100001.............John...........02-OCT-12...............6
    100002.............chris...........01-OCT-12...............4
    Based on user input, that is, if user need the report from 01-OCT-12 TO 03-OCT-12, i need to add that dates as column in my table, like 01-OCT-12 | 02-OCT-12 | 03-OCT-12....
    below is my code
    create or replace
    procedure MONTHLY_LVE_NEW_REPORT_demo
    L_BUSINESS_UNIT IN SSHRMS_LEAVE_REQUEST_TRN.BUSINESS_UNIT%TYPE,
    --L_LEAVE_TYPE_CODE           IN SSHRMS_LEAVE_REQUEST_TRN.LEAVE_TYPE_CODE%TYPE,
    L_DEPARTMENT_CODE IN VARCHAR2,
    --L_MONTH                    IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
    L_FROM_DATE IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
    L_TO_DATE in SSHRMS_LEAVE_REQUEST_TRN.LVE_TO_DATE%type,
    MONTHRPT_CURSOR OUT SYS_REFCURSOR
    AS
    O_MONTHRPT_CURSOR_RPT clob;
    v_return_msg clob;
    BEGIN
    IF (L_BUSINESS_UNIT IS NOT NULL
    AND L_FROM_DATE IS NOT NULL
    and L_TO_DATE is not null
    -- AND L_DEPARTMENT_CODE IS NOT NULL
    THEN
    OPEN MONTHRPT_CURSOR FOR
    select EMPLOYEE_CODE, EMPLOYEE_NAME AS NAME, DEPARTMENT_CODE AS DEPARTMENT,DEPARTMENT_DESC, CREATED_DATE,
    NVL(WM_CONCAT(CL_RANGE),'') as CL_TAKEN_DATE,
    case when NVL(SUM(CL2),0)<0 then 0 else (NVL(SUM(CL2),0)) end as CL_BALANCE,
    from
    SELECT DISTINCT a.employee_code,
    a.EMPLOYEE_FIRST_NAME || ' ' || a.EMPLOYEE_LAST_NAME as EMPLOYEE_NAME,
    a.DEPARTMENT_CODE,
    a.DEPARTMENT_DESC,
    B.LEAVE_TYPE_CODE,
    B.LVE_UNITS_APPLIED,
    B.CREATED_DATE as CREATED_DATE,
    DECODE(b.leave_type_code,'CL',SSHRMS_LVE_BUSINESSDAY(L_BUSINESS_UNIT,to_char(b.lve_from_date,'mm/dd/yyyy'), to_char(b.lve_to_date,'mm/dd/yyyy'))) CL_RANGE,
    DECODE(B.LEAVE_TYPE_CODE,'CL',B.LVE_UNITS_APPLIED)CL1,
    b.status
    from SSHRMS_EMPLOYEE_DATA a
    join
    SSHRMS_LEAVE_BALANCE C
    on a.EMPLOYEE_CODE = C.EMPLOYEE_CODE
    and C.STATUS = 'Y'
    left join
    SSHRMS_LEAVE_REQUEST_TRN B
    on
    B.EMPLOYEE_CODE=C.EMPLOYEE_CODE
    and c.EMPLOYEE_CODE = b.EMPLOYEE_CODE
    and B.LEAVE_TYPE_CODE = C.LEAVE_TYPE_CODE
    and B.STATUS in ('A','P','C')
    and (B.LVE_FROM_DATE >= TO_DATE(L_FROM_DATE, 'DD/MON/RRRR')
    and B.LVE_TO_DATE <= TO_DATE(L_TO_DATE, 'DD/MON/RRRR'))
    join
    SSHRMS_LEAVE_REQUEST_TRN D
    on a.EMPLOYEE_CODE = D.EMPLOYEE_CODE
    and D.LEAVE_TYPE_CODE in ('CL')
    AND D.LEAVE_TYPE_CODE IS NOT NULL
    group by EMPLOYEE_CODE, EMPLOYEE_NAME, DEPARTMENT_CODE, DEPARTMENT_DESC, CREATED_DATE
    else
    v_return_msg:='Field should not be empty';
    end if;
    END;
    my code actual output
    EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE
    100001....................John............02-OCT-12.................6
    100001....................chris...........01-OCT-12.................4
    how to add column dynamically based on from_date to to_date?
    Thanks and Regards,
    Chris Jerome.

    You cannot add columns dynamically. But you can define a maximum number of numbers and then hide unused columns in your form useing SET_ITEM_PROPERTY(..,VISIBLE, PROPERTY_FALSE);

  • How to create  some columns dynamically in the report designer depending upon the input selection

    Post Author: ekta
    CA Forum: Crystal Reports
    how  to create  some columns dynamically in the report designer depending upon the input selection 
    how  export  this dynamic  report in (pdf , xls,doc and rtf format)
    report format is as below:
    Element Codes
    1
    16
    14
    11
    19
    10
    2
    3
    Employee nos.
    Employee Name
    Normal
    RDO
    WC
    Breveavement
    LWOP
    Sick
    Carers leave
    AL
    O/T 1.5
    O/T 2.0
    Total Hours
    000004
    PHAN , Hanh Huynh
    68.40
    7.60
    76.00
    000010
    I , Jungue
    68.40
    7.60
    2.00
    5.00
    76.00
    000022
    GARFINKEL , Hersch
    66.30
    7.60
    2.10
    76.00
    In the above report first column and the last columns are fixed and the other columns are dynamic depending upon the input selection:
    if input selection is Normal and RDO then only 2 columns w'd be created and the other 2 fixed columns.
    Can anybody help me how do I design such report....
    Thanks

    Hi Developer life,
    According to your description that you want to dynamically increase and decrease the numbers of the columns in the table, right?
    As Jason A Long mentioned that we can use the matrix to do this and put the year field in the column group, amount fields(Numric  values) in the details,  add  an filter to filter the data base on this column group, but if
    the data in the DB not suitable to add to the matrix directly, you can use the unpivot function to turn the column name of year to a single row and then you can add it in the column group.
    If there are too many columns in the column group, it will fit the page size automatically and display the extra columns in the next page.
    Similar threads with details steps for your reference:
    https://social.technet.microsoft.com/Forums/en-US/339965a1-8cca-41d8-83ef-c2548050799a/ssrs-dataset-column-metadata-dynamic-update?forum=sqlreportings 
    If your still have any problem, please try to provide us more details information, such as the data structure in the DB and the table structure you are currently designing.
    Any question, please feel free to let me know.
    Best Regards
    Vicky Liu

  • Header description of dynamic data columns dynamically

    Hi all,
    How is it possible to get Header description of dynamic data columns dynamically??
    Thanks and regards,
    Harry

    Harry,
    Don't have the system right now so going by memory.
    There are 2 parts - you need to see how you specified the text replacement of the variable.  Say on 0fiscper if you specify characteristic value it would show I think 001.2007, 002.2007, etc.  If you use one of the text types, it would be based on the description.
    I always have to think if I need to put the infoobject name or the variable name in the layout definition in the description part.  Off the top of my mind, it would be the infoobject name i.e. 0fiscper for example

  • Irritating problem with adding columns

    I am adding columns to jtable. And then moving it to required postion.
    But whenever I edit those columns all the newly added columns and the first column reflects those changes. ie whatever I enter in the new columns, it appears in all newly added columns and the first column as well.
    whats wrong I am doing here.
    EditableHeaderTableColumn ncol = new EditableHeaderTableColumn();
    TableColumnModel columns = table.getColumnModel();
    int c = table.getSelectedColumn();
    columns.addColumn(ncol);
    columns.moveColumn(i-1, c+1);

    Make sure you are not sharing the TableColumn instance or adding a TableColumn that already is in the TableColumnModel.
    When resizing the table column, do the others resize too. ?

Maybe you are looking for