ALV grid refresh while fcat and internal table change

Hi,
   I am displaying an ALV output using OOPS ALV grid. It is displaying data from internal table t1.
Later I am changing fieldcat table content and I want to display with internal table t2. how can I do this.
It is not refreshing the fieldcat values in the ALV.
Which method I should call to refresh the ALV.
Thanks and regards,
Venkat.

hi,
to refresh the alv display.
you can use the method refresh_table_display
of the class cl_gui_alv_grid.
regards.

Similar Messages

  • Alv grid - call transaction 'ME22N' and reflect the change made in alv grid

    Hi,
    <u>Scenario</u>
    I have an alv list which has fields Purchase document no. (EBELN) and Item delivery date (EINDT). EBELN field is hot spot enabled. when i click on that transaction 'ME22' is called. I have done this using USER_COMMAND subroutine.the code is given.
          FORM USER_COMMAND                                             *
    Call transaction ME22N on clicking Document number                 *
    FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
                    I_SELFIELD TYPE SLIS_SELFIELD.
      DATA: F_SUBRC LIKE SY-SUBRC,
            s_arseg like G_T_PORD. "the internal table used is G_T_PORD
      CASE F_UCOMM.
        WHEN '&IC1'.
          IF i_selfield-fieldname = 'EBELN'.
            READ TABLE G_T_PORD INDEX i_selfield-tabindex INTO s_arseg.
            SET PARAMETER ID 'BES' FIELD s_arseg-ebeln.
            CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
    endform.
    <u>Requirement</u>
    After calling the transaction, If the user changes the Item delivery date (EINDT) at the ME22 transaction screen, the new date needs to be reflected in the ALV grid.
    Plz help it is very urgent.

    The first method (using selfield-refresh = 'X'.) didn't work as the internal table doesnt get modified when the user make changes in Item delivery date(EINDT) at ME22 transaction screen. The 2nd method is OO,which can't be used in my case.
    I tried calling the subroutine for populating the itab (G_T_PORD) and the subroutine for displaying the alv grid immediately after calling ME22N transaction. Still it is not reflecting the new date in the output alv. The code is given below.
          FORM USER_COMMAND                                             *
    Call transaction ME22N on clicking Document number                 *
    FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
                    I_SELFIELD TYPE SLIS_SELFIELD.
      DATA: F_SUBRC LIKE SY-SUBRC,
            s_arseg like G_T_PORD.
      CASE F_UCOMM.
        WHEN '&IC1'.
          IF i_selfield-fieldname = 'EBELN'.
            READ TABLE G_T_PORD INDEX i_selfield-tabindex INTO s_arseg.
            SET PARAMETER ID 'BES' FIELD s_arseg-ebeln.
            CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
            refresh G_T_PORD.
            perform F1000_POPULATE_PO.
            perform F2000_DISPLAY_PO .
    endform.

  • ALV grid oo delete rows and update to table

    Hi all
      How can I delete one row and update to the db table?
    thanks

    Hi,
    Refer:-
    The ALV Grid has events data_changed and data_changed_finished. The former method is
    triggered just after the change at an editable field is perceived. Here you can make checks for
    the input. And the second event is triggered after the change is committed.
    You can select the way how the control perceives data changes by using the method
    register_edit_event. You have two choices:
    1. After return key is pressed: To select this way, to the parameter i_event_id pass cl_gui_alv_grid=>mc_evt_enter.
    2. After the field is modified and the cursor is moved to another field: For this, pass cl_gui_alv_grid=>mc_evt_modifies to the same parameter.
    To make events controlling data changes be triggered, you must select either way by
    calling this method. Otherwise, these events will not be triggered.
    To control field data changes, ALV Grid uses an instance of the class
    CL_ALV_CHANGED_DATA_PROTOCOL and passes this via the event data_changed.
    Using methods of this class, you can get and modify cell values and produce error messages.
    Hope this helps you.
    Regards,
    Tarun

  • Export - Import In ABAP ( for variables and internal table)

    how can we pass value for the variable and internal table using Export and Import?
    data: var type sy-uzeit.
    var = sy-uzeit.
    EXPORT var TO MEMORY ID 'TIME'.
    data: var type sy-uzeit.
    IMPORT var FROM MEMORY ID 'TIME'.
    write:/ var,sy-subrc,sy-uzeit.
    i found var value 0 while importing. 
    what is the right syntax for passing value of variable and internaltable.
    regards,
    dushyant.

    Hi,
    There are two possible solutions.
    Solution1:
    Program1.Should be run before atleast once so that TIME should be filled.
    data: var type sy-uzeit.
    var = sy-uzeit.
    EXPORT var TO MEMORY ID 'TIME'.
    Program2.IF the TIME is filled,then only it will produce the result.
    data: var type sy-uzeit.
    clear var.
    IMPORT var FROM MEMORY ID 'TIME'.
    write:/ var, sy-subrc, sy-uzeit.
    Solution2:
    Single program:
    data: var type sy-uzeit.
    var = sy-uzeit.
    EXPORT var TO MEMORY ID 'TIME'.
    clear var.
    IMPORT var FROM MEMORY ID 'TIME'.
    write:/ var, sy-subrc, sy-uzeit.
    Kindly reward points by clikcing the star on the left of reply,if it helps.

  • DATA BASE TABLE AND INTERNAL TABLE

    Dear Friends,
    please help me out in getting complete information about database table and internal table.
    you can email me at < Removed by moderator - please maintain e-mail iDs in Business Card>
    Message was edited by:
            Arun Varadarajan

    Hi Hazi,
    <b>DATABASE Tables :</b>
    This are the tables which are stored in the database (eg Oracle , informix , DB2 etc..) Physically. u can view it from T-codes SE11 or SE16. here in SE11 u can create ur own Transparent table.
    for more information...
    http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/dictionary_tutorial.html
    <b>Internal Tables.</b>
    While generating reports or other objects we are not modifying the database tables directly first we are selecting the data of the database table into the internal tables... so that we can reduce the database access time and network traffic .. which is highly needed in R/3 system..
    internal tables are not exist phyiscally in the system. its like a array. the existance of the internal tables is upto the program execution in which u r declaring nd using it...
    for more information..
    http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/internaltables_tutorial.html
    Hope it will solve ur problem..
    <b>Reward points if useful..</b>
    Thanks & Regards
    ilesh 24x7

  • SAP QUERY LOOPS AND INTERNAL TABLE

    Hi All, I have a query which i have made. It runs from Table EKPO which has PO details and what I want to do is now via ABAP Code pull through the total of goods receipt for the PO and Line Item into a field. Sounds Easy enough..Problem now,
    The table which contains the GR data is EKBE which agains a PO and Line Item can have many 101 movements and 102 movements so what I want is an ABAP Statent to basically sum up the total of 101 for the PO & LINE ITEMS and then minus this from the total of 102 for the PO & LINE ITEMS and post the result in to this new field I have created.
    I am pretty decent with ABAP Code in Querys I.e Select statements etc but from what I can see i need to create an internal table and do a loop and collect statement but I keep on failing due to not enough knowledge. Please can some one help me with this and provide me with the code and explanation as i would like to understand,
    POINTS WILL BE REWARDED
    Thanks
    Kind Regards
    Adeel Sarwar

    Hi,
    This is the full code i have entered but its not working. Any help would be appreciated. If you could rectify the code and internal tables that would be great.
    Thanks
    TABLES: EKBE.
    DATA: PurO LIKE EKPO-EBELN,
          POLI LIKE EKPO-EBELP.
    *New Table and Vars defined
    DATA:   BEGIN OF IT_EKBE,
              IT_EKBE LIKE EKBE,
            END OF IT_EKBE.
    DATA:  BEGIN OF IT_SUM OCCURS 0,
              EBELN TYPE EBELN,
              EBELP TYPE EBELP,
              DMBTR TYPE DMBTR,
              MENGE TYPE MENGE,
          END OF IT_SUM.
    CLEAR: QTYD.
    MOVE: EKPO-EBELN TO PurO,
          EKPO-EBELP TO POLI.
    SELECT * FROM EKBE INTO IT_EKBE
        WHERE EBELN = PurO
        AND   EBELP = POLI
        AND   BEWTP = 'E'
    LOOP AT IT_EKBE.
      MOVE CORRESPOING IT_EKBE TO IT_SUM.
      IF IT_EKBE-BWART = '102'.
        IT_SUM-DMBTR = IT_SUM-DMBTR * -1.
        IT_SUM-MENGE = IT_SUM-MENGE * -1.
      ENIDF.
      COLLECT IT_SUM.
      CLEAR IT_SUM.
    ENDLOOP.
    ENDSELECT.
    If sy-subrc = 0.
      QTYD = IT_SUM.
    ELSE.
      QTYD = 0.
    ENDIF.

  • DIFF: Field string ,Structure and Internal table declaration

    Hai,
           what is the diference between  Field string ,Structure in ABAP program and Internal table declaration and how it will work ?
    Thank you
    ASHOK KUMAR.

    hi,
    Look this u will get a good idea.
    *& Report  ZTYPES                                                      *
    REPORT  ZTYPES                                                  .
    * Table declaration (old method)
    DATA: BEGIN OF tab_ekpo OCCURS 0,             "itab with header line
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
    END OF tab_ekpo.
    *Table declaration (new method)     "USE THIS WAY!!!
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,      "itab
          wa_ekpo TYPE t_ekpo.                    "work area (header line)
    * Build internal table and work area from existing internal table
    DATA: it_datatab LIKE tab_ekpo OCCURS 0,      "old method
          wa_datatab LIKE LINE OF tab_ekpo.
    * Build internal table and work area from existing internal table,
    * adding additional fields
    TYPES: BEGIN OF t_repdata.
            INCLUDE STRUCTURE tab_ekpo.  "could include EKKO table itself!!
    TYPES: bukrs  TYPE ekpo-werks,
           bstyp  TYPE ekpo-bukrs.
    TYPES: END OF t_repdata.
    DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0,   "itab
          wa_repdata TYPE t_repdata.                 "work area (header line)
    Regards
    Reshma

  • Difference between the Field Group  and Internal Table.

    Hi all,
    Can anybody tell me the difference between the Field group and Internal table and when they will used?
    Thanks,
    Sriram.

    Hi
    Internal Tables: They are used to store record type data in tabular form temporarily in ABAP programming. Or we can say, it stores multiple lines of records for temporary use in ABAP programming.
    A field group is a user-defined grouping of characteristics and basic key figures from the EC-EIS or EC-BP field catalog.
    Use
    The field catalog contains the fields that are used in the aspects. As the number of fields grows, the field catalog becomes very large and unclear. To simplify maintenance of the aspects, you can group fields in a field group. You can group the fields as you wish, for example, by subject area or responsibility area. A field may be included in several field groups.
    When maintaining the data structure of an aspect, you can select the field group that contains the relevant characteristics and basic key figures. This way you limit the number of fields offered.
    Regards
    Ashish

  • Difference between line type and internal table?

    Hi..
    I wanted to know, what is the difference between Line type and Internal Table?

    Hi,
        Before the 4.7 release in SAP if we want to define an internal table we have to write the defination using the occurs statement and we need to define all the fields using INCLUDE STRUCTURE or indidually all the fields ine by one.
    From 4.7 release of R/3 SAP introduced the Line type concept and it's part of the ABAP OOPS concept. for internal table defination we don't need to use the occur statements. Instead INCLUDE structure  we need to create a Line type for that structure in Se11 and then we can define the internal table like :
    DATA : ITAB TYPE TABLE OF <LINE_TYPE>.
    Only thing is this table will be  a table without header. So for internal table processing we need to define a work area structure of type line of line type  . EX:
    DATA: WA_ITAB TYPE LINE OF <LINE_TYPE>.
    Hope this helps.
    Thanks,
    Greetson

  • Table types and internal table

    Hi all,
    What is the relationship between table type in ABAP dictionary and internal table?
    Moderator message : Search for available information OR read ABAP documentation. Thread locked.
    Edited by: Vinod Kumar on Jul 16, 2011 11:16 AM

    You can INCLUDE TYPE.
    Types: begin of itab,
           field1 type string,
           field2 type string,
    *      More Fields in here.
           Field30 type string,
           End of itab.
    Data: lt_itab type table of itab.
    TYPES BEGIN OF new_itab.
           INCLUDE type itab.
    TYPES: field31 type string,
           field32 type string,
    END OF new_itab.
    Regards,
    Rich Heilman

  • Passing SELECT-OPTIONS and Internal Tables to SUBROUTINES

    Hi Guys
    In the code below my colleague has created her own table types in order to pass a select option and internal tables to her subroutine. Is there an easier way of making them known to the subroutine.
    data : v_vbeln type vbeln_vf,
          it_bdoc type table of vbrp,
          it_t006 type table of t006a,
          wa_bdoc type vbrp,
          wa_t006 type t006a,
          it_bdoc2 type table of zsswathi_st_vbeln,
          wa_bdoc2 type zsswathi_st_vbeln
    select-options s_vbeln for v_vbeln matchcode object zswathi_vbeln obligatory.
    start-of-selection.
    perform bdoc using s_vbeln[]
                 changing it_bdoc
                          it_bdoc2
                          it_t006.
      loop at it_bdoc2 into wa_bdoc2.
    form bdoc using f_s_vbeln type ZSWATHI_ST_SELECT_OPTION_TA_TY       " all these are table types. for select options, a structure is created and then a table type for it is created.
            changing f_it_bdoc type zswathi_vbrp_ty_ta
                     f_it_bdoc2 type zswathi_vbeln_ty_ta
                      f_it_t006 type ZSWATHI_T006_TA_TY.
    select * from vbrp into table f_it_bdoc where vbeln in f_s_vbeln.
          if f_it_bdoc is not initial.
          select  vbeln sum( netwr ) prsdt from vbrp into table f_it_bdoc2 where vbeln in f_s_vbeln group by vbeln prsdt.
          sort f_it_bdoc2 by vbeln.
          "select * from t006a into table it_t006 for all entries in it_bdoc where msehi = it_bdoc-vrkme.
          select * from t006a into table f_it_t006 for all entries in f_it_bdoc where msehi = f_it_bdoc-vrkme.
       endif.
        endform.

    Hi Brett,
    1. you can use a select-options-range in a FORM subroutine also without passing it as a parameter because parameters and select-option range tables are global fields in their program.
    2. If you need a parameter, declare it as type table or type standard table or type any table. You do not need any special table type.
    Regards
    Clemens

  • How do we pass values and Internal tables to Sub-routines

    how do we pass values and Internal tables to Sub-routines

    Hi,
    You can use the USING..or TABLES..or Changing addition..
    Check this example.
    DATA: T_MARA TYPE STANDARD TABLE OF MARA.
    PERFORM DISPLAY USING T_MARA.
    FORM DISPLAY USING LT_MARA LIKE T_MARA.
    DATA: WA TYPE MARA.
    LOOP AT LT_MARA INTO WA.
      WRITE: / WA-MATNR.
    ENDLOOP.
    ENDFORM.
    Thanks
    Naren

  • Difference between work area and internal tables.

    Hi  I wanna know the difference between work area and internal tables.
    what happend if i give with out header line in internal table.
    also how to assosiate work area to internal table in that scenario.

    Hi Balaji..
    The internal table is an ABAP runtime object which has two parts the Body and the header.
    Whereas a work area cannot have a body.. It is mere a field or group of fields which can hold values at runtime..
    In the SAP higher versions mySAP ERP, the use of tables with header line is made obsolete.. But there is absolutely no problem with the same..
    Just think that when you define an internal table with occurs or with header line statement, the system automatically creates a workarea with this table, using which you can access the contents in the bosy of tyhe table.. You can read a record from the table body to this header or add a record in the header to the internal table body..
    When you work with a table ITAB without a header line, you can not use statements like READ TABLE, APPEND, INSERT etc without giving an explicit work area..
    Suppose i have an internal table like:
    DATA : itab TYPE STANDARD TABLE OF t001.
    This table will not have a header with it.
    If you will use APPEND itab. The compilor will give error.
    Here i will create a work area with same structure of the table.
    DATA : e_wa TYPE t001.
    Now i will write:
    APPEND e_wa TO itab.
    READ TABLE itab INTO e_wa WITH KEY xxxxxx
    LOOP AT itab INTO e_wa...           etc..
    In a better approach we use Field symbols with such tables, instead of structures
    FIELD-SYMBOLS: <fs_itab> TYPE t001.
    So,
    LOOP AT itab ASSIGNING <fs_itab>
    READ TABLE itab ASSIGNING <fs_itab> etc.. However we can not use field symbols in few cases..
    I hope this will help you..
    Thanks and Best Regards,
    Vikas Bittera.
    **Points for usefull answers**

  • ALV - need to sum values of internal table and display in ALV

    I have data in internal table as:
    Material     date     sum1     sum2
    Mat_A     19990101     4     4
    Mat_A     20080501     3     0
    Mat_A     20080601     2     0
    Mat_B     19990101     2     0
    Mat_B     20080601     5     5
    Required output is :
    Material     qty1     qty2     19990101     20080501     20080601
    Mat_A     432     4     4     3     2
    Mat_B     2+5     5     2           5
    Thinking of using ALV to pass the internal table and display as classical report (and also to save as excel spreadsheet).
    Counting your help on the following questions:
    1) How to accomplish the sum in ALV report? Can ALV FM do that or one has to use ABAP to compute the sum from the given internal table?
    2) Mat_A can have more date values. Here it got 3 distinct date values 19990101, 20080601, 20080501. If it has say 5 date values, how to create the ALV date columns (from 3 to 5 date columns) dynamically?
    Thanks for the help.

    for the sum inalv we use generally..
    it_fieldcat-do_sum = 1.
    check this examples...
    http://www.****************/Tutorials/ALV/Subtotals/text.htm
    *& Report  ZTEST_ALV_PERC_13317
    REPORT  ztest_alv_perc_13317.
    TYPE-POOLS: slis.
    DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
          wa_fieldcat TYPE slis_fieldcat_alv,
          it_events TYPE slis_t_event,
          wa_events TYPE slis_alv_event,
          it_sort TYPE slis_t_sortinfo_alv,
          wa_sort TYPE slis_sortinfo_alv,
          l_layout TYPE slis_layout_alv.
    TYPES: BEGIN OF ty_itab,
            field1(10),
            qty1 TYPE i,
            qty2 TYPE i,
            qty3 TYPE i,
            dummy TYPE c,
          END OF ty_itab.
    DATA: itab TYPE STANDARD TABLE OF ty_itab WITH  HEADER LINE,
    itab1 TYPE ty_itab.
    START-OF-SELECTION.
      itab-field1 = 'FIRST'.
      itab-qty1 = 2.
      itab-qty2 = 1.
      itab-qty3 = 5.
      itab-dummy = 10.
      APPEND itab.
      itab-field1 = 'FIRST'.
      itab-qty1 = 2.
      itab-qty2 = 1.
      itab-qty3 = 5.
      itab-dummy = 10.
      APPEND itab.
      itab-field1 = 'FIRST'.
      itab-qty1 = 2.
      itab-qty2 = 1.
      itab-qty3 = 5.
      itab-dummy = 10.
      APPEND itab.
      wa_fieldcat-col_pos = 1.
      wa_fieldcat-fieldname = 'FIELD1'.
      wa_fieldcat-tabname = 'ITAB'.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-col_pos = 2.
      wa_fieldcat-fieldname = 'QTY1'.
      wa_fieldcat-tabname = 'ITAB'.
      wa_fieldcat-do_sum = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-col_pos = 3.
      wa_fieldcat-fieldname = 'QTY2'.
      wa_fieldcat-tabname = 'ITAB'.
      wa_fieldcat-do_sum = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-col_pos = 4.
      wa_fieldcat-fieldname = 'QTY3'.
      wa_fieldcat-tabname = 'ITAB'.
      wa_fieldcat-do_sum = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-col_pos = 5.
      wa_fieldcat-fieldname = 'DUMMY'.
      wa_fieldcat-tabname = 'ITAB'.
      wa_fieldcat-do_sum = 'X'.
      wa_fieldcat-no_out = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
       CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = it_events
        EXCEPTIONS
          list_type_wrong = 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.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
         i_callback_program           = sy-repid
         it_fieldcat                    = it_fieldcat
        TABLES
          t_outtab                       = itab
    EXCEPTIONS
       program_error                  = 1
       OTHERS                         = 2
      IF sy-subrc <> 0.
      ENDIF.

  • ALV Grid -- Heading in each and every page while printing

    Hello!!!!
    How to display heading in ALV Grid in each and every page while printing?
    Thanks in Advance!!!!!!

    Hi nitesh,
    <b>data: lt_list_commentary type slis_t_listheader.
    perform build_comment using
    lt_list_commentary.
    form build_comment using
    pt_list_commentary type slis_t_listheader.
    data: ls_line type slis_listheader.
    clear ls_line.
    ls_line-typ = 'H'.
    ls_line-info = 'SREEKANTH REDDY'.
    append ls_line to pt_list_commentary.
    clear ls_line.
    ls_line-typ = 'H'.
    ls_line-info = 'HEADER1'.
    append ls_line to pt_list_commentary.
    clear ls_line.
    ls_line-typ = 'H'.
    ls_line-info = 'HEADER2TEXT'.
    append ls_line to pt_list_commentary.
    clear ls_line.
    endform.
    </b>In Function module REUSE_ALV_COMMENTARY_WRITE , give the parameter as
    <b>it_list_commentary = lt_list_commentary </b>
    Here ls_line-typ = 'H'. you can use options like 'H' , 'A' , 'S'.

Maybe you are looking for

  • HT5219 Thunderbolt ports and displays

    I bought a TB screen and i am connecting it to My Macbook Pro 13'' & it's working perfectly, but i tried to connect my TV screen from the second TB port available in the TB screen through MiniDisplay-HDMI adaptor and isn't working, any clue?

  • Set automatic block for subsequent document

    Dear Gurus, I have 2 situations like this: Case 1: Step 1: Create a SO with down-payment condition type inside condition proc (not with Billing plan). Step 2: It will automatically set block for waiting make settlement for down-payment. Step 3: After

  • Jdev And Oracle 8i Lite (Help me)

    When I create a new project with the wizard I have a problem with the connection to my scheme (Oralce 8i late)(Polite is the database of the oracle 8i late). I can connect suceful but, I can't see the tables, the program say me that SQL Error POL-513

  • Activities for each phase in Sales Methodology for Opportunities

    Hello Gurus, I want to configure certain activities around each phase for sales methodology in Opportunity. eg phase 1 identification, if there cud be series of aactivities like calling up a customer, setting up appointment, etc  which if configured

  • Mac book pro will not switch from internal microfon, who can help, please?

    Hi, thinking with a new mac book pro I will finally enter the new millenium i was in for a bad surprise. Apart from regular crashes (6 in the first day) with black screen and automatic reboot, without any chance to save in gb, I also had the followin