Problem in refreshing ALV data in container (OOALV)

Hello Experts, Good Day.
I am developing a Modulepool program which is having two screens, one (101) is for Entering data (used TC with wizard) then saves it in database table and another screen (102) is to display saved data. Now I am facing problem in second screen (102).
The problem I am facing is when I am displaying/calling 102 screen for multiple times, the internal table is getting updated but the previous ALV data is not getting updated/modified.
I have searched the forum and found some methods/procedures for refreshing the data but I am not able to achieve this.
Methods I found and Problems with them:
1. FREE the Container and Grid objects usng FREE( ) method.
If I free boht the Container and Grid objects data getting updated but another all the columns are getting displayed twice for second time, thrice for third time and so on... I have coded for this in PBO of 102 Screen.
If I Free only Grid object, totally the table is getting disappeared when I display ALV Second time.
2. When I use Refresh the table using CALL METHOD LR_GRID->REFRESH_TABLE_DISPLAY( ) then only second time the ALV is getting refreshed but if I display further it is displaying 2nd ALV data from 3rd time onwards (not getting updated from 3rd time).
Coded as below in PBO OF 102 Screen:
IF LR_GRID IS BOUND.
   CALL METHOD LR_GRID->REFRESH_TABLE_DISPLAY( ).
ENDIF.
   CREATE OBJECT LR_GRID
     EXPORTING
       I_PARENT          =  LR_CONT
     EXCEPTIONS
       ERROR_CNTL_CREATE = 1
       ERROR_CNTL_INIT   = 2
       ERROR_CNTL_LINK   = 3
       ERROR_DP_CREATE   = 4
       OTHERS            = 5.
   IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.
3. When I use FLUSH method: this is not at all working out, I have called this after displaying ALV in PBO.
    CALL METHOD CL_GUI_CFW=>FLUSH( ).
    CALL METHOD CL_GUI_CFW=>DISPATCH( ).
My code to display ALV which is written in PBO of 102 is attached, please find the attachment.
Experts, please let me know where I am going wrong. I wish to know the solution in all the above ways. Please help me.
Thanks & Regards,
Vijay

  LR_GRID->SET_TABLE_FOR_FIRST_DISPLAY(
*    EXPORTING
*      I_BUFFER_ACTIVE               =
*      I_BYPASSING_BUFFER            = 'X'
*      I_CONSISTENCY_CHECK           =
*      I_STRUCTURE_NAME              = 'ZGVK_MP_DEMO'
*      IS_VARIANT                    =
*      I_SAVE                        = 'X'
*      I_DEFAULT                     = 'X'
*      IS_LAYOUT                     =
    CHANGING
      IT_OUTTAB                     = GT_DATA[]
      IT_FIELDCATALOG               = LT_FCAT
*      IT_SORT                       =
*      IT_FILTER                     =
    EXCEPTIONS
      INVALID_PARAMETER_COMBINATION = 1
      PROGRAM_ERROR                 = 2
      TOO_MANY_LINES                = 3
      OTHERS                        = 4 ).
  IF SY-SUBRC <> 0.
   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Similar Messages

  • Problem with Refreshing the data bound text fields

    Folks,
    First of all, this a GREAT product and I am moving my apps from Eclipse to Studio Creator. I am very impessed with it so far.
    I am gone through most tutorials, but can't help resolve the problem that I am having. I have a page, that lists all the users in a table. When you click on any user, it opens up another page that lists the detail of the specific user you have clicked on. This a typical use in most web applications, right?
    In the user detail page, I open it in "Read" only mode, by setting the "setReadOnly" to true for all text field components. Then users can edit it by clicking "Edit" button. Edit button just changes the "setReadOnly" to false, to allow editing. After editing, they can hit the "Save" button to save the changes. In the save button, I call this code:
    public void prerender() {
            try {
                userID=getSessionBean1().getUserID();
                getSessionBean1().getWeb_userRowSetUserDetail().setObject(1,userID);
                getWeb_userDataProviderUserDetail().refresh();
                info("prerender: Refresh called");
            } catch (Exception ex) {
                error("Error in userForm.prerender():"+ex.getMessage()+ex.getStackTrace());
                log("Error in userForm.prerender():", ex);
            setReadWrite();
    public String btnSave_action() {
            try {
                getWeb_userDataProviderUserDetail().commitChanges();
                getWeb_userDataProviderUserDetail().refresh();
                info("Data Provider Refreshed in SAVE");
                _readOnly=true;
                form1.discardSubmittedValues("saveVForm");
                info("User Updated New:"+userID);
            } catch (Exception ex) {
                log("Error Description", ex);
            return null;
        public String btnEdit_action() {
            try {
                _readOnly=false;
                //info("User ID Edt="+getSessionBean1().getUserID());
            } catch (Exception ex) {
                error("Error in userForm.btnEdit_action:"+ex.getMessage()+ex.getStackTrace());
                log("Error in userForm.btnEdit_action():", ex);
            return null;
        private void setReadWrite(){
            // Set read-only to true or false for all text fiels
            this.btnEdit.setVisible(_readOnly);
            this.btnSave.setVisible(!_readOnly);
            this.user_id.setReadOnly(_readOnly);
            this.user_email_client.setReadOnly(_readOnly);
            this.user_email_office.setReadOnly(_readOnly);
            this.user_fname.setReadOnly(_readOnly);
            this.user_lname.setReadOnly(_readOnly);
            this.user_id.setReadOnly(_readOnly);
            this.user_password.setReadOnly(_readOnly);
            this.user_password_conf.setReadOnly(_readOnly);
            this.user_phone_cell.setReadOnly(_readOnly);
            this.user_phone_cell_aac.setReadOnly(_readOnly);
            this.user_phone_client.setReadOnly(_readOnly);
            this.user_phone_home.setReadOnly(_readOnly);
            this.user_phone_office.setReadOnly(_readOnly);
        }When the save button is clicked, the database is updated (as I can verify by looking directly into the database), but the data-bound text fields do not display the new value. YES, I am calling refresh() on data provider? I tried to call refresh in both "preRender()" and "Save" button action event, but that did not help either.
    Please note that the save button also changes the "setReadOnly" back to TRUE for all text fields. That means, users view the page in Read-Only mode after saving. (They have to click on "Edit" button again to edit it). I discovered that if I do not set the text field components in "ReadOnly" mode, then they display the updated value of the fields. But if I change setReadOnly to TRUE, then they display the old values (before the save).
    Any idea what I am doing wrong here?
    Thanks

    Here is my experience with it. I have three text
    boxes to be filled out. They are part of a virtual
    form with an add button as the submit. You can fill
    out the 3 and add them and a node is added to a tree
    component. When you click on a node in the tree
    component (the submit to another virtual form that
    the 3 buttons participate in) the text fields should
    be loaded with the values that they where added with.Hard to tell from this explanation, but if the text fields do not participate in a virtual form, then they are not going to get updated when an action in the virtual form happens. Not sure this is your problem. Like I say, hard to tell from this explanation.
    They will not display the values though...having
    nothing to do with read only. If I disable them
    before hand...they display the updated values. If I
    set their value at the top or bottom of prerender,
    they display the change...if I set the value in an if
    conditional that is hit (I have checked many times)
    in prerender, they will not display the values. If I
    set them in the tree handler anywhere, they will not
    display the values. This is very frustrating and is
    wasting tons of my time...I simply want to load the
    text fields based on the tree node that was
    clicked...I have messed with this for hours and it
    certainly does not work.Well, setting them in the tree handler won't work because the tree handler gets called in the page instance that handles the submit and not the page instance that renders the response.
    Posting your prerender code might help. Also, your action handler.
    >
    >
    - Mark

  • Problem in refreshing the data of the UI element Table

    Hi Experts,
    I am having a problem.
    I have a screen which displays list of variants in table ( variant name , variant desc )
    I am binding the entries of table in WDDOINIT method.
    but when i go back to selection screen view and come back to display variants view, WDDOINIT is not triggering.
    Now if i move the code written in WDDOINIT method to WDDOMODIFYVIEW method, its not retaining the lead selection as the binding happens on every server round trip. if i check with First_time = 'X'. its same as that of having it in WDDOINIT method.
    How do i overcome this problem of refreshing the table data.
    any clue is highly appreciated.
    Regards,
    Ajay

    hi Ajay ,
    create a custom controller for this and when u want to move from selection screen view to display variant ,
    call method of this custom controller
    DATA lo_edit TYPE REF TO ig_edit .
    lo_edit =   wd_this->get_edit_ctr( ).
      lo_edit->edit1(
    here I am calling the edit1 method of my custom controller named EDIT.
    try to move code of ur WDDOINIT here.
    it shud help
    rgds,
    amit

  • Problem in refreshing the data in Xcelsius

    Hi,
    I have added a refresh button in my dashboard  to refresh the data from the BOE , but ones i click that button it ask for user authentication and ones i enter that and click ok nothing happens , the data is not getting refreshed.
    In second case i made my data connection as refresh on load  so as soon i launch my dashboard it ask for user authentication and after entering that details nothing happens and i am not able to see the data and even if i enter wrong details in the pop up window it does not gives any error message for wrong credentials.
    Earlier i was getting the error like #2032 , #2017 so i maintained the crossdomail.xml file in web server it was resolved.
    But i am not able to refresh the data nor i am getting any error message kindly suggest !!
    Regards,
    Mishra,Vibhav

    Dear Ingo,
    Thanks for replying.
    Step 1 : I have used a excel sheet using the live office connection and using the existing CR report from the BOE.
    Step 2 : Then i have published that excel sheet in BOE
    Step 3 : I have imported that spreadsheet in the Xcelsius and created a dashboard on top of that.
    Step 4 : I have added a refresh button on the dashboard which is used to refresh the live office connection and the session URL   that i have maintained is  http://XXXC043A:8080/dswsbobje/services/session . i am not using the refresh on load option.
    Step 4 : When i preview the dashboard with the preview button  available in the Xcelsius i can see the dashboard with the existing data but ones i click the Connection refresh button a user authentication window pop up which ask for the system name user id and pwd and Authentication type . I used the Enterprise authentication for that but ones i submit the credential nothing happens even if i enter the wrong information no error  message is prompted.
    Thanks in advance .
    Regards,
    Mishra,Vibhav

  • Problem in refreshing the data in OBIEE answers?

    Hi,
    My report doesn't show the latest data in the database. I tried restarting my BI server and Presentation server also. But it is still showing the old data only. But in Admin tool im able to view the latest data. What could be the reason for this? Wont the refresh button given at the bottom of the report refresh the data?
    Thanks,
    Karthick

    Hi,
    If you want to use the cache and you have a regular load of data into your source for OBIEE, then you just need to ensure that the cache is cleared after your load. There is an ODBC command which will clear it:
    Call SAPurgeAllCache();
    You can put this in a sql file and then call it from a .cmd file:
    nqcmd -d "AnalyticsWeb" -u Administrator -p <password> -s D:\OracleBI\server\Scripts\Common\purge_cache.sql -o D:\OracleBI\server\Scripts\Common\purge_cache.out
    When you run this .cmd file it will clear the cache, this could then be caled from another tool, i.e. an Informatica workflow. All above is based on using a windows machine to connect and run the command.
    If your data is changing all the time and you just don't want caching on then just turn it off in nqsconfig.ini, change:
    ENABLE     =     YES;
    To
    ENABLE     =     No;
    in the cache section.
    Regards,
    Matt

  • Problem while refreshing the data for the second time using excel services in sharepoint 2013...

    Hi,
    I have migrated my Sharepoint from 2010 to 2013.I am able to get the data at the first time of refresh when I click on refresh for the second time I am getting the empty the sheet.
    below find the flow of refresh
    First Refresh
    On Click of refresh open the workbook with excel services and return the session id.
    Using that session I am invoking RefrehAsync method of excel services
    After refresh completed I am setting the calculation of workbook as automatic(to calculate the formulas) using the same session id
    After setting the calculation as Automatic I am setting the calculation type as full(recalculate) using the same session id.
    Now I am able to see the data
    Second Refresh
    After clicking on refresh instead of opening the workbook I am using the session id(already opened workbook) and setting the calculation type as manual
    I am following the same process from refresh(RefreshAsync) as I have followed in first refresh.
    This time my formulas are not getting calculated because of that I am not able to see the data.
    Could you please let me know that am I missing anything here?
    Is this know issue in Sharepoint2013 excel services as same code is working fine with Sharepoint2010.
    If I close the workbook(session id null) and opens(new session id) for all the refreshes it is working and I am able to see the data.
    Thanks,
    Meenakshi Nagpal
    N.Meenakshi

    I am able to see the data for the second refresh  if I change the data source.If I use the same data source which is used in the first refresh I am not getting the data.Excel services will contact the cubes and calculate the formulas in my workbook.
    Could you please let me know what could be the problem at second refresh while contacting the same data source with same session id?
    Please help me asap.
    Thanks,
    Meenakshi Nagpal
    N.Meenakshi

  • Refreshing the Data from a embed view in a view container

    Hi everybody
    I would like to know how can I do to refresh all data from a View with a view container the problem is:
    that I have a window that has a view at the same time this has a view container.  The Main view brings the data of editable elements when I select one element of the main view the view container brings a list for that element (dependencies) but only the first time a choose an element loads the correct data, when I choose another one it brings the same old data and doesn't make the call for the wdDoInit() method.
    The question is:
    How do I force the view to refresh all the data or call again the wdDoInit() method?
    Thank you for your help

    Aida,
    Lets say you have two components C1 and C2 and you want method from C1 to be available in C2 then follow these steps:-
    1) Goto the Interface Controller of C1 and create a method there lets say doSomething
    2) Then goto C2. There you can see Used Web Dynpro Components --> Right click Add Used Component --> Give some name say C1Comp --> Click browse and select C1 --> Click Finish.
    3) Next goto Component Controller of C2 --> Properties --> Click Add and check if C1 is added. If not then select the checkbox and select OK.
    4) Now goto Implementation tab of C2 and lets say wdDoInit you can write following code:-
    wdThis.wdGetC1CompInterface().doSomething();
    Chintan

  • Facing a Problem while downloading the data from ALV Grid to Excel Sheet

    Hi Friends,
    Iam facing a problem while downloading the data from ALV Grid to excel sheet. This is working fine in Development server , when comes to Quality and Production servers I have this trouble.
       I have nearly 11 fields in ALV Grid and out of which one is PO number of length 10 , all the ten numbers are visible in the excel sheet if we download it from development server but when we download it from Quality or Production it is showing only 9 numbers.
    Can any one help me out in this case.

    hi...
    if this problems happens dont display the same internal as u finally got.
    just create new internal table without calling any standard data elements and domains... but the new internal table s similar like ur final internal table and move all the values to new int table.
    for eg.
    ur final internal int table for disp,
         data : begin of itab occur 0,
                        matnr like mara-matnr,
                   end of itab.
    create new like this,
               data : begin of itab occur 0,
                        matnr(12) type N,
                   end of itab.

  • Problem in Refreshing data

    Hi Gurus,
    i have added a new column in MD04.
    Here my problem is while populating
    the data in New column standard program
    is Refreshing my data.
    say ....
    Avl Qty      USEX1 (new column)
       2                     2
       1                     3(sum of 2 +1)
       1                     4(sum of 3 + 1)
    the above is expected output,
    But currently my output is
    Avl Qty      USEX1 (new column)
       2                     2
       1                     1
       1                     1
    sample Code
    FZ_PROD = EMDEZX_USEX1 + IMDEZEXIT-MNG01(avl qty).
    MOVE FZ_PROD TO EMDEZX_USEX1(new column)
    for first loop it is fine but during second loop
    EMDEZX_USEX1  was refreshed by standard program.
    how can i achieve the above Plz Advice.
    Thanks & Regards,
    Vijaya.

    I guess u r clearing the new column befor the code.
    In that case the problem specified occurs.
    Ex:
    clear new.
    FZ_PROD = new + IMDEZEXIT-MNG01(avl qty).
    MOVE FZ_PROD TO EMDEZX_USEX1(new column)
    output:
    X = 0 + 2.       O/P is 2.
    X = 0 + 1 = 1  O/P is 1.
    X = 0 + 1 = 1  O/P is 1.
    U check by giving a value other than 1, i.e, 5 or 6 to Avl Qty , it gives the same value as o/p.
    dont clear the new column.
    This is my guess.
    Regards,
    Veeranji Reddy P.

  • Problem on refreshing with XML Data Connection

    Hi all,
    I have just created a Xcelcius 2008 interface which is consuming data from XML Data connection that I created using an ASPX web form (webservices). On Xcelsius 2008, I set to refresh the data on every 30 seconds.
    And I have found problem that the Xcelsius 2008 refresh XML Data intermittently. It doesn't want to refresh the latest data, and it still shows the previous data. But the strange thing is when I open the web services to check the validity of the data, the xcelsius is able to update and show the data exactly same with the opened data that I checked.
    And next, I repeatly refrehsed my browser (F5), oddly, the Xcelsius Flash reload data, and when I stop to refresh it. The Xcelsius stop to refresh the data also.
    So what happen to this Xcelsius? Any solutions?
    Regards,
    Devin Wood

    Hi Devin,
    I am also facing the same problem, what codes you exactly use to control the cache. I have used the following but getting same old data.
    Response.Cache.SetExpires(System.DateTime.Now);
                        Response.CacheControl = "no-cache";
                        Response.AddHeader("Pragma", "no-cache");
                        Response.AddHeader("Pragma", "no-store");
                        Response.AddHeader("cache-control", "no-cache");
                        Response.Cache.SetCacheability(HttpCacheability.NoCache);
                        Response.Cache.SetNoServerCaching();
    Hope to get help from you.
    Regards
    Bikram

  • How to refresh the data in a container and to update the new data

    Hi,
    I have created a Module Pool Program in which i have two containers to display the long text.
    Initially this container is filled and based on some condition i want to update the text in the same conatiner.
    I am using the below two classes to do all this.
    cl_gui_textedit,
    cl_gui_custom_container,
    Could someone help me how to remove the long text in the container and update the new long text.
    I am getting the new long text but not able display it in the same container. Please someone help me how to refresh and update the container.
    Thanks in advance.

    Hi
    Try this.
      IF cl_gui_textedit  IS INITIAL.
      create control container
        CREATE OBJECT cl_gui_custom_container
           EXPORTING
                container_name = 'Container Name''
           EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
    create text_edit control
        CREATE OBJECT cl_gui_textedit
           EXPORTING
                parent = cl_gui_custom_container
                wordwrap_mode = cl_gui_textedit=>wordwrap_at_windowborder
                wordwrap_to_linebreak_mode = cl_gui_textedit=>false
           EXCEPTIONS
                error_cntl_create      = 1
                error_cntl_init        = 2
                error_cntl_link        = 3
                error_dp_create        = 4
                gui_type_not_supported = 5.
      ENDIF.
    *--use method to set the text
      CALL METHOD cl_text_edit->set_text_as_stream
        EXPORTING
          text            =  t_lines ( Internal table with long text).
        EXCEPTIONS
          error_dp        = 1
          error_dp_create = 2
          OTHERS          = 3.
    regards,
    Raghu.

  • Problem in ALV Data Exported to Excel

    Dear all,
    When an ALV data is exported to Excel i see that the data is shown in 2 lines
    and a blank line is inserted between each data.
    Can any body please help.
    with rgds
    Ranjith Singh

    Hi Ranjith,
    How many columns that you extracted to excel from ALV?
    Would you give more specific to your case?
    As I remember, ALV has its limits for extracting number length of column to excel.
    Regards,
    Dondi.

  • Problem in downloading ALV output in excel

    Dear Abapers,
                           I am facing a problem while downloading alv output in spreadsheet. Report headers and data headings are coming in excle but contents are missing instead of that No Data is displaying on excel sheet. I have debug that and observed the deep structure name T_OUTTAB using by the FM ALV_DATA_EXPORT is empty, It should contain the contents of my output data.
    Below I am giving my code. 
    ***********************************************declaration****************
          BEGIN OF d_file_out,
            index           TYPE i,                      "Index no
            msg             TYPE string,              "Message
            msgtyp(1)       TYPE c,                 "Message type
           END OF d_file_out,
    DATA:t_file_out       TYPE TABLE OF d_file_out.
    DATA:wa_file_out          TYPE d_file_out.
    Display Error Logs
    PERFORM display_logs USING text-006.
    FORM display_logs USING p_text TYPE string.
      CONSTANTS:  c_count    TYPE char5 VALUE 'INDEX',
                  c_mestyp   TYPE char6 VALUE 'MSG',
                  c_message  TYPE char7 VALUE 'MSGTYP'.
    *Field catalog
      PERFORM: z_field_catalog USING c_count   text-010,  "Record number
               z_field_catalog USING c_mestyp  text-011,  "Message type
               z_field_catalog USING c_message text-012.  "Message
    *Top of page event
      PERFORM z_event USING t_events.
    wa_layout-colwidth_optimize = c_x.
    ALV grid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
         i_buffer_active          = 'X'
           i_callback_program = sy-repid
         is_layout          = wa_layout
         I_STRUCTURE_NAME   = wa_file_out
          it_fieldcat        = t_field
          it_events          = t_events
        TABLES
          t_outtab           = t_file_out
        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.
    ***********************************Fieldcatalog**********************************************
    FORM z_field_catalog USING p_field TYPE any
                                                p_name  TYPE any.
      wa_field-fieldname = p_field.
      wa_field-seltext_l = p_name.
      IF p_field = 'INDEX'.
        wa_field-outputlen = '14'.
        wa_field-col_pos = 1.
      ELSEIF p_field = 'MSG'.
        wa_field-outputlen = '120'.
        wa_field-col_pos = 2.
      ELSEIF p_field = 'MSGTYP'.
        wa_field-outputlen = '08'.
        wa_field-col_pos = 3.
      ENDIF.
      APPEND wa_field TO t_field.
      CLEAR wa_field.
    ENDFORM. 
    Here I have given my code, which contain the building of field catalog and Calling ALV Grid. I have already checked the excel micros settings. Other programs are working fine on my system and downloading in excel is also working.
    Hope to get reply soon.
    Regards,
    Himanshu

    Hi ,
    use this to down load to xcel
    v_file = lv_file.
      DATA:  BEGIN OF s_head OCCURS 0,
             head(40) TYPE c ,
             END OF s_head.
      s_head-head = text-015."'Sales price'.   * for header
      APPEND s_head.
      s_head-head = text-016."'Purchase price'.   * for header
      APPEND s_head.
      s_head-head = text-017."'Listing Procedure'.   * for header
      APPEND s_head.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                        = v_file
         filetype                        = 'ASC'
         write_field_separator           = '#'
        TABLES
          data_tab                        = it_output1[]
          fieldnames                      = s_head[]
       EXCEPTIONS
         file_write_error                = 1
         no_batch                        = 2
         gui_refuse_filetransfer         = 3
         invalid_type                    = 4
         no_authority                    = 5
         unknown_error                   = 6
         header_not_allowed              = 7
         separator_not_allowed           = 8
         filesize_not_allowed            = 9
         header_too_long                 = 10
         dp_error_create                 = 11
         dp_error_send                   = 12
         dp_error_write                  = 13
         unknown_dp_error                = 14
         access_denied                   = 15
         dp_out_of_memory                = 16
         disk_full                       = 17
         dp_timeout                      = 18
         file_not_found                  = 19
         dataprovider_exception          = 20
         control_flush_error             = 21
         OTHERS                          = 22
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.

  • AlV display in container

    hi abaprs,
    i have displayed my alv in container using cl_gui_alv_grid->set_table_for_first_display, now i have 'edit' button on my screen, i want to make certaion fields of a raw selected by user to editable mode when user
    push that button, i have got few refrences but i cant get the solution, i m looking for some subroutine where i can catch the index of the row selected and switch it to editable mode.
    sample code will be a bonus, and useful answer will be rewarded.
    thanks
    devender.

    Hi,
    Here are a few classes used in ALV, just read through their documentation or look at how they've been implemented in your system and you'll get a good idea on how to use them:
    CL_ALV_EVENT_DATA (Changing Data Container for Events)
    CL_ALV_EVENT_TOOLBAR_SET (ALV Context menu)
    CL_ALV_TABLE_CREATE (Dynamic Creation of ALV Data Table)
    CL_ALV_TREE_BASE (Basis Class ALV Tree Control)
    CL_CK_ALVTREE_NKEY_2_OBJECT (Converter Node Key Object)
    CL_COST_COSTINGVERSION_ALV (Display Costing Versions)
    CL_GUI_ALV_GRID (List Viewer)
    CL_GUI_ALV_GRID_BASE (Basis Class for ALV grid)
    CL_GUI_ALV_TREE (ALV Tree Control)
    CL_GUI_ALV_TREE_SIMPLE (Simple ALV Tree)
    check the below links lot of info and examples r there for OOPS
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.geocities.com/victorav15/sapr3/abap_ood.html
    http://www.brabandt.de/html/abap_oo.html
    Check this cool weblog:
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sap-img.com/
    http://www.sapgenie.com/
    http://help.sap.com
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.sapgenie.com/abap/controls/index.htm
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    these links
    http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
    For funtion module to class
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
    for classes
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
    for methods
    http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
    for inheritance
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
    for interfaces
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
    For Materials:
    1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
    2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
    1) http://www.erpgenie.com/sap/abap/OO/index.htm
    2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    Check these sample code
    data : begin of it_mara occurs 0,
    mark type flag,
    matnr type matnr,
    mtart type mtart,
    meins type meins,
    end of it_mara.
    data : begin of it_mara1 occurs 0,
    mark type flag,
    matnr type matnr,
    mtart type mtart,
    meins type meins,
    end of it_mara1.
    data : begin of it_mara2 occurs 0,
    mark type flag,
    matnr type matnr,
    mtart type mtart,
    meins type meins,
    end of it_mara2.
    data : t_fieldcat type lvc_t_fcat,
    t_fieldcat1 type lvc_t_fcat,
    s_fieldcat like line of t_fieldcat.
    data : s_layout type lvc_s_layo.
    data : control type ref to cl_gui_custom_container,
    grid type ref to cl_gui_alv_grid.
    data: begin of wa ,
    mark type flag,
    matnr type matnr,
    mtart type mtart,
    meins type meins,
    end of wa.
    class lcl_events_box definition.
    public section.
    methods :
    *Handler_Data_Changed for event Data_Changed of cl_gui_alv_grid
    *imporTing er_data_changed,
    Handler_User_Command for event User_Command of cl_gui_alv_grid
    imporTing e_ucomm,
    Handler_ToolBar for event ToolBar of cl_gui_alv_grid
    importing E_object E_interactive.
    endclass.
    class lcl_events_box implementation.
    method Handler_user_command.
    PERFORM FORM_USERCOMMAND CHANGING E_UCOMM.
    endmethod.
    method Handler_ToolBar.
    PERFORM FORM_TOOLBAR CHANGING E_OBJECT E_INTERACTIVE
    E_OBJECT->MT_TOOLBAR.
    endmethod.
    ENDCLASS.
    start-of-selection.
    data : w_events type ref to lcl_events_box.
    select matnr mtart meins from mara into corresponding fields of table
    it_mara.
    call screen 100.
    *& Module pbo_module OUTPUT
    text
    MODULE pbo_module OUTPUT.
    if GRID is initial.
    CREATE OBJECT CONTROL
    EXPORTING
    CONTAINER_NAME = 'CUST_CTRL'.
    CREATE OBJECT GRID
    EXPORTING
    I_PARENT = CONTROL.
    PERFORM BUILD_CATALOG.
    PERFORM BUILD_CATALOG1.
    PERFORM BUILD_LAYOUT.
    CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    IS_LAYOUT = s_layout
    CHANGING
    IT_OUTTAB = it_mara[]
    IT_FIELDCATALOG = t_fieldcat.
    CREATE OBJECT W_EVENTS.
    SET HANDLER : W_EVENTS->HANDLER_TOOLBAR FOR GRID,
    W_EVENTS->HANDLER_USER_COMMAND FOR GRID.
    CALL METHOD GRID->SET_TOOLBAR_INTERACTIVE.
    ELSE.
    call method grid->refresh_table_display.
    ENDIF.
    ENDMODULE. " pbo_module OUTPUT
    *& Form BUILD_CATALOG
    FORM BUILD_CATALOG .
    S_FIELDCAT-COL_POS = '1'.
    S_FIELDCAT-FIELDNAME = 'MARK'.
    S_FIELDCAT-CHECKBOX = 'X'.
    S_FIELDCAT-eDIT = 'X'.
    APPEND S_FIELDCAT TO T_FIELDCAT.
    CLEAR S_FIELDCAT.
    S_FIELDCAT-COL_POS = '2'.
    S_FIELDCAT-FIELDNAME = 'MATNR'.
    S_FIELDCAT-SCRTEXT_M = 'MATERIAL'.
    APPEND S_FIELDCAT TO T_FIELDCAT.
    S_FIELDCAT-COL_POS = '3'.
    S_FIELDCAT-FIELDNAME = 'MTART'.
    S_FIELDCAT-SCRTEXT_M = 'MATERL TYPE'.
    APPEND S_FIELDCAT TO T_FIELDCAT.
    S_FIELDCAT-COL_POS = '4'.
    S_FIELDCAT-FIELDNAME = 'MEINS'.
    S_FIELDCAT-SCRTEXT_M = 'UOM'.
    APPEND S_FIELDCAT TO T_FIELDCAT.
    ENDFORM. " BUILD_CATALOG
    *& Form BUILD_LAYOUT
    text
    --> p1 text
    <-- p2 text
    FORM BUILD_LAYOUT .
    S_LAYOUT-ZEBRA = 'X'.
    S_LAYOUT-CWIDTH_OPT = 'X'.
    S_LAYOUT-GRID_TITLE = 'Material Details'.
    ENDFORM.
    " BUILD_LAYOUT////////////////////////////////////
    " USER_COMMAND_0100 INPUT
    *& Form FORM_USERCOMMAND
    text
    <--P_E_UCOMM text
    form FORM_USERCOMMAND changing p_e_ucomm.
    CASE P_E_UCOMM.
    WHEN 'INT1'.
    DO.
    READ TABLE IT_MARA INDEX SY-INDEX TRANSPORTING MARK MATNR.
    IF SY-SUBRC 0.
    EXIT.
    ENDIF.
    IF IT_MARA-MARK = 'X'.
    read table it_mara into wa TRANSPORTING MATNR MTART MEINS .
    MOVE-CORRESPONDING WA TO IT_MARA1.
    READ TABLE IT_MARA1 TRANSPORTING MATNR MTART MEINS .
    MOVE-CORRESPONDING IT_MARA1 TO IT_MARA2.
    APPEND IT_MARA2.
    CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    IS_LAYOUT = s_layout
    CHANGING
    IT_OUTTAB = it_mara2[]
    IT_FIELDCATALOG = t_fieldcat1.
    SET PARAMETER ID 'MAT' FIELD IT_MARA-MATNR.
    CALL TRANSACTION 'MM02'.
    . ENDIF.
    ENDIF.
    ENDDO.
    ENDCASE.
    endform. " FORM_USERCOMMAND
    *& Form FORM_TOOLBAR
    text
    <--P_E_OBJECT text
    <--P_E_INTERACTIVE text
    <--P_E_OBJECT_>MT_TOOLBAR text
    FORM FORM_TOOLBAR CHANGING P_E_OBJECT TYPE REF TO
    CL_ALV_EVENT_TOOLBAR_SET
    P_E_INTERACTIVE
    MT_TOOLBAR TYPE TTB_BUTTON.
    DATA WAL_BUTTON TYPE STB_BUTTON.
    *WAL_BUTTON-ICON = ICON_status_reverse.
    WAL_BUTTON-TEXT = 'GO'.
    WAL_BUTTON-QUICKINFO = 'PROCEED'.
    waL_button-FUNCTION = 'INT1'.
    WAL_BUTTON-BUTN_TYPE = 0.
    WAL_BUTTON-DISABLED = SPACE.
    insert WAL_BUTTON INTO P_E_OBJECT->MT_TOOLBAR index 1.
    endform. " FORM_TOOLBAR
    *& Module PF-STATUS OUTPUT
    text
    module PF-STATUS output.
    set pf-status 'Z7PSTAT'.
    endmodule. " PF-STATUS OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    text
    module USER_COMMAND_0100 input.
    CASE SY-UCOMM.
    WHEN 'BACK'.
    LEAVE PROGRAM.
    WHEN 'CANCEL'.
    LEAVE PROGRAM.
    ENDCASE.
    endmodule. " USER_COMMAND_0100 INPUT
    *& Form BUILD_CATALOG1
    text
    --> p1 text
    <-- p2 text
    form BUILD_CATALOG1 .
    S_FIELDCAT-COL_POS = '1'.
    S_FIELDCAT-FIELDNAME = 'MATNR'.
    S_FIELDCAT-SCRTEXT_M = 'MATERIAL'.
    APPEND S_FIELDCAT TO T_FIELDCAT1.
    S_FIELDCAT-COL_POS = '2'.
    S_FIELDCAT-FIELDNAME = 'MTART'.
    S_FIELDCAT-SCRTEXT_M = 'MATERL TYPE'.
    APPEND S_FIELDCAT TO T_FIELDCAT1.
    S_FIELDCAT-COL_POS = '3'.
    S_FIELDCAT-FIELDNAME = 'MEINS'.
    S_FIELDCAT-SCRTEXT_M = 'UOM'.
    APPEND S_FIELDCAT TO T_FIELDCAT1.
    endform. " BUILD_CATALOG1
    check the below link may be useful for you
    http://www.sapdevelopment.co.uk/reporting/alvhome.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    Simple ALV report
    http://www.sapgenie.com/abap/controls/alvgrid.htm
    http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
    ALV
    1. Please give me general info on ALV.
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    2. How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    3. How do I add subtotals (I have problem to add them)...
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    4. How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    5. How to print page number / total number of pages X/XX in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
    6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
    http://www.sapfans.com/forums/viewtopic.php?t=64320
    http://www.sapfans.com/forums/viewtopic.php?t=44477
    7. How can I set the cell color in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=52107
    8. How do I print a logo/graphics in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=81149
    http://www.sapfans.com/forums/viewtopic.php?t=35498
    http://www.sapfans.com/forums/viewtopic.php?t=5013
    9. How do I create and use input-enabled fields in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    10. How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    11. How can I display an icon in ALV? (Common requirement is traffic light icon).
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    12. How can I display a checkbox in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=88376
    http://www.sapfans.com/forums/viewtopic.php?t=40968
    http://www.sapfans.com/forums/viewtopic.php?t=6919
    Go thru these programs they may help u to try on some hands on
    ALV Demo program
    BCALV_DEMO_HTML
    BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
    BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
    BCALV_GRID_DEMO Simple ALV Control Call Demo Program
    BCALV_TREE_DEMO Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO
    BC_ALV_DEMO_HTML_D0100
    Regards,
    Shiva

  • ALV data with DOUBLE HEADERS

    Dear friends,
    I am getting problems in one ALV Report, the i need to display data with as following format(two headers).
    volume stock                   |             being stock                                             |
    _____________________  |___________________________________________|
    matnr    |  mat.descr         |  plant1  | plant2    |   plant3   |    palnt4                   |
    00110   :  limston material |  1001   |  1002     |   1004    |      1005                    |
    00111   :  himston material |  1111   |  1112     |   1114    |      1115                   |

    Hi Vasu,
    Check out the link.
    Re: TOP OF PAGE with CL_GUI_ALV_GRID
    data: o_html             TYPE REF TO cl_dd_document,
    o_event_receiver   TYPE REF TO lcl_event_receiver.
    CLASS lcl_event_receiver IMPLEMENTATION.
    *-- Top of Page
      METHOD handle_print_top_of_page.
      ENDMETHOD.                    "handle_print_top_of_page
      METHOD handle_top_of_page.
      ENDMETHOD.                    "handle_top_of_page
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
        CREATE OBJECT o_dockingcontainer
          EXPORTING
            ratio                     = '95'
         EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5
          OTHERS                      = 6.
        IF sy-subrc NE 0.
          MESSAGE i000 WITH text-013.   " Error in object creation
          LEAVE LIST-PROCESSING.
        ENDIF.
    *--Create Splitter Container
        CREATE OBJECT o_split
          EXPORTING
            parent            = o_dockingcontainer
            sash_position     = 20
            with_border       = 0
          EXCEPTIONS
            cntl_error        = 1
            cntl_system_error = 2
            OTHERS            = 3.
    *--Get the containers of the splitter control
    <b>o_container_top = o_split->top_left_container.</b>-TOP
    o_container_bot = o_split->bottom_right_container. -ALV
      ENDIF.
      CREATE OBJECT o_alvgrid
         EXPORTING
           i_parent = o_container_bot.
    *-- <b>Print Top of Page</b>
    DATA: lws_text  TYPE sdydo_text_element.
      IF cl_gui_alv_grid=>offline( ) IS INITIAL.
    *-- Object for HTML top container
        CREATE OBJECT o_html
            EXPORTING style            = 'ALV_GRID'
                      background_color = 35.
    *-- Top of Page
        CALL METHOD o_alvgrid->list_processing_events
          EXPORTING
            i_event_name = 'TOP_OF_PAGE'
            i_dyndoc_id  = o_html.
    *-- Total Record Text
        CALL METHOD o_html->add_text
          EXPORTING
            text         = text-014
            sap_emphasis = text-017.
        CALL METHOD o_html->add_gap
          EXPORTING
            width = 8.
    **-- Total record Value
        lws_text = cnt_total.
        CALL METHOD o_html->add_text
          EXPORTING
            text         = lws_text
            sap_emphasis = text-017.
        CLEAR  lws_text.
        CALL METHOD o_html->new_line
          EXPORTING
            repeat = 1.
    **-- Total Success text
        CALL METHOD o_html->add_text
          EXPORTING
            text         = text-015
            sap_emphasis = text-017
            fix_lines    = c_x.
        CALL METHOD o_html->add_gap
          EXPORTING
            width = 12.
        lws_text = cnt_success.
        CALL METHOD o_html->add_text
          EXPORTING
            text         = lws_text
            sap_emphasis = text-017
            fix_lines    = c_x.
        CLEAR  lws_text.
        CALL METHOD o_html->new_line
          EXPORTING
            repeat = 1.
    *-- Total Failed text
        CALL METHOD o_html->add_text
          EXPORTING
            text         = text-016
            sap_emphasis = text-017
            fix_lines    = c_x.
        CALL METHOD o_html->add_gap
          EXPORTING
            width = 16.
        lws_text = cnt_failed.
        CALL METHOD o_html->add_text
          EXPORTING
            text         = lws_text
            sap_emphasis = text-017
            fix_lines    = c_x.
        CLEAR  lws_text.
    *-- Display Report Header
        CALL METHOD o_html->display_document
          EXPORTING
            parent = o_container_top.
      ENDIF.
    http://abap4.tripod.com/download/alvstub.txt
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_endlist.htm
    Reward points if this helps.
    Manish
    Message was edited by:
            Manish Kumar
    Message was edited by:
            Manish Kumar

Maybe you are looking for