How to manage two editable checkboxes in ALV class

Hi all,
I need to make two checkboxes fields appear only in some rows and I found this link:
ALV one  cell as checkbox based on some conditions
but it's not completely what I need, because I have to make the second checkbox editable only when the first one has been flagged, so it would be more useful a class alv.
How can I solve my problem?
Thanks,
   Francesco

Try this:
1-http://www.sapfans.com/forums/viewtopic.php?t=84933
2-http://www.sapfans.com/forums/viewtopic.php?t=69878
3-http://www.sapfans.com/forums/viewtopic.php?t=88376
4-http://www.sapfans.com/forums/viewtopic.php?t=40968
5-http://www.sapfans.com/forums/viewtopic.php?t=6919
Regards
Neha

Similar Messages

  • How to add an editable checkbox to an alv grid

    Hi..
    I need to add an editable checkbox to a alv grid.
    I wouls appreciatet it if anyone could provide some sample code.
    The standard example  BCALV_EDIT_05 is an oops example... I need a simple example
    Please help
    thanks
    Karen

    hi
    after you pass a field as checkbox in fieldcat
    then in layout populate edit
    ex wa_layout-edit = 'X'.
    try the following code
    REPORT  ZALV5.
    TYPE-POOLS: slis.
    tables: mara.
    DATA: begin of it_mara OCCURS 0,
          matnr like mara-matnr,
          mbrsh like mara-mbrsh,
          matkl like mara-matkl,
          meins like mara-meins,
          ersda like mara-ersda,
          ernam like mara-ernam,
          W_CHK type c ,
         END OF it_mara.
    *data: it_mara like  mara occurs 0 with header line.
    data:it_feildtab type slis_t_fieldcat_alv,
         wa_fieldcat type slis_fieldcat_alv.
    *DATA: i_private TYPE slis_data_caller_exit,
    data:     i_selfield TYPE slis_selfield,
          W_exit(1) TYPE c.
    PARAMETERS: p_title TYPE sy-title default 'ALV'.
    START-OF-SELECTION.
      SELECT matnr mbrsh matkl meins  ersda ernam FROM mara
        INTO corresponding fields of  table it_mara.
    wa_fieldcat-col_pos   = '1'.
    wa_fieldcat-fieldname = 'W_CHK'.
    *wa_FIELDCAT-KEY = 'X'.
    *wa_fieldcat-tabname   = 'IT_MARA'.
    *wa_fieldcat-seltext_s = 'units of measure'.
    wa_fieldcat-checkbox = 'X'.
    APPEND wa_fieldcat TO it_feildtab.
    CLEAR wa_fieldcat .
    CLEAR wa_fieldcat.
    wa_fieldcat-col_pos   = '2'.
    wa_fieldcat-tabname   = 'IT_MARA'.
    wa_fieldcat-fieldname = 'MATNR'.
    wa_fieldcat-key = 'X'.
    wa_fieldcat-hotspot = 'X'.
    wa_fieldcat-seltext_s = 'no'.
    APPEND wa_fieldcat TO it_feildtab.
    CLEAR wa_fieldcat .
    wa_fieldcat-col_pos   = '3'.
    wa_fieldcat-fieldname = 'MBRSH'.
    *wa_FIELDCAT-KEY = 'X'.
    wa_fieldcat-tabname   = 'IT_MARA'.
    wa_fieldcat-seltext_s = 'Ind.sec'.
    APPEND wa_fieldcat TO it_feildtab.
    CLEAR wa_fieldcat .
    wa_fieldcat-col_pos   = '4'.
    wa_fieldcat-fieldname = 'MATKL'.
    *wa_FIELDCAT-KEY = 'X'.
    wa_fieldcat-tabname   = 'IT_MARA'.
    wa_fieldcat-seltext_s = 'Description'.
    APPEND wa_fieldcat TO it_feildtab.
    CLEAR wa_fieldcat .
    wa_fieldcat-col_pos   = '5'.
    wa_fieldcat-fieldname = 'MEINS'.
    *wa_FIELDCAT-KEY = 'X'.
    wa_fieldcat-tabname   = 'IT_MARA'.
    wa_fieldcat-edit      = 'X'.
    wa_fieldcat-seltext_s = 'units of measure'.
    APPEND wa_fieldcat TO it_feildtab.
    CLEAR wa_fieldcat .
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
           EXPORTING
                i_title                 = p_title
                i_selection             = 'X'
                i_zebra                 = 'X'
               I_SCREEN_START_COLUMN   = 0
               I_SCREEN_START_LINE     = 0
                I_SCREEN_END_COLUMN     = 0
               I_SCREEN_END_LINE       = 0
                i_checkbox_fieldname    = 'W_CHK'
              I_LINEMARK_FIELDNAME    =
              I_SCROLL_TO_SEL_LINE    = 'X'
                i_tabname               = 'IT_MARA'
              i_structure_name        = 'IT_MARA'
               IT_FIELDCAT             = it_feildtab
              IT_EXCLUDING            =
              I_CALLBACK_PROGRAM      =
              I_CALLBACK_USER_COMMAND =
               IS_PRIVATE             = I_PRIVATE
         IMPORTING
                es_selfield             = i_selfield
                e_exit                  = w_exit
           TABLES
                t_outtab                = it_mara
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
      IF sy-subrc <> 0.
       MESSAGE i000(0k) WITH sy-subrc.
      ENDIF.
      LOOP AT it_mara WHERE W_CHK = 'X'.
        WRITE: /  it_mara-ersda, it_mara-ernam.
      ENDLOOP.
    reward if helpful
    prasanth

  • Set editable/non-editable checkbox in alv grid

    Hi all,
    How to set a checkbox in alv grid in editable/non-editable. i am using alv gird display function module for this. i tried to used method  cl_gui_alv_grid=>mc_style_disabled. but its not working. is it possible to have this functionality in grid? please help. thanks in advance.

    Hi,
    Try like this.
    CALL METHOD gr_alvgrid->set_table_for_first_display
    EXPORTING
    I_BUFFER_ACTIVE =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    is_layout = gs_layout
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    CHANGING
    it_outtab = gt_list[]
    it_fieldcatalog = gt_fieldcat
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4
    regards
    Rajesh kumar

  • How to manage two sites from iWeb

    Hi all
    I've built two different sites with iWeb, my personal site which goes to my .mac server and publishes there, no problem. I now have built another site for my girlfiends family business, and theirs will go to a differente host and server.
    The problem I have is that I have both sites now open, each with their own individual pages, etc (they both appear on the left column as headers), but I can't seem to isolate them for publishing purposes. In other words, I'd like to publish my site to .mac, and my girlfriends site to my hard drive for eventual upload to their server.
    When I go to publish, whether I select .mac or my hard drive (publish to another folder) it selects both sites at the same time, I.e. I can't publich them individually.
    The problem is that I end up with a copy of my personal webpage files on my hard drive, and a copy of their webpage files on my .mac!
    A further problem I see is that this publishing process creates just one index.html file, for both pages. So how can I use this html file to point it to their domain??
    Appreciate the help, thanks
    J

    J:
    To add another method to the mix here's how I manage multiple sites. Although they all go to my .Mac account this method can let me post any of them to any other server as I see fit.
    One way to handle multiple sites is to use iWebSites. It lets me create multiple sites and multiple domain files. If you have multiple sites in one domain file here's the workflow I used to split them into individual site files with iWebSites.
    This lets me edit several sites and only republish the one I want to where I want.
    Do you Twango?
    15 MBP 2.16Ghz; G5 Dual Core 2GHz, 2G RAM, 250G HD; G4 Dual 1Ghz, 1.5G RAM;   Mac OS X (10.4.9)   22" LCD, 710G FW HDs, Canon: SD700IS/i850/LIDE 50, Epson R200, 30G iPod, 2G Nano

  • How to manage two viewstacks with one linkbar?

    hello all,
    I currently am creating my website utilizing flex and have come across a roadblock.  I need a single linkbar to manage two viewstacks but cannot figure out how to do this so far.  i have tried using both id's in the dataProvider but the only one it manages is the last input.  please advise how to do this or another way in which i can accomplish what i am trying to do.
    for your information:  one viewstack will be for the pages of the site and the other will be for banners on each page.  I cannot put the banners in the viewstack because they will be larger than the pages
    here is some of the code:
    <mx:LinkBar x="10" y="116" dataProvider="{body, ads}" fontSize="18" height="29">
    </mx:LinkBar>
    when i run the application i do not receive any errors however the only viewstack that changes is the ads or vice versa if i have body last.

    Sure, user a Timer:
    http://livedocs.adobe.com/flex/3/html/help.html?content=08_Dates_and_times_4.html
    http://blog.flexexamples.com/2007/08/14/creating-a-simple-timer-in-flex-with-the-flashutil stimer-class/
    http://livedocs.adobe.com/flex/3/html/help.html?content=16_Event_handling_7.html
    http://www.cs.vu.nl/~eliens/im/assets/flex3/langref/flash/utils/Timer.html
    If this post answered your question or helped, please mark it as such.

  • How to manage two skype numbers on one account?

    I'm considering getting a second number to use for work. I understand that's easy. What I can't find in help is how to manage each separately.
    I see one post saying that Skype hasn't added a way to tell which number is being called. Has that changed?
    The other question is: Can I set one to go to vmail automatically while the other receives calls? For instance, after hours I want to "turn off" the business number and leave the home number accepting calls. Is that possible?

    Hi, Ithinkfiam,
    ithinktfiam wrote:
    I'm considering getting a second number to use for work. I understand that's easy. What I can't find in help is how to manage each separately.
    I see one post saying that Skype hasn't added a way to tell which number is being called. Has that changed?
    No, this has not changed.
    ithinktfiam wrote:
    The other question is: Can I set one to go to vmail automatically while the other receives calls? For instance, after hours I want to "turn off" the business number and leave the home number accepting calls. Is that possible?
    Unfortunately, Skype Numbers do not work as you describe.
    While we are allowed to start up to ten (10) Skype Number subscriptions per Skype account, being affiliated with the same account, will behave as if all ten numbers are actually only one number.   What to do? 
    ithinktfiam wrote:
    What I can't find in help is how to manage each separately.
    Create a new Skype account to use for Skype Number intended for business use, and use another Skype Number as a personal or home account.  Nothing changes as far as the cost of the Skype Numbers is concerned, however what changes by using each Skype Number on a different Skype Account is that you can control each number separately.
    All that said, unfortunately Skype's mobile platforms do not support being logged in to two Skype accounts simultaneously.  The Windows Desktop platform does, however doing the same on a Mac is not supported, and the work-around is messy at best.
    Not so sure I helped much, here!
    Best regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • How to get two header colums using alv?

    Hi,
    experts,
    I want to display alv output with two header columns like shows below:
    Subjects
    |   English       |         Maths       |     Science     |    Social   |         Politics                   |                
    100
    56
    89
    12
    85
    25
    85
    36
    78
    100
    75
    55
    65
    74
    100
    How to acheive this by using ALV Grid dispaly. please end me any document on this .
    Thanks in advance,
    Shabeer Ahmed.

    Hi,
    Please check the link given below :
    Two column header in ALV Report
    hope it will help you.
    Thanks & Regards,
    Sarita Singh Rathour

  • HOW TO READ THE EDITABLE FIELD IN ALV

    CAN ANYONE HELP ME IN READING THE EDITABLE FIELD IN ALV.
    I AM DOING THE FOLLOWING.
    BUT STILL THE EDITABLE FIELD IN NOT READ.
    WHEN 'EXE' OR 'EXEC'.
      LOOP AT I_RB1 INTO L_WA_STRU.
      L_WA_STRU-LIFSK = L_WA_STRU-LIFSK1.
      MODIFY I_RB1 FROM L_WA_STRU.
      CLEAR L_WA_STRU.
      ENDLOOP.
    I_RB1 IS MY TABLE WHICH I PASSED IN TABLES OF REUSE_ALV_GRID_DISPLAY.LIFSK1 IS MY EDITABLE FIELD.
    AND LIFSK IS THE FIELD WHERE THE DATA SHOULD GET TRANSFERRED WHEN I HIT EXECUTE BUTTON.

    DATA: lt_display LIKE TABLE OF gt_display.
      REFRESH lt_display.
      CLEAR lt_display.
      lt_display[] = gt_display[].
      CLEAR ref_grid.
      IF ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = ref_grid.
      ENDIF.
      IF NOT ref_grid IS INITIAL.
        CALL METHOD ref_grid->check_changed_data.
      ENDIF.
      IF lt_display[] NE gt_display[].
        gv_tosave = 'X'.
      ENDIF.
    Check this program. It will help you. 
    awrd points if helpful
    Bhupal

  • How to manage two iphones on one computer

    How to manage, sync, use iCloud without data getting mixed up on one computer

    Easy.
    There is no device limit for the number of iPods, iPads, and iPhones that can be synced with the same iTunes library. Each device can have its own sync preferences with iTunes, which is selected under the various tabs for the device's sync preferences with iTunes.

  • How to manage and edit albums in iOS iPhoto?

    I'm unclear how to manage albums: adding or removing photos to or from an album, creating and renaming them?

    i have iPAD mini. I have installed facebook there.
    i have uploaded 23 photos from iPAD to facebook and all stored in iOS album, which is default album name.
    now later, from my laptop i have renamed iOS album in to 'sonmething'. Now after that, when i try to upload photos from iPAD to facebook, default album shows 'something'.
    is there any options for creating new album? or is there any chance to upload a new iOS album?

  • How can we manage two different itab in ALV

    Hi Experts,
                   I have a requirement where i need to convert classical report to ALV Grid. This report outputs two different itab with different columns (structures)
    Example like...
    <u> Costs</u>
    1. 2. 3. 4.
    <u>Revenues</u>
    1. 2. 3.
    Appreciate your  ideas how can this be done to fit into one ALV grid .   
    Is this possible?
    Ravi.

    Hi,
    You can use the class cl_gui_splitter_container and split the container in two rows, one row for costs and the other one for Revenues.
    Something like this:
    data: obj_splitter TYPE REF TO cl_gui_splitter_container.
       g_custom_container TYPE REF TO cl_gui_custom_container,
       g_cont_req TYPE REF TO cl_gui_container,
       g_cont_det TYPE REF TO cl_gui_container.
    Create container instance
      CREATE OBJECT g_custom_container
          EXPORTING container_name = 'ALV_CONTAINER'.
    Split container
      CREATE OBJECT obj_splitter
                   EXPORTING parent  = g_custom_container
                             rows    = 2
                             columns = 1.
    Get reference to row 1, Column 1
        CALL METHOD obj_splitter->get_container
          EXPORTING
            row       = 1
            column    = 1
          RECEIVING
            container = g_cont_req.
      Get reference row 2, Column 1
        CALL METHOD obj_splitter->get_container
              EXPORTING
                row       = 2
                column    = 1
              RECEIVING
                container = g_cont_det.
    Set height of row 1
    Add
        CALL METHOD obj_splitter->set_row_height
          EXPORTING
            id     = 1
            height = 60.
    Create Object AVL with reference to container row 1,
    column 1
        CREATE OBJECT alv_grid
          EXPORTING i_parent = g_cont_req.
    Create Object AVL with reference to container row 2,
    column 1
          CREATE OBJECT alv_grid2
           EXPORTING i_parent = g_cont_det.
    Then you should continue like in ALV grid, to show data with method set_table_for_first_display
    For the first row:
          CALL METHOD alv_grid->set_table_for_first_display
              EXPORTING
                        is_variant       = gs_variant
                        i_save           = x_save
                        is_layout        = gs_layout
              CHANGING
                        it_outtab        = i_zdocument
                        it_sort          = i_sortcat
                        it_fieldcatalog  = gt_fieldcat.
    For the second row:
       CALL METHOD alv_grid->set_table_for_first_display...
    Regards,
    Alejandro.

  • ALV Object : how to manage two grid in one screen ?

    Hello,
    I would like to print in a same screen two ALV grid with different command for each.
    The two grid will be linked.
    One is the header of the datas and the second represent the items of the selected data in the the header grid.
    Is it possible to do this in ALV object or only in transaction with "control tables"?
    Do you have any example for me, please ?
    Thanks in advance for help,
    Best regards,
    Bertrand

    Hi,
    go through this code,
    REPORT  Z7RNP_ALV_SO_BLOCK  MESSAGE-ID Z7NEW                     .
    TABLE DECLARATION
    TABLES: VBAK ,             "Sales Document: Header Data
            VBAP ,             "Sales Document: Item Data
            MAKT ,             "Material Descriptions
            LIPS .             "SD document: Delivery: Item data
    DECLARATION OF TYPE-POOL
    *THIS TYPE-POOL CONTAINS THE EVENTS,
    TYPE-POOLS : SLIS.
    DECLARATION OF EVENTS
    DECLARATION OF FIELD LAYOUT
    DATA: I_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: T_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: T_EVENT TYPE SLIS_T_EVENT.
    DATA: X_EVENT TYPE SLIS_ALV_EVENT.
    DECLARATION OF LIST HEADER
    DATA: I_LISTHEADER TYPE SLIS_T_LISTHEADER.
    DECLARATION OF FIELD CATALOG FOR SCREEN 1
    DATA: I_FLDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
    DECLARATION OF FIELD CATALOG FOR SCREEN 2
    DATA: I_FLDCAT2 TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
    SORTING OF OUTPUT
    DATA: I_SORT TYPE SLIS_T_SORTINFO_ALV.
    DATA: T_SORT TYPE SLIS_T_SORTINFO_ALV.
    *DATA DECLARATION
    DATA: V_AUART TYPE TVAK-AUART,
          V_VKORG TYPE TVKO-VKORG,
          V_KUNNR TYPE KNA1-KUNNR,
          V_MATNR TYPE MARA-MATNR ,
          V_SPART TYPE TVTA-SPART .
    DATA: V_REPID LIKE SY-REPID .
    TYPES: BEGIN OF IT_SO ,
           VBELN TYPE VBELN_VA ,          "SALES ORDER NO.
           AUART TYPE AUART ,             "SALES DOC. TYPE
           VKORG TYPE VKORG ,             "SALES ORG.
           SPART TYPE SPART ,             "DIVISION
           KUNNR TYPE KUNAG ,             "SOLD TO PARTY
           POSNR TYPE POSNR_VA ,          "SALES DOC. ITEM
           MATNR TYPE MATNR ,             "MATERIAL NO
           MAKTX TYPE MAKTX ,             "DESCRIPTION
           KWMENG TYPE KWMENG ,           "QUANTITY
           VRKME TYPE VRKME ,             "SALES UNIT
           END OF IT_SO .
    TYPES: BEGIN OF IT_DEL ,
           VBELN TYPE VBELN_VL ,         "SALES ORDER NO.
           POSNR TYPE POSNR_VL ,         "SALES DOC. ITEM
           MATNR TYPE MATNR ,            "MATERIAL NO
           WERKS TYPE WERKS_D ,          "PLANT
           LGORT TYPE LGORT_D ,          "STORAGE LOCATION
           CHARG TYPE CHARG_D ,          "BATCH NO.
           LFIMG TYPE LFIMG ,            "ACTUAL DELIVERY QTY.
           VRKME TYPE VRKME ,            "SALES UNIT
           END OF IT_DEL .
    TYPES: BEGIN OF TYPE_VBFA ,
           VBELV TYPE VBELN_VON ,
           "Preceding sales and distribution document
           POSNV TYPE POSNR_VON ,      "Preceding item of an SD document
           VBELN TYPE VBELN_NACH ,
           "Subsequent sales and distribution document
           POSNN TYPE POSNR_NACH,
           "Document category of subsequent document
           VBTYP_N TYPE VBTYP_N ,
          END OF TYPE_VBFA .
    DATA: IT_SO1 TYPE STANDARD TABLE OF IT_SO ,
          IT_DEL1 TYPE STANDARD TABLE OF IT_DEL ,
          IT_VBFA TYPE STANDARD TABLE OF TYPE_VBFA,
          IT_DEL_FUL TYPE STANDARD TABLE OF IT_DEL.
    DATA: WA_SO TYPE IT_SO ,
          WA_DEL TYPE IT_DEL ,
          WA_VBFA TYPE TYPE_VBFA,
          wa_IT_DEL_FUL TYPE IT_DEL.
    *SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-004 .
    SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN ,
                    S_AUART FOR V_AUART ,
                    S_VKORG FOR V_VKORG ,
                    S_SPART FOR V_SPART ,
                    S_KUNNR FOR V_KUNNR ,
                    S_MATNR FOR V_MATNR .
    SELECTION-SCREEN END OF BLOCK BLK1 .
    *AT SELECTION SCREEN
    AT SELECTION-SCREEN.
      SELECT SINGLE VBELN
                     FROM VBAK INTO VBAK-VBELN
                     WHERE VBELN IN S_VBELN.
      IF SY-SUBRC <> 0.
        MESSAGE E202.
      ENDIF.
    *START OF SELECTION
    INITIALIZATION.
      V_REPID = SY-REPID.
    START-OF-SELECTION .
      PERFORM DATA_SELECT.
    FOR BLOCK 1
      PERFORM INITIALIZE_BLOCK .
      PERFORM FLD_CAT USING I_FLDCAT[] .
      PERFORM T_LAYOUT USING I_LAYOUT .
      PERFORM I_SORT USING I_SORT .
      PERFORM EVENT USING T_EVENT .
      PERFORM CALL_ALV.
    FOR BLOCK 2
      PERFORM FLD_CAT2 USING I_FLDCAT2[] .
      PERFORM I_LAYOUT USING I_LAYOUT .
    PERFORM T_SORT USING I_SORT .
      PERFORM EVENT1 USING T_EVENT .
      PERFORM CALL_ALV1.
      PERFORM BLOCK-DISPLAY .
    *&      Form  DATA_SELECT
          text
    -->  p1        text
    <--  p2        text
    FORM DATA_SELECT .
      REFRESH: IT_VBFA, IT_SO1, IT_DEL1, IT_DEL_FUL.
      SELECT
            A~VBELN
            A~AUART
            A~VKORG
            A~SPART
            A~KUNNR
            B~POSNR
            B~MATNR
            C~MAKTX
            B~KWMENG
            B~VRKME
            INTO TABLE IT_SO1 FROM VBAK AS A
                  JOIN VBAP AS B ON BVBELN = AVBELN
                  JOIN MAKT AS C ON CMATNR = BMATNR
                  AND C~SPRAS = SY-LANGU
                  WHERE A~VBELN IN S_VBELN .
      IF SY-SUBRC = 0.
        SELECT VBELV POSNV VBELN POSNN VBTYP_N INTO TABLE IT_VBFA
               FROM VBFA
               FOR ALL ENTRIES IN IT_SO1
               WHERE VBELV = IT_SO1-VBELN
               AND   POSNN = IT_SO1-POSNR
               AND VBTYP_N ='J' .
       IF SY-SUBRC = 0.
          SELECT VBELN POSNR MATNR WERKS LGORT CHARG LFIMG VRKME
                 FROM LIPS INTO TABLE IT_DEL_FUL
                 FOR ALL ENTRIES IN IT_VBFA
                 WHERE VBELN = IT_VBFA-VBELN
                 AND   POSNR = IT_VBFA-POSNN.
        ENDIF.
        ENDIF .
        V_REPID = SY-REPID .
    ENDFORM.                    " DATA_SELECT
    *&      Form  INITIALIZE_BLOCK
          text
    -->  p1        text
    <--  p2        text
    FORM INITIALIZE_BLOCK .
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        I_CALLBACK_PROGRAM             = V_REPID .
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      IT_EXCLUDING                   =
    ENDFORM.                    " INITIALIZE_BLOCK
    *&      Form  FLD_CAT
          text
         -->P_I_FLDCAT[]  text
    FORM FLD_CAT  USING    P_I_FLDCAT TYPE SLIS_T_FIELDCAT_ALV.
      CLEAR I_FLDCAT.
      I_FLDCAT-FIELDNAME   = 'VBELN'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT-TABNAME     = 'IT_SO1'.
      I_FLDCAT-SELTEXT_M   = 'SALES ORDER NO.'.
      I_FLDCAT-COL_POS     = 1.        " POSITION OF THE COLUMN.
      I_FLDCAT-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT-KEY         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT.
      CLEAR I_FLDCAT.
      I_FLDCAT-FIELDNAME   = 'AUART'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT-TABNAME     = 'IT_SO1'.
      I_FLDCAT-SELTEXT_M   = 'SALES DOC. TYPE'.
      I_FLDCAT-COL_POS     = 2.        " POSITION OF THE COLUMN.
      I_FLDCAT-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT-KEY         = 'X'.
      " SO THAT THIS FIELD IS NOT SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT.
      CLEAR I_FLDCAT.
      I_FLDCAT-FIELDNAME   = 'VKORG'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT-TABNAME     = 'IT_SO1'.
      I_FLDCAT-SELTEXT_M   = 'SALES ORG.'.
      I_FLDCAT-COL_POS     = 3.        " POSITION OF THE COLUMN.
      I_FLDCAT-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT-KEY         = 'X'.
      " SO THAT THIS FIELD IS NOT SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT.
      CLEAR I_FLDCAT.
      I_FLDCAT-FIELDNAME   = 'SPART'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT-TABNAME     = 'IT_SO1'.
      I_FLDCAT-SELTEXT_M   = 'DIVISION'.
      I_FLDCAT-COL_POS     = 4.        " POSITION OF THE COLUMN.
      I_FLDCAT-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT-KEY         = 'X'.
      " SO THAT THIS FIELD IS NOT SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT.
      CLEAR I_FLDCAT.
      I_FLDCAT-FIELDNAME   = 'KUNNR'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT-TABNAME     = 'IT_SO1'.
      I_FLDCAT-SELTEXT_M   = 'SOLD TO PARTY'.
      I_FLDCAT-COL_POS     = 5.        " POSITION OF THE COLUMN.
      I_FLDCAT-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT-KEY         = 'X'.
      " SO THAT THIS FIELD IS NOT SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT.
      CLEAR I_FLDCAT.
      I_FLDCAT-FIELDNAME   = 'POSNR'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT-TABNAME     = 'IT_SO1'.
      I_FLDCAT-SELTEXT_M   = 'SALES DOC. ITEM'.
      I_FLDCAT-COL_POS     = 6.        " POSITION OF THE COLUMN.
      I_FLDCAT-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT-KEY         = 'X'.
      " SO THAT THIS FIELD IS NOT SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT.
      CLEAR I_FLDCAT.
      I_FLDCAT-FIELDNAME   = 'MATNR'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT-TABNAME     = 'IT_SO1'.
      I_FLDCAT-SELTEXT_M   = 'MATERIAL NO.'.
      I_FLDCAT-COL_POS     = 7.        " POSITION OF THE COLUMN.
      I_FLDCAT-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT-KEY         = 'X'.
      " SO THAT THIS FIELD IS NOT SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT.
      CLEAR I_FLDCAT.
      I_FLDCAT-FIELDNAME   = 'MAKTX'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT-TABNAME     = 'IT_SO1'.
      I_FLDCAT-SELTEXT_M   = 'DESCRIPTION'.
      I_FLDCAT-COL_POS     = 8.        " POSITION OF THE COLUMN.
      I_FLDCAT-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT-KEY         = 'X'.
      " SO THAT THIS FIELD IS NOT SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT.
      CLEAR I_FLDCAT.
      I_FLDCAT-FIELDNAME   = 'KWMENG'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT-TABNAME     = 'IT_SO1'.
      I_FLDCAT-SELTEXT_M   = 'QUANTITY'.
      I_FLDCAT-COL_POS     = 9.        " POSITION OF THE COLUMN.
      I_FLDCAT-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT-KEY         = 'X'.
      " SO THAT THIS FIELD IS NOT SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT.
      CLEAR I_FLDCAT.
      I_FLDCAT-FIELDNAME   = 'VRKME'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT-TABNAME     = 'IT_SO1'.
      I_FLDCAT-SELTEXT_M   = 'SALES UNIT'.
      I_FLDCAT-COL_POS     = 10.        " POSITION OF THE COLUMN.
      I_FLDCAT-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT-KEY         = 'X'.
      " SO THAT THIS FIELD IS NOT SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT.
    ENDFORM.                    " FLD_CAT
    *&      Form  T_LAYOUT
          text
         -->P_I_LAYOUT  text
    FORM T_LAYOUT  USING    P_I_LAYOUT TYPE SLIS_LAYOUT_ALV .
    P_I_LAYOUT-ZEBRA = 'X'.
    P_I_LAYOUT-KEY_HOTSPOT = 'X'.
    P_I_LAYOUT-F2CODE            = 'DISP'.
    ENDFORM.                    " T_LAYOUT
    *&      Form  I_SORT
          text
         -->P_I_SORT  text
    FORM I_SORT  USING    P_I_SORT TYPE SLIS_T_SORTINFO_ALV .
      DATA: I_SORT TYPE SLIS_SORTINFO_ALV .
      REFRESH P_I_SORT .
      CLEAR I_SORT.
      I_sort-spos = 1.
      I_sort-fieldname = 'VBELN'.
      I_sort-up = 'X'.
      I_sort-subtot = 'X'.
      I_sort-group = '*'.
      APPEND I_SORT TO P_I_SORT.
    ENDFORM.                    " I_SORT
    *&      Form  CALL_ALV
          text
    -->  p1        text
    <--  p2        text
    FORM   CALL_ALV .
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = T_LAYOUT
        IT_FIELDCAT                      = I_FLDCAT[]
        I_TABNAME                        = 'IT_SO1'
        IT_EVENTS                        = T_EVENT
       IT_SORT                          = I_SORT
       I_TEXT                           = TEXT-202
      TABLES
        T_OUTTAB                         = IT_SO1
    EXCEPTIONS
      PROGRAM_ERROR                    = 1
      MAXIMUM_OF_APPENDS_REACHED       = 2
      OTHERS                           = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    REFRESH T_EVENT .
    CLEAR T_EVENT .
    ENDFORM.                    " CALL_ALV
    *&      Form  FLD_CAT2
          text
         -->P_I_FLDCAT2[]  text
    FORM FLD_CAT2  USING    P_I_FLDCAT2 TYPE SLIS_T_FIELDCAT_ALV.
      CLEAR I_FLDCAT2.
      I_FLDCAT2-FIELDNAME   = 'VBELN'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT2-SELTEXT_M   = 'DELIVERY NO.'.
      I_FLDCAT2-COL_POS     = 1.        " POSITION OF THE COLUMN.
      I_FLDCAT2-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT2-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT2-KEY         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      I_FLDCAT2-HOTSPOT     = 'X'.
      APPEND I_FLDCAT2.
      CLEAR I_FLDCAT2.
      I_FLDCAT2-FIELDNAME   = 'POSNR'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT2-SELTEXT_M   = 'DELIVERY ITEM'.
      I_FLDCAT2-COL_POS     = 2.        " POSITION OF THE COLUMN.
      I_FLDCAT2-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT2-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT2-KEY         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT2.
      CLEAR I_FLDCAT2.
      I_FLDCAT2-FIELDNAME   = 'MATNR'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT2-SELTEXT_M   = 'MATERIAL NO.'.
      I_FLDCAT2-COL_POS     = 3.        " POSITION OF THE COLUMN.
      I_FLDCAT2-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT2-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT2-KEY         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT2.
      CLEAR I_FLDCAT2.
      I_FLDCAT2-FIELDNAME   = 'WERKS'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT2-SELTEXT_M   = 'PLANT.'.
      I_FLDCAT2-COL_POS     = 4.        " POSITION OF THE COLUMN.
      I_FLDCAT2-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT2-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT2-KEY         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT2.
      CLEAR I_FLDCAT2.
      I_FLDCAT2-FIELDNAME   = 'LGORT'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT2-SELTEXT_M   = 'ST. LOCATION'.
      I_FLDCAT2-COL_POS     = 5.        " POSITION OF THE COLUMN.
      I_FLDCAT2-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT2-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT2-KEY         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT2.
      CLEAR I_FLDCAT2.
      I_FLDCAT2-FIELDNAME   = 'CHARG'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT2-SELTEXT_M   = 'BATCH NO.'.
      I_FLDCAT2-COL_POS     = 6.        " POSITION OF THE COLUMN.
      I_FLDCAT2-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT2-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT2-KEY         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT2.
      CLEAR I_FLDCAT2.
      I_FLDCAT2-FIELDNAME   = 'LFIMG'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT2-SELTEXT_M   = 'ACT. DEL. QTY.'.
      I_FLDCAT2-COL_POS     = 7.        " POSITION OF THE COLUMN.
      I_FLDCAT2-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT2-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT2-KEY         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT2.
      CLEAR I_FLDCAT2.
      I_FLDCAT2-FIELDNAME   = 'VRKME'. "FIELD FOR WHICH CATALOG ID FILLED
      I_FLDCAT2-SELTEXT_M   = 'SALES UNIT.'.
      I_FLDCAT2-COL_POS     = 8.        " POSITION OF THE COLUMN.
      I_FLDCAT2-OUTPUTLEN   = 20.       " SET THE OUTPUT LENGTH.
      I_FLDCAT2-EMPHASIZE   = 'X'.      " COLOR OF THIS COLUMN.
      I_FLDCAT2-KEY         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
    I_FLDCAT-HOTSPOT     = 'X'.
      APPEND I_FLDCAT2.
    ENDFORM.                    " FLD_CAT2
    *&      Form  I_LAYOUT
          text
         -->P_I_LAYOUT  text
    FORM I_LAYOUT  USING    P_I_LAYOUT TYPE SLIS_LAYOUT_ALV .
    P_I_LAYOUT-ZEBRA = 'X'.
    P_I_LAYOUT-KEY_HOTSPOT = 'X'.
    P_I_LAYOUT-F2CODE            = 'DISP'.
    ENDFORM.                    " I_LAYOUT
    *&      Form  CALL_ALV1
          text
    -->  p1        text
    <--  p2        text
    FORM CALL_ALV1 .
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = I_LAYOUT
        IT_FIELDCAT                      = I_FLDCAT2[]
        I_TABNAME                        = 'IT_DEL_FUL'
        IT_EVENTS                        = T_EVENT
      IT_SORT                          =
      I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = IT_DEL_FUL
    EXCEPTIONS
      PROGRAM_ERROR                    = 1
      MAXIMUM_OF_APPENDS_REACHED       = 2
      OTHERS                           = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " CALL_ALV1
    *&      Form  BLOCK-DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM BLOCK-DISPLAY .
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK             = ' '
      IS_PRINT                      =
      I_SCREEN_START_COLUMN         = 0
      I_SCREEN_START_LINE           = 0
      I_SCREEN_END_COLUMN           = 0
      I_SCREEN_END_LINE             = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER       =
      ES_EXIT_CAUSED_BY_USER        =
    EXCEPTIONS
       PROGRAM_ERROR                 = 1
       OTHERS                        = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " BLOCK-DISPLAY
    *&      Form  EVENT
          text
         -->P_T_EVENT  text
    FORM EVENT  USING    P_T_EVENT type slis_t_event.
    x_event-form = 'TOP_OF_LIST1'.
    x_event-name = slis_ev_top_of_list.
    append x_event to p_t_event.
    clear x_event .
    ENDFORM.                    " EVENT
    *&      Form  EVENT1
          text
         -->P_T_EVENT  text
    FORM EVENT1  USING    P_T_EVENT type slis_t_event.
    x_event-form = 'TOP_OF_LIST2'.
    x_event-name = slis_ev_top_of_list.
    append x_event to p_t_event.
    ENDFORM.                    " EVENT1
    FORM TOP_OF_LIST1.
    SKIP 1.
    WRITE: 10 'BLOCK LIST 1 FOR SALES ORDER DETAILS ' COLOR 4 .
    skip 1.
    format reset.
    endform.
    FORM TOP_OF_LIST2.
    skip 1.
    WRITE: 10 'BLOCK LIST 2 FOR DELIVERY ORDER DETAILS ' COLOR 4 .
    skip 1.
    format reset.
    endform.
    reward if useful.

  • How to make fields editable in an alv tree

    hi
    there is an alv grid for which tree view shud also be made. The cells that are editable in the grid should also be editable in the tree.
    please let me know how to make the specific cells of the tree editable

    after setting the edit field in the field catalogue its bot working.
    i am posting the code snippet.
    please let me know what else should be done and how to add  INPUT field to the fieldcat.
      field-symbols: <fs_fieldcat> type lvc_s_fcat.
      data: l_tabix type sy-tabix.
      data: g_fieldcatalog type lvc_t_fcat,
            wa_fcat like line of g_fieldcatalog.
      data : hide type c value 'X'.
      call function 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'RSTHIE_M'
          i_client_never_display = 'X'
          i_bypassing_buffer     = 'X'
        CHANGING
          ct_fieldcat            = g_fieldcatalog.
    ***-set table header on middle width
      LOOP AT g_fieldcatalog ASSIGNING <fs_fieldcat>.
        <fs_fieldcat>-FIX_COLUMN = 'X'.
        <fs_fieldcat>-edit = 'X'.
      ENDLOOP.

  • How to save the edited fields in ALV list

    Hi
    hope you could help me find a solution, I made my fields editable in ALV grid display as you can see in the code ZID_NUM, ZLAST_NAME and ZMIDDLE_NAME is editable..
    an example scenario would be if I execute the program it will show me 5 lines, all the fields can be edited by the user...(example he edited all data in the result).  When he press save, it will automatically update the ztable (ZMEMPLIST in this case). How do you go about the saving?
    thanks!!
    select * from zmemplist client specified
        into corresponding fields of table it_ztable.
    it_fieldcat-fieldname = 'ZID_NUM'.
    it_fieldcat-seltext_m = ' ID Number '.
    it_fieldcat-col_pos     = 1.
    it_fieldcat-input = 'X'.
    it_fieldcat-edit = 'X'.
    append it_fieldcat to it_fieldcat.
    clear  it_fieldcat.
    it_fieldcat-fieldname = 'ZLAST_NAME'.
    it_fieldcat-seltext_m = ' Last Name '.
    it_fieldcat-col_pos     = 2.
    it_fieldcat-input = 'X'.
    it_fieldcat-edit = 'X'.
    append it_fieldcat to it_fieldcat.
    clear  it_fieldcat.
    it_fieldcat-fieldname = 'ZFIRST_NAME'.
    it_fieldcat-seltext_m = ' First Name '.
    it_fieldcat-col_pos     = 3.
    it_fieldcat-input = 'X'.
    it_fieldcat-edit = 'X'.
    append it_fieldcat to it_fieldcat.
    clear  it_fieldcat.
    call function 'REUSE_ALV_GRID_DISPLAY'
      exporting
        i_callback_program       = sy-repid
        it_fieldcat              = it_fieldcat[]
        i_callback_user_command  = 'USER_COMMAND'
        i_callback_pf_status_set = 'SET_PF_STATUS'
      tables
        t_outtab                 = it_ztable.
    *&      Form  user_command
          Handling custom function codes
         -->R_UCOMM      Function code value
         -->RS_SELFIELD  Info. of cursor position in ALV
    form user_command  using    r_ucomm like sy-ucomm
                      rs_selfield type slis_selfield.
      case r_ucomm.
        when 'SAVE'.
    endform

    Hi Lawrence,
    Include follwoing code on your user command for 'SAVE'.
    *& Form user_command
    * Handling custom function codes
    * -->R_UCOMM Function code value
    * -->RS_SELFIELD Info. of cursor position in ALV
    form user_command using r_ucomm like sy-ucomm
    rs_selfield type slis_selfield.
    case r_ucomm.
    when 'SAVE'.
          DATA ref1 TYPE REF TO cl_gui_alv_grid.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              e_grid = ref1.
          CALL METHOD ref1->check_changed_data.
             ...............  " your action
         * endform
    Hope this will sovle your query.
    Pratik Vora

  • How to make the editable col. in alv grid scrollable?

    friends,
        i have made the last col. in my alv grid editable..even though i have declared it as char of length 255, it's showing only 50 characters in the grid..but when i try to type beyond 50 characters, it's not allowing...how to make it scrollable so that it extends beyond 50 char. and capture all the characters typed in that col.? pl suggest..thanks all..
    Sathish. R

    Hi, u can extend the length of your last field.
    LOOP AT t_fieldcat INTO ls_fcat.
        CASE ls_fcat-fieldname.
          WHEN text-001.
            ls_fcat-outputlen = c_10.                    "10
          WHEN text-002.
            ls_fcat-outputlen = c_20.                    "20
          WHEN text-003.                                  "your lastfield
            ls_fcat-outputlen = c_255.                  "255
                "do nothing
        ENDCASE.
    *fixed column
        ls_fcat-fix_column = c_x.
    *changes to take effect
        MODIFY t_fieldcat FROM ls_fcat.
        IF sy-subrc = 0.
          "do nothing
        ENDIF.
        CLEAR ls_fcat.
      ENDLOOP.

Maybe you are looking for