Display dynamic columns in ALV

Hi All,
I have a requirement in which I have develop a report displaying material master basic data and classification data. The basic data I am getting from MARA and MAKT tables. And for classification data I am getting the class maintained from each material from tables INOB,KSSK and from KLAH, then I am getting the characteristics and its values by calling BAPI u2018BAPI_OBJCL_GETDETAILu2019 for each material .
Now I have to prepare ALV  having column name for basic data (would be static) and characteristic name (would be dynamic, and I have to display characteristics values under it, for each material ).
For example: if  material u2018CHWOJA4u2019 has 2 characteristics as u2018country (value u2018Franceu2019)u2019 and  u2018creation season(value u2018Decu2019)u2019  and second material u2018E50480u2019 has  3 characteristics as u2018Abacus (value u2018yesu2019)u2019 ,u2018country (value u2018Indiau2019)u2019 and  u2018 season(value Jank)u2019 , the  ALV output would be :
Material Number;     Material description; Base Unit of Measure;Material Group; Abacus; Country;season          
CHWOJA4; JACKET;PC;Z05; ; France;Dec          
E50480;BRAZIL REAL;PC;Z06; yes; India;Jan               
In short, my last column of the ALV would be the characteristic name and the content would be the char. value.
Can you please suggest some ways to achieve this? A quick reply would be highly appreciated!
Thanks,
Vanitha

Idea here is to have many fields for characterstic values in your output internal table.
For eg.
types : Begin of ty_mara,
           matnr type matnr_d,
           mtext type mktxt,
           char1 type string,
           char2 type string,
           char20 type string.
Check for all the materials which has the maximum characterstic values. So, say for a material, there are 12 characterstics values and that is the maximum compared to anyother materials. Then in the field catalog hide the columns related to charactertics CHAR13 onwards till CHAR20.
Note : I have assumed char20 as the max., which you can alter based on your scenario.
Regards
Ranganath

Similar Messages

  • Dynamic columns in ALV

    Dear Experts,
    I want to display dynamc columns in ALV, how it possible.
    venkey

    create dynamic internal table from field catalog i m sending u some sample code hope it will help u.
    FORM create_dynamic_itab.
    Create dynamic internal table and assign to FS
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fieldcat[]
        IMPORTING
          ep_table        = dy_table.
      ASSIGN dy_table->* TO <dyn_table>.
    Create dynamic work area and assign to FS
      CREATE DATA dy_line LIKE LINE OF <dyn_table>.
      ASSIGN dy_line->* TO <dyn_wa>.
    ENDFORM.

  • Displaying dynamic columns in the query output.

    Hello,
    Depending on current quarter output of the query would vary.
    If current quarter is 'Q1'
    O/p : InvQ1  Del  BackQ1  BackQ2  BackQ3  BackQ4
    If current quarter is 'Q2'
    O/p : InvQ1  InvQ2  Del  BackQ2  BackQ3  BackQ4
    If current quarter is 'Q3'
    O/p : InvQ1  InvQ2  InvQ3  Del  BackQ3  BackQ4
    If current quarter is 'Q4'
    O/p : InvQ1  InvQ2  InvQ3  InvQ4  Del  BackQ4
    So, out of 9 columns, 6 columns would display at any given time depending on the current quarter.
    Invoice of 4 quarters, Deliquency and Backlog of 4 quarters.
    I am not getting any way how to display dynamic columns or hide unwanted/blank columns.
    For the time being I have added all 9 columns in the query, and in the output unwanted columns shows blank.
    Can anybody please suggest me how to display only 6 columns in the output depending on current quarter.
    Thanks and Regards
    Shilpa

    Hello,
    This shouldn't be too difficult. Assuming you have a variable with the selected quarter, you may choose to display Inv (whatever that is) for quarters 1 through variable, Del, and Back for quarters variable through 4. You also need a drilldown on quarter in the columns (after the key figure structure). You would probably need to restrict 'Del' on the variable as well if you haven't already done it.
    Best regards,
    Christoffer

  • How to display dynamic column added by vo.addDynamicAttribute in jspx?

    Hi,
    I met problem when programmatically add cloumn and display it on screen. Here are my steps:
    0. define a ViewObject using xml. Define a transient column Addtion2. later will add a dynamic column Addtion3, but not defined here.
    1. Implement Application Module, adding a method init() and expose it to client.
    2. In init() method, get target VO and use vo.addDynamicAttribute("Addition3"). Then iterate it use row.setAttribute("Addition3", Math.random()). Add init() to page binding and invoke it.( it's invoked )
    3. In jspx, use dynamic table. But Addition3 never shows up.
    This is my last question: Re: How to display dynamic column added by vo.addDynamicAttribute in jspx? People say I should use dynamic table.
    please have a look at my code:
    Application Module: when it runs, it will print 6 coulmns. vo.getAttributeCount() is <font color="red">6</font>.
    <pre>
    public void init() {
    ViewObject vo = this.getCountryView1();
    if (vo.getAttributeIndexOf("Addition3") == -1) {
    vo.addDynamicAttribute("Addition3");
    vo.executeQuery();
    for (AttributeDef deft : vo.getAttributeDefs()) {
    System.out.println(deft.getColumnName() + ": " + deft.getName());
    RowSetIterator it = vo.createRowSetIterator("i1");
    while (it.hasNext()) {
    Row r = it.next();
    r.setAttribute("Addition2", Math.random());
    r.setAttribute("Addition3", Math.random());
    it.closeRowSetIterator();
    for (AttributeDef deft : vo.getAttributeDefs()) {
    System.out.println(deft.getColumnName() + ": " + deft.getName());
    System.out.println(vo.getAttributeCount()); //vo.getAttributeCount() is 6
    </pre>
    jspx: when it runs, only 5 columns are shown. Column Addition2's values are set as expected. but Column Addition3 never shows up. And #{bindings.CountryView1.attributeCount} shows <font color="red">5</font>.
    <pre>
    <af:table rows="#{bindings.CountryView1.rangeSize}"
    fetchSize="#{bindings.CountryView1.rangeSize}"
    emptyText="#{bindings.CountryView1.viewable ? 'No data to display.' : 'Access Denied.'}"
    var="row" rowBandingInterval="0"
    value="#{bindings.CountryView1.collectionModel}"
    selectedRowKeys="#{bindings.CountryView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.CountryView1.collectionModel.makeCurrent}"
    rowSelection="single" id="t1">
    <af:forEach items="#{bindings.CountryView1.attributeDefs}" var="def">
    <af:column headerText="#{def.name}"
    sortable="true" sortProperty="#{def.name}" id="c1">
    <af:outputText value="#{row[def.name]}" id="ot1"/>
    </af:column>
    </af:forEach>
    </af:table>
    <af:forEach items="#{bindings.CountryView1.attributeDefs}" var="def">
    <af:outputText value="#{def.name}" id="ot2"/>
    </af:forEach>
    <af:outputText value="#{bindings.CountryView1.attributeCount}" id="ot3"/>
    </pre>
    it's quite weird for me. The vo.getAttributeCount() is 6, but #{bindings.CountryView1.attributeCount} shows 5. And column Addtion3 never shows up.
    what's the matter? How can I show the dynamic added column Addtion3?
    Edited by: simon li on 2012-9-10 下午7:31
    Edited by: simon li on 2012-9-10 下午8:00

    Hi,
    Can you check the tree binding (CountryView1 - in the pagedef) and see it has the 5 attributes hardcoded in it. If yes, try removing everything and then run the page to see if it works fine.
    -Arun

  • Dynamic columns in ALV report

    halo fellow SAPiens,
    i need to show dynamic columns for a particular material........the scenario is as follows....
    1) there r 7 fixed columns describing the material...
    2)when the material returns back to the plant for some reason , i need to insert a column which shows the date and reason(char) of return.
    3)again after dispatching the material for some reason it comes back again a new column shld be displayed showin the date and reason(char).
    4)if the material doesnt come back...the report shows only 7 columns.
    any solution?

    try <a href="http://www.alvrobot.com.ar/home.php">here</a>  ......its a useful tool for dealing with ALV
    <b>reward points if useful</b>

  • To increase dynamically columns in ALV report

    hi everyone,
    Could any one give me a sample code ,to increase columns in ALV report output dynamically as record increase, i need to increase columns so that i can keep all the years data of a particular project in one row

    Please refer to the code piece
    *& Report  ZTEST_DYNAMIC_ALV
    REPORT  ztest_dynamic_alv.
    DATA: gt_fcat TYPE lvc_t_fcat,
          gw_grid TYPE REF TO cl_gui_alv_grid.
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-s01.
    PARAMETERS: p_number TYPE i.
    SELECTION-SCREEN : END OF BLOCK b1.
    ** Start of Selection
    START-OF-SELECTION.
    *1) Create Base Catalog
      PERFORM sub_create_base_catalog.
    *2) Add additional fields
      PERFORM sub_fill_addtional.
    *3) Display output data.
      PERFORM sub_display_output.
    *&      Form  SUB_CREATE_BASE_CATALOG
    *       Create Base catalog for display
    FORM sub_create_base_catalog .
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'ZSTRCT'
        CHANGING
          ct_fieldcat            = gt_fcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    ENDFORM.                    " SUB_CREATE_BASE_CATALOG
    *&      Form  SUB_FILL_ADDTIONAL
    *       text
    FORM sub_fill_addtional .
      DATA: lw_fcat  TYPE lvc_s_fcat,
            lw_from  TYPE i,
            lw_data  TYPE REF TO data,
            lw_fname TYPE stfna,
            lw_index(2) TYPE n.
      FIELD-SYMBOLS: <l_output> TYPE table.
      DESCRIBE TABLE gt_fcat LINES lw_from.
      DO p_number TIMES.
        lw_from = lw_from + 1.
        lw_index = sy-index.
        CONCATENATE 'DYNA' lw_index INTO lw_fname SEPARATED BY '-'.
        lw_fcat-col_pos = lw_from.
        lw_fcat-fieldname = lw_fname.
        lw_fcat-tabname = '1'.
       lw_fcat-scrtext_l = lw_fcat-scrtext_m = lw_fcat-scrtext_s = lw_fname.
        APPEND lw_fcat TO gt_fcat.
        CLEAR lw_fcat.
      ENDDO.
    ** Convert gt_fcat to internal table.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = gt_fcat
        IMPORTING
          ep_table                  = lw_data
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
      IF sy-subrc = 0.
    ** Create the internal table form field catalog.
        ASSIGN lw_data->* TO <l_output>.
    ** display the ALV data.
        CREATE OBJECT gw_grid
          EXPORTING
            i_parent          = cl_gui_container=>screen0
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5.
        IF sy-subrc = 0.
          CALL METHOD gw_grid->set_table_for_first_display
            CHANGING
              it_outtab                     = <l_output>
              it_fieldcatalog               = gt_fcat
            EXCEPTIONS
              invalid_parameter_combination = 1
              program_error                 = 2
              too_many_lines                = 3
              OTHERS                        = 4.
          IF sy-subrc = 0.
            MESSAGE s000(zrak) WITH p_number 'DISPLAYED DYNAMICALLY'.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " SUB_FILL_ADDTIONAL
    *&      Form  SUB_DISPLAY_OUTPUT
    *       text
    FORM sub_display_output .
      CALL SCREEN '9001'.
    ENDFORM.                    " SUB_DISPLAY_OUTPUT
    *&      Module  STATUS_9001  OUTPUT
    *       text
    MODULE status_9001 OUTPUT.
      SET PF-STATUS ' '.
      SET TITLEBAR 'MAIN00'.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
    *       text
    MODULE user_command_9001 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK' OR
             'CANC' OR
             '%EX'.
          SET SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT

  • Dynamic columns for ALV/classical

    Hi friends,
    I came across an issue where I need to create an output list based on the selection screen.
    Example: In selection screen if user enters plant 1000 2000 3000 4000 .
    I want the output table having columns 1000 2000 3000 4000 .
    Please help me out how to accomplish this task.  Is  this functionality is possible with ALV..?
    A sample code for this will really help me a lot .. or send me your valuable suggestions..
    Thanks
    Prasead K

    Search sdn for [cl_alv_table_create=>create_dynamic_table|https://www.sdn.sap.com/irj/scn/advancedsearch?query=cl_alv_table_create%3d%3ecreate_dynamic_table&cat=sdn_all], there are already many threads and samples. Basically, you dynamically fill an ALV fieldcatalog, then use the method to create a dynamic internal table from this catalog, fill the internal table and display it.
    Regards

  • Display Dynamic Columns in Crystal Report

    Hello,
    We are currently using Crystal Reports XI and connecting to an ADO .NET XML file as our data source. In this data souce we have a data table called IDENTIFIERS where every column, except for the ones used for joining tables is dynamic. These column will be different for each database thats its run against.
    Is there any way to display these dynamic columns without having consistent column names?
    You help is much appreciated.
    Thanks,
    Adam

    Thanks Carl,
    We do have control over the data table and a solution like this had crossed my mind. But this might not be practical for other reports that use this data table.
    I think another solution would be to create a new data tabl that has all identifiers on their own row as opposed to columns.
    id
    dentifier
    identifier_name

  • How to Display Sub-Columns using ALV Grid

    Hi ,
      Could someone tell me how to display sub-columns under a parent column using ALV Grid. Do we have any standard Program which has this scenario. Please let me know.
    Thanks,
    Abaper.
    Message was edited by:
            ABAP'er

    you can check all with <b>BCALV* or RSDEMO*</b> in SE38 for all Std
    check below
    BCALV_DND_01                   Drag ALV Row to Tree Folder
    BCALV_DND_02                   Drag Icons from Tree to Rows of the Grid
    BCALV_GRID_DND_TREE            ALV Grid: Drag and Drop with ALV Tree
    BCALV_GRID_DND_TREE_SIMPLE     ALV GRID: Drag and drop with ALV tree (simple)
    BCALV_TEST_COLUMN_TREE         Program BCALV_TEST_COLUMN_TREE
    Rewards if useful............
    Minal

  • How to Display Sub-Columns using ALV

    Hi experts,
        Could someone tell me how to display sub-columns under a parent column using ALV. Do we have any standard Program which has this scenario. points are guaranteed for the right answer.
    Thanks in advance
    Sreenivas

    you can check all with <b>BCALV* or RSDEMO*</b> in SE38 for all Std
    check below
    BCALV_DND_01                   Drag ALV Row to Tree Folder
    BCALV_DND_02                   Drag Icons from Tree to Rows of the Grid
    BCALV_GRID_DND_TREE            ALV Grid: Drag and Drop with ALV Tree
    BCALV_GRID_DND_TREE_SIMPLE     ALV GRID: Drag and drop with ALV tree (simple)
    BCALV_TEST_COLUMN_TREE         Program BCALV_TEST_COLUMN_TREE
    Rewards if useful............
    Minal

  • Issue in Smartform  "need to display dynamic column or cell"

    HI,
    I need some issue with smart form " ITEM Details"
    matnr maktx menge uom
    i have defined all in the inside table so that i have selected frame ?
    now my issue is i should display only matnr maktx uom
    i don't want display Menge column  if it doesn't have vaule ( in clude cell and box also ).
    i need to display  Menge column  if it  has value .
    how to resolve the issue in smartform?
    replas ASAP.
    Thanks

    Hi,
    Kindly check the below links.. hope this will help you.
    Hide table columns in smart form?
    Hiding column in table in smartform
    Regards,
    Booma Ganesan
    Edited by: booma ganesan on Apr 28, 2010 4:05 PM

  • ALV Display dynamic column with multiline header

    Hi All.
    I need to create alv display with dynamic number of columns. Also, it contains two header line. Kindly help me in coding.
    The required format is this format.
    Product | Week1 | Week2 |.......| WeekN
    |--||---|--
                | Sales   | Sales   |.......| Sales
    |--| |---|--
    PRD1   | value    | Value    |.......| Value
    PRD2   | value    | Value    |.......| Value
    PRD3   | value    | Value    |.......| Value
    Thanks.
    Sadhna

    Hi Sadhana,
    You mean to say that your internal Table contains
    ABCDEF are the fields in your Internal table.
    A--BCD---E-----F
    1--12---13---a11----1
    2--11---01---b9-----0
    3--01---00---c32----0
    4--14---01---d21----0
    Now using Dynamic Internal Table it should display the output as follow :
    A--BCF---a---b-c----d
    1--12---13---111-9-32--21
    Here you want to display the the fields of D as header and E as its corresponding values...?
    Please let me knwo if you mean the same..
    Regards,
    Kittu

  • Dynamic column in ALV Report

    Hi,
    We need to display amount fields in the ALV and that fields should be able to display both 3 decimals or 2 decimals at the same time.When we refer this as a character field it is not allowed for totals/subtotals .
    if we refer it as 3 decimals ,it is adding zero for 2 decimal  values.
    if we refer it as 2 decimals ,it is adding rounding off  for 2 decimal  values.
    How can we dynamically refer this field in order to handle both these cases at the same time?
    We tried with reference of CURR ,but no use.
    Any pointers in this regard are highly appreciated.
    Regards,

    Hi Kranti,
    if you want to display amount then you should use amount fields. Then you need another column for the currency displayed. In the field catalog, you reference the amount field to the currensy field using fieldcat component CFIELDNAME.
    Then all values are displayed with the number of decimals defined for the respective currency.
    Additionally, you will get separate subtotal lines for each currency.
    --  asked several times, answered several times --
    What serach term did you use?
    Kind regards,
    Clemens

  • DISPLAYING -DYNAMIC COLUM  IN ALV ??? READ MESSGAE

    hi friends ,
    Thanks for your reply , here is one question i am displaying my code
    in short .. what i want is to display column dynamically using the
    field-symbols.... can anybody help me with syntax or code i wil be
    thank full to him .i find little code for it on sdn also .
    sdn code,
    1. Create your field catalog either manually or automatically using the function module, LVC_FIELDCATALOG_MERGE.
    Add more rows to the field catalog table (T_FIELDCAT) at run time.
    2. Use the field catalog to create a table dynamically using the method below.
    DATA: T_OUTPUT TYPE REF TO DATA
    FIELD-SYMBOLS: <T_OUTPUT> 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 <T_OUTPUT>.
    Now the field symbol <T_OUTPUT> is pointing to an output table of the structure that contains the fields which were determined at runtime.
    Now fill this table with the data and pass <T_OUTPUT> to the method SET_TABLE_FOR_FIRST_DISPLAY and the ALV grid should show the data properly.
    here is my code."""" IAM USING SCREEN..HERE
    after the start of selection .
      LOOP AT i_vat.
                IF i_vat-mwskz IS NOT INITIAL.
                       'CALCULATE_TAX_ITEM'
                  i_itaxcom-bukrs = i_vat-bukrs.
                  i_itaxcom-waers = i_vat-waers.
                  i_itaxcom-kposn = i_vat-ebelp.
                  i_itaxcom-mwskz = i_vat-mwskz.
                  i_itaxcom-wrbtr = i_vat-netwr.
                  i_itaxcom-matnr = i_vat-matnr.
                  i_itaxcom-mglme = i_vat-menge.
                  i_itaxcom-werks = i_vat-werks.
                  i_itaxcom-bldat = i_vat-bedat.
                  i_itaxcom-budat = i_vat-bedat.
                  i_itaxcom-lifnr = i_vat-lifnr.
                       i_itaxcom-shkzg = 'H'.
                  i_itaxcom-xmwst = 'X'.
                  i_itaxcom-matkl = i_vat-matkl.
                  i_itaxcom-meins = i_vat-meins.
                  i_itaxcom-mtart = i_vat-mtart.
                       i_itaxcom-land1 = 'IN'.
                       i_itaxcom-ebeln = zxekko-ebeln.
                       i_itaxcom-ebelp = <fs>-ebelp.
                       *end of correction 20.10.2004
                  REFRESH i_otaxcom.
                  CALL FUNCTION 'CALCULATE_TAX_ITEM'
                    EXPORTING
                     i_taxcom                  = i_itaxcom
                   TABLES
                     t_xkomv                   = i_otaxcom.
    LOOP AT  i_otaxcom WHERE kposn = i_vat-ebelp.    "kposn - condition item number 
             READ TABLE i_tcode WITH KEY  ebeln = i_vat-ebeln
                                          ebelp = i_vat-ebelp
                                          kschl = i_otaxcom-kschl.  
                    IF sy-subrc <> 0.
                      IF i_otaxcom-kwert <> 0.
                        i_tcode-kschl =  i_otaxcom-kschl.
                         tcode-ebeln = i_vat-ebeln.     
                        i_tcode-ebelp = i_vat-ebelp.
                        i_tcode-kschl = i_otaxcom-kschl.
                        i_tcode-kwert = i_otaxcom-kwert.
                        APPEND i_tcode.
                      ENDIF.
                    ENDIF.
                  ENDLOOP.
                ENDIF.
              ENDLOOP.
              LOOP AT i_vat.
                count1 = 1.
                LOOP AT i_tcode WHERE ebeln = i_vat-ebeln AND ebelp = i_vat-ebelp.
              Alv_fieldname+5 = count1.
                    ASSIGN COMPONENT Alv_fieldname OF STRUCTURE i_vat
                    TO <fs_value>.
                      IF sy-subrc EQ 0.
                    <fs_value> = i_tcode-kwert.
                     ENDIF.
                 count1 = count1 + 1.
                  MODIFY i_vat.
                ENDLOOP.
              ENDLOOP.
              SELECT DISTINCT kschl
                              vtext
                   INTO CORRESPONDING FIELDS OF TABLE i_tcode1
                   FROM t685t
                   FOR ALL ENTRIES IN i_tcode
                   WHERE kschl = i_tcode-kschl AND
                         kappl = 'TX'          AND
                         spras = sy-langu.
              count1 = 1..
              LOOP AT i_tcode1
    READ TABLE i_tcode WITH KEY  kschl = i_tcode1-kschl .
                IF sy-subrc = 0.
                  CONCATENATE 'BAVAL' count1 INTO fld_name.
                  i_tcode1-text  = fld_name.
                  MODIFY i_tcode1.
                  count1 = count1 + 1.
                ENDIF.
              ENDLOOP.
    PERFORM sort_build USING gt_sort[].
              PERFORM layout_init USING gs_layout.
              PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'EBELN' 'C' 'Documnet No'.
              PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'EBELP' 'C' 'Line Item'.
              PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'WERKS' 'C' 'Plant'.
              PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'LIFNR' 'C' 'Vendor'.
              PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NAME1' 'C' 'Vendor Name '.
              PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'MATNR' 'C' 'Material'.
              PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'MAKTX' 'C' 'Material Description'.
              PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'MENGE' 'QUAN' 'Order Quantity '.
              PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NETPR' 'CURR' 'Price  Rate'.
    OR DYNAMIC DISLPLAY.
    BUT I WANT IN FIELD SYMBOL WAY
              LOOP AT i_tcode1.
                PERFORM fieldcatalog_init USING gt_fieldcatalog[] i_tcode1-text  'QUAN'  i_tcode1-vtext.
              ENDLOOP

    Hi Farukh,
    Regarding ALv u can find full details in this below link.This should help u better.
    http://help.sap.com/saphelp_erp2005/helpdata/en/b8/d84f59aac911d295e300a0c9306433/frameset.htm
    In this goto ABAP List viwer to c all the details and functions of ALv.
    Regards,
    Nagarajan.

  • Dsiplay Dynamic Column in ALV Grid

    Hellow everyone,
    i am using alv grid to display the stock in detail , I need date and stock qnty with labour hour dynamic , my requriend output is:
                                LVside                                 HV side                      Coreside
    StockNumber             Qnty        Date                         Qnty    Date              Qnty      Date
    10000014               14.1          10/11/2011                12.2  11/11/2011
    Plz tell me how can iget this , The LVside and HVside is constant and Qnty date label also constant only date and Qnty will change.
    Thanks

    Hi venkatesh   even my requirment is same,
    yes you are correct venkatesh actually i have static column but as you see i am getting the data as per follow
    in LVside total Qnty is 14.2 on Date 10.11.2011 of stockNum 100008 , so my requried out put is something like below
    StockNum                        LVside .... ..........................HVside
                              Qnty   | Date                              Qnty   | Date
    1000008                   14.2    10.11.2011                          5.2    11.11.2011
    My current Out put is :
    StockNum                10.11.2011 .................11.11.2011
    1000008                   14.2                            5.2   
    my refer code is :
    DATA: BEGIN OF i_alv OCCURS 0,
          ARBID TYPE AFRU-ARBID,
          BUDAT TYPE AFRU-BUDAT,
          WERKS TYPE AFRU-WERKS,
          LMNGA TYPE AFRU-LMNGA,
          AUFNR TYPE AFRU-AUFNR,
          KDAUF TYPE AUFK-KDAUF,
          KDPOS TYPE AUFK-KDPOS,
          VBELN TYPE VBAK-VBELN,
          KUNNR TYPE VBAK-KUNNR,
          NAME1 TYPE KNA1-NAME1,
          MATNR TYPE VBAP-MATNR,
          KDKG1 TYPE VBKD-KDKG1,
      end of i_alv.
    TYPES: BEGIN OF ty_data,
             BUDAT TYPE AFRU-BUDAT,
             ARBID TYPE AFRU-ARBID,
             aufnr TYPE AFRU-AUFNR,
             kdauf TYPE AUFK-KDAUF,
             name1 TYPE KNA1-NAME1,
             matnr TYPE VBAP-MATNR,
             kdkg1 TYPE VBKD-KDKG1,
            lmnga TYPE AFRU-LMNGA,
           END OF ty_data,
           tt_data TYPE STANDARD TABLE OF ty_data,
           BEGIN OF ty_dyn1,                                    "#EC NEEDED
    *         ARBID TYPE AFRU-ARBID,
    *         aufnr TYPE AFRU-AUFNR,
             kdauf TYPE AUFK-KDAUF,
             name1 TYPE KNA1-NAME1,
             matnr TYPE VBAP-MATNR,
             kdkg1 TYPE VBKD-KDKG1,
             kdkg2 TYPE VBKD-KDKG2,
             lmnga TYPE AFRU-LMNGA,
           END OF ty_dyn1,
           BEGIN OF ty_dyn2,                                    "#EC NEEDED
             date  TYPE AFRU-LMNGA,
           END OF ty_dyn2,
           BEGIN OF ty_cols,
             date TYPE BUDAT,
           END OF ty_cols,
           tt_cols TYPE SORTED TABLE OF ty_cols WITH UNIQUE KEY date.
    DATA: gt_data TYPE tt_data,
          gt_data2 type tt_data,
          gt_cols TYPE tt_cols,
          gs_col  TYPE ty_cols.
    thanks

Maybe you are looking for