ALV Grid Details Screen Editable

Hi All,
I have requirement to Edit the ALV grid.
ie I have ALV grid , after selecting (highlighting a line ), the user will go to the details screen, i need to be the details screen
should be editable. Please give info about this.
Thanks
aRs

My problem is if you put details screen also displayed in horizontal way. I need to display the fields in vertical order.and it should editable
If you press details icon the grid, you see the selected records displays like the following , but i need to editable
eg.
Number     :  XXXXXX
Desc        :   XXXXXXXXXXXXXXXXX
Name        :  XXXXXXXXXXXXXXXXX
Thanks
aRs

Similar Messages

  • ALV Grid without screens

    Hello experts,
    is it possible to implement ALV grid display (OO) without statements such as "call screen 100"?
    I have an example, logically everything should work but, unfortunatelly, nothing displays. Code:
    ZPROGRAM CODING ***
    REPORT ZTESTPROG.
    DATA: save_ok LIKE sy-ucomm,
          ok_code LIKE sy-ucomm,
          it_spfli TYPE TABLE OF spfli WITH HEADER LINE.
    DATA: G_CUSTOM_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          GRID1  TYPE REF TO CL_GUI_ALV_GRID,
          it_cat TYPE LVC_T_FCAT,
          wa_cat TYPE LVC_S_FCAT.
    START-OF-SELECTION.
      SELECT * FROM spfli
               INTO TABLE it_spfli.
      perform INITIAL_GRID.
    form INITIAL_GRID.
      PERFORM create_field_catalog.
      PERFORM create_grid_control.
    endform.                 " INITIAL_GRID  OUTPUT
    FORM create_field_catalog .
      IF it_cat[] is initial.
        clear wa_cat.
        wa_cat-col_pos   = 1.
        wa_cat-fieldname = 'CARRID'.
        wa_cat-datatype  = 'CHAR'.
        wa_cat-inttype   = 'C'.
        wa_cat-intlen    = 3.
        wa_cat-reptext   = 'Airline Code'.
        wa_cat-coltext   = 'Airline Code'.
        append wa_cat to it_cat.
        clear wa_cat.
        wa_cat-col_pos   = 2.
        wa_cat-fieldname = 'CONNID'.
        wa_cat-datatype  = 'NUMC'.
        wa_cat-inttype   = 'N'.
        wa_cat-intlen    = 4.
        wa_cat-reptext   = 'Flight Conn. No'.
        wa_cat-coltext   = 'Flight Conn. No'.
        append wa_cat to it_cat.
        clear wa_cat.
        wa_cat-col_pos   = 3.
        wa_cat-fieldname = 'CITYFROM'.
        wa_cat-datatype  = 'CHAR'.
        wa_cat-inttype   = 'C'.
        wa_cat-intlen    = 20.
        wa_cat-reptext   = 'Dep. city'.
        wa_cat-coltext   = 'Dep. city'.
        append wa_cat to it_cat.
        clear wa_cat.
        wa_cat-col_pos   = 4.
        wa_cat-fieldname = 'AIRPFROM'.
        wa_cat-datatype  = 'CHAR'.
        wa_cat-inttype   = 'C'.
        wa_cat-intlen    = 3.
        wa_cat-reptext   = 'Dep. airport'.
        wa_cat-coltext   = 'Dep. airport'.
        append wa_cat to it_cat.
        clear wa_cat.
        wa_cat-col_pos   = 5.
        wa_cat-fieldname = 'CITYTO'.
        wa_cat-datatype  = 'CHAR'.
        wa_cat-inttype   = 'C'.
        wa_cat-intlen    = 20.
        wa_cat-reptext   = 'Arrival city'.
        wa_cat-coltext   = 'Arrival city'.
        append wa_cat to it_cat.
        clear wa_cat.
        wa_cat-col_pos   = 6.
        wa_cat-fieldname = 'AIRPTO'.
        wa_cat-datatype  = 'CHAR'.
        wa_cat-inttype   = 'C'.
        wa_cat-intlen    = 3.
        wa_cat-reptext   = 'Dest. airport'.
        wa_cat-coltext   = 'Dest. airport'.
        append wa_cat to it_cat.
      ENDIF.
    ENDFORM.                    " create_field_catalog
    *&      Form  create_grid_control
          text
    -->  p1        text
    <--  p2        text
    FORM create_grid_control .
      IF G_CUSTOM_CONTAINER1 is initial .
        CREATE OBJECT G_CUSTOM_CONTAINER1
               EXPORTING CONTAINER_NAME = 'CUSTOM1'.
        CREATE OBJECT GRID1
               EXPORTING I_PARENT = G_CUSTOM_CONTAINER1.
        CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
         EXPORTING
           I_BUFFER_ACTIVE               =
           I_BYPASSING_BUFFER            =
           I_CONSISTENCY_CHECK           =
           I_STRUCTURE_NAME              =
           IS_VARIANT                    =
           I_SAVE                        =
           I_DEFAULT                     = 'X'
           IS_LAYOUT                     =
           IS_PRINT                      =
           IT_SPECIAL_GROUPS             =
           IT_TOOLBAR_EXCLUDING          =
           IT_HYPERLINK                  =
           IT_ALV_GRAPHICS               =
           IT_EXCEPT_QINFO               =
           IR_SALV_ADAPTER               =
          CHANGING
            IT_OUTTAB                     = it_spfli[]
            IT_FIELDCATALOG               = it_cat[]
           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.
      ENDIF.
    ENDFORM.                    " create_grid_control
    In contrast, if you use function "Reuse_Alv_List_Display" it works without any screens.

    Hi
    If you wish to go with OO approach to ALV Grid you can use the CL_SALV class.
    Here you do not need to create the screen.
    TYPES: BEGIN OF ty_kna1,
            kunnr TYPE kunnr,
            name1 TYPE name1_gp,
            land1 TYPE land1_gp,
           END OF ty_kna1,
           ty_t_kna1 TYPE TABLE OF ty_kna1.
    DATA: t_kna1       TYPE TABLE OF ty_kna1,
          r_salv_table TYPE REF TO cl_salv_table,
          r_display    TYPE REF TO cl_salv_display_settings,
          r_columns    TYPE REF TO cl_salv_columns_table.
    START-OF-SELECTION.
    ** Fetch Data
      SELECT kunnr
             name1
             land1
        FROM kna1
        INTO TABLE t_kna1
        UP TO 25 ROWS.
      CALL METHOD cl_salv_table=>factory
    *  EXPORTING
    *    list_display   = if_salv_c_bool_sap=>true
    *    r_container    =
    *    container_name =
        IMPORTING
          r_salv_table   = r_salv_table
        CHANGING
          t_table        = t_kna1.
      r_columns = r_salv_table->get_columns( ).
      r_columns->set_optimize( ).
      r_display = r_salv_table->get_display_settings( ).
      r_display->set_striped_pattern( value = 'X' ).
      r_salv_table->display( ).
    Edited by: SAP LEARNER on Apr 6, 2011 4:56 PM

  • Problem with ALV Grid Display screen Back Button

    Dear Friends ,
    I have an ALV Grid Display,Here am facing a problem for my 'Back' button,i haven't defined any PF Status and is using the standard one.But after the Display when i press Back Button a blank Screen is appearing n then again i have to press back button to go to my Selection Screen.
    Please Suggest if i have to take care of something else.
    I want my Selection Screen when i press Back on my Display Screen.
    DATA:  IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
             I_BYPASSING_BUFFER          =
             I_BUFFER_ACTIVE             =
             I_INTERFACE_CHECK           = ' '
                 I_CALLBACK_PROGRAM          = 'ZRMMPD01A'
             I_CALLBACK_PF_STATUS_SET    = ' '
             I_CALLBACK_USER_COMMAND     = ' '
             I_CALLBACK_TOP_OF_PAGE      = ' '
             I_CALLBACK_HTML_TOP_OF_PAGE = ' '
             I_CALLBACK_HTML_END_OF_LIST = ' '
             I_STRUCTURE_NAME            =
             I_BACKGROUND_ID             = ' '
             I_GRID_TITLE                =
             I_GRID_SETTINGS             =
               IS_LAYOUT                     =  I_LAYOUT
               IT_FIELDCAT                 =  IT_FIELDCAT
             IT_EXCLUDING                =
             IT_SPECIAL_GROUPS           =
             IT_SORT                     =
             IT_FILTER                   =
             IS_SEL_HIDE                 =
             I_DEFAULT                   = 'X'
             I_SAVE                      = ' '
             IS_VARIANT                  =
             IT_EVENTS                   =
             IT_EVENT_EXIT               =
             IS_PRINT                    =
             IS_REPREP_ID                =
             I_SCREEN_START_COLUMN       = 0
             I_SCREEN_START_LINE         = 0
             I_SCREEN_END_COLUMN         = 0
             I_SCREEN_END_LINE           = 0
        IMPORTING
             E_EXIT_CAUSED_BY_CALLER     =
             ES_EXIT_CAUSED_BY_USER      =
             TABLES
                  T_OUTTAB                    = IT_FINAL
            EXCEPTIONS
                 PROGRAM_ERROR               = 1
                 OTHERS                      = 2
    Thanks and Regards,
    Ashwini

    Hi Vijay ,
    No i dont have any write statement in my proggram.
    Here it is
    REPORT ZRMMPD01A  NO STANDARD PAGE HEADING.
    TABLES : EQUI,SER03,MKPF,OBJK.
    TYPE-POOLS : SLIS.
    DATA  IT_EQUI LIKE EQUI OCCURS 0 WITH HEADER LINE.
    DATA  IT_OBJK LIKE OBJK OCCURS 0 WITH HEADER LINE..
    DATA  IT_SER03 LIKE SER03 OCCURS 0 WITH HEADER LINE.
    DATA  IT_MKPF LIKE MKPF OCCURS 0 WITH HEADER LINE .
    DATA : BEGIN OF IT_DISPLAY OCCURS 0,
                MATNR LIKE EQUI-MATNR,
                SERNR LIKE EQUI-SERNR,
                BWART LIKE SER03-BWART,
                WERK LIKE SER03-WERK,
                CHARGE LIKE SER03-CHARGE,
                LAGERORT LIKE SER03-LAGERORT,
                MBLNR LIKE SER03-MBLNR,
                MJAHR LIKE SER03-MJAHR,
                ZEILE LIKE SER03-ZEILE,
                BUDAT LIKE MKPF-BUDAT,
                BKTXT LIKE MKPF-BKTXT,
                USNAM LIKE MKPF-USNAM,
                XBLNR LIKE MKPF-XBLNR,
            END OF IT_DISPLAY.
    DATA : WA_DISPLAY LIKE IT_DISPLAY.
    DATA  IT_FINAL LIKE IT_DISPLAY OCCURS 0 WITH HEADER LINE.
    DATA  IT_TEMP LIKE IT_DISPLAY OCCURS 0 WITH HEADER LINE.
    DATA:  IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA :I_LAYOUT TYPE SLIS_LAYOUT_ALV,
          I_EVENTS TYPE SLIS_T_EVENT.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS : S_MATNR FOR EQUI-MATNR MATCHCODE OBJECT MCD,"OBLIGATORY
                    S_SERNR FOR EQUI-SERNR, "MATCHCODE OBJECT MCD OBLIGATORY
                    S_MBLNR FOR SER03-MBLNR MATCHCODE OBJECT MCD,
                    S_BWART FOR SER03-BWART MATCHCODE OBJECT MCD,
                    S_WERK FOR SER03-WERK MATCHCODE OBJECT MCD,
                    S_LAGET FOR SER03-LAGERORT MATCHCODE OBJECT MCD,
                    S_BUDAT FOR MKPF-BUDAT MATCHCODE OBJECT MCD,
                    S_XBLNR FOR MKPF-XBLNR MATCHCODE OBJECT MCD.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X',
                 R2 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN END OF BLOCK B2.
    START-OF-SELECTION.
    *Fetch Data.
      PERFORM GET_DATA.
    *Fill Display Fields.
      PERFORM FILL_TABLE.
    *Segregate data according to radio button selection.
      PERFORM SELECT_CONDITION.
    *Fill The Feild catalog.
      PERFORM FIELD_CATALOG.
    *Display Output.
      PERFORM OUTPUT_DISPLAY..
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA.
      SELECT * FROM EQUI INTO TABLE IT_EQUI
        WHERE MATNR IN S_MATNR
        AND SERNR IN S_SERNR.
      SELECT * FROM OBJK INTO TABLE IT_OBJK
      FOR ALL ENTRIES IN IT_EQUI
      WHERE EQUNR = IT_EQUI-EQUNR.
      SELECT * FROM SER03 INTO TABLE IT_SER03
      FOR ALL ENTRIES IN IT_OBJK
      WHERE OBKNR = IT_OBJK-OBKNR
      AND MBLNR IN S_MBLNR
      AND BWART IN S_BWART
      AND WERK IN S_WERK
      AND LAGERORT IN S_LAGET.
      SELECT * FROM MKPF INTO TABLE IT_MKPF
      FOR ALL ENTRIES IN IT_SER03
      WHERE MBLNR = IT_SER03-MBLNR
      AND BUDAT IN S_BUDAT
      AND XBLNR IN S_XBLNR.
    ENDFORM.                    " GET_DATA
    *&      Form  FILL_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_TABLE.
      LOOP AT IT_EQUI.
        LOOP AT IT_OBJK.
          IF IT_OBJK-EQUNR <> IT_EQUI-EQUNR.
            SKIP.
          ELSE.
            READ TABLE IT_SER03 WITH KEY OBKNR = IT_OBJK-OBKNR.
            IF SY-SUBRC = 0.
              WA_DISPLAY-MATNR = IT_EQUI-MATNR.
              WA_DISPLAY-SERNR = IT_EQUI-SERNR.
              WA_DISPLAY-BWART = IT_SER03-BWART.
              WA_DISPLAY-WERK = IT_SER03-WERK.
              WA_DISPLAY-CHARGE = IT_SER03-CHARGE.
              WA_DISPLAY-LAGERORT = IT_SER03-LAGERORT.
              WA_DISPLAY-MBLNR = IT_SER03-MBLNR.
              WA_DISPLAY-MJAHR = IT_SER03-MJAHR.
              WA_DISPLAY-ZEILE = IT_SER03-ZEILE.
             READ TABLE IT_MKPF WITH KEY MBLNR = IT_SER03-MBLNR.
              IF SY-SUBRC = 0.
                WA_DISPLAY-BUDAT = IT_MKPF-BUDAT.
                WA_DISPLAY-BKTXT = IT_MKPF-BKTXT.
                WA_DISPLAY-USNAM = IT_MKPF-USNAM.
                WA_DISPLAY-XBLNR = IT_MKPF-XBLNR.
              ENDIF.
            ENDIF.
          ENDIF.
          IF NOT WA_DISPLAY IS INITIAL.
            APPEND WA_DISPLAY TO IT_DISPLAY.
            CLEAR WA_DISPLAY.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    " FILL_TABLE
    *&      Form  FIELD_CATALOG
          text
    -->  p1        text
    <--  p2        text
    FORM FIELD_CATALOG.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'MATNR'.
      FIELDCAT-SELTEXT_M = 'Material Number'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'SERNR'.
      FIELDCAT-SELTEXT_M = 'Serial number'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'MBLNR'.
      FIELDCAT-SELTEXT_L = 'Number of material document'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'BWART'.
      FIELDCAT-SELTEXT_M = 'Movement type'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'WERK'.
      FIELDCAT-SELTEXT_M = 'Plant'.
      FIELDCAT-OUTPUTLEN =  5.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'CHARGE'.
      FIELDCAT-SELTEXT_M = 'Batch number'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'LAGERORT'.
      FIELDCAT-SELTEXT_M = 'Storage Location'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'MJAHR'.
      FIELDCAT-SELTEXT_M = 'Material doc. year'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'ZEILE'.
      FIELDCAT-SELTEXT_L = 'Item in material document'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'BUDAT'.
      FIELDCAT-SELTEXT_L = 'Posting date in the document'.
      FIELDCAT-OUTPUTLEN =  10.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'BKTXT'.
      FIELDCAT-SELTEXT_L = 'Document header text'.
      FIELDCAT-OUTPUTLEN =  25.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'USNAM'.
      FIELDCAT-SELTEXT_M = 'User name'.
      FIELDCAT-OUTPUTLEN =  15.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'XBLNR'.
      FIELDCAT-SELTEXT_L = 'Reference document number'.
      FIELDCAT-OUTPUTLEN =  25.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
    ENDFORM.                    " FIELD_CATALOG
    *&      Form  DISPLAY_OUTPUT
          text
    -->  p1        text
    <--  p2        text
    FORM OUTPUT_DISPLAY.
      IF R1 = 'X'.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
              I_CALLBACK_PROGRAM          = 'ZRMMPD01A'
              IS_LAYOUT                   =  I_LAYOUT
              IT_FIELDCAT                 = IT_FIELDCAT
          TABLES
              T_OUTTAB                    = IT_DISPLAY
            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.
        REFRESH IT_DISPLAY.
        CLEAR IT_DISPLAY.
      ELSEIF R2 = 'X'.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
                 I_CALLBACK_PROGRAM          = 'ZRMMPD01A'
                 IS_LAYOUT                     =  I_LAYOUT
                 IT_FIELDCAT                 =  IT_FIELDCAT
             TABLES
                  T_OUTTAB                    = IT_FINAL
            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.
        REFRESH IT_DISPLAY.
        CLEAR IT_DISPLAY.
      ENDIF.
    ENDFORM.                    " DISPLAY_OUTPUT
    *&      Form  SELECT_CONDITION
          text
    -->  p1        text
    <--  p2        text
    FORM SELECT_CONDITION.
      IF R2 = 'X'.
        CLEAR WA_DISPLAY.
        SORT IT_DISPLAY BY MATNR SERNR MBLNR ZEILE.
        DELETE ADJACENT DUPLICATES FROM IT_DISPLAY.
        LOOP AT IT_DISPLAY WHERE ZEILE = '0002'.
          READ TABLE IT_DISPLAY WITH KEY MATNR = IT_DISPLAY-MATNR
          SERNR = IT_DISPLAY-SERNR ZEILE = '0001'.
          IF SY-SUBRC = 0.
            DELETE IT_DISPLAY.
          ENDIF.
        ENDLOOP.
        SORT IT_DISPLAY BY MATNR SERNR BWART MBLNR.
        DELETE ADJACENT DUPLICATES FROM IT_DISPLAY.
        LOOP AT IT_DISPLAY.
          IF WA_DISPLAY IS INITIAL.
            WA_DISPLAY =  IT_DISPLAY.
          ENDIF.
          LOOP AT IT_DISPLAY WHERE MATNR = WA_DISPLAY-MATNR
          AND SERNR = WA_DISPLAY-SERNR.
            IF IT_DISPLAY-BUDAT > WA_DISPLAY-BUDAT.
              WA_DISPLAY = IT_DISPLAY.
            ELSE.
              DELETE IT_DISPLAY.
            ENDIF.
          ENDLOOP.
          APPEND WA_DISPLAY TO IT_TEMP.
          CLEAR WA_DISPLAY.
        ENDLOOP.
        DELETE ADJACENT DUPLICATES FROM IT_TEMP.
        IF NOT IT_TEMP[] IS INITIAL.
          IT_FINAL[] = IT_TEMP[].
        ENDIF.
      ENDIF.
    ENDFORM.                    " SELECT_CONDITION
    Regards,
    Ashwini

  • ALV grid case-sensitive edit field

    Hello,
    i've a editable field on a alv grid.
    The field is case-sensitive in the domain.
    But when i enter a field an click rturn, the letters get uppercase.
    What's the problem?
    Best regards,
    TomSd

    Hi,
    Add the attribute  lowercase = 'X'  while preapring field catalog for this field.
    Regards,
    Gopi.
    Reward points if helpfull.

  • Blank Line in an ALV Grid on screen

    Hello,
    I have added one ALV grid on a custom screen and appended it to the Opportunity Management transaction in CRM. The issue is that as soon as i toggle from display to change mode in the transaction, a blank line is itself appended to the ALV grid. I dont want this blank line. How do i suppress it? Can anyone help me with this.
    Rgds
    Priyanka

    Yes you are correct But then how do i take care of the toggle and the blank line that is appended on the ALV screen table at the time of toggle ... coz toggle is called as a standard method in the standard code and i dont wanna change that.
    Rgds
    Priyanka

  • ALV Grid and screen title using OO

    I've been searching thru documentation and this forum without any luck. I want to display a screen title in the location where the report name displays on a standard report, i.e., between the Menu Toolbar and the Application Toolbar. I am using OO ALV Grid. I found how to do it using function modules, there they set the layout field "gs_test-layo_title" but this field does not exist in OO layout. The field "grid_title" displays the title inside the grid display (not what I want) and the field "detailtitl" does not work either.
    Any help will be greatly appreciated.
    Thanks

    Hi Nicolas,  understand that the OO ALV Grid which you are referring to is implemented into a screen container.  This container does not really have anything to do with the screen title.  Only when using the full-screen grid(using the FM) do you have direct control of this title via the ALV tool.  If you simply want to set this title in the title bar, you can simply do this using the SET TITLE-BAR statement in the PBO of the screen.  Or you may even able to simply set the system variable(haven't tested this) again in the PBO of the screen.
    sy-title = 'This is my title'.
    Regards,
    Rich Heilman

  • ALV GRID ONE LINE EDIT

    Hi,
    I have a ALV grid where I have a column as a editable. Now the problem is ALV grid is displaying 2 rows and only first line should be editable. Any idea how to do.
    KK.

    Hi,
    1. * Type of final output table
    TYPES : BEGIN OF ty_output.
            INCLUDE STRUCTURE zjay_alv.
    For cell editing and displaying cell as push button
    TYPES : <b>cellstyles TYPE lvc_t_styl</b> ,
            END OF ty_output.
    data        itab2 TYPE STANDARD TABLE OF ty_output.
    2. w_layout-stylefname = 'CELLSTYLES' ."
    3. CLEAR : wa2, w_style.
        READ TABLE itab2 INTO wa2 index 2.
        IF sy-subrc EQ 0.
          w_style-fieldname = 'ERSDA'.
          w_style-style = cl_gui_alv_grid=>mc_style_disabled.
          REFRESH wa2-cellstyles.
          APPEND w_style TO wa2-cellstyles.
          MODIFY itab2 FROM wa2 TRANSPORTING cellstyles
          WHERE matnr = wa2-matnr.
        ENDIF.
    4.    CALL METHOD o_grid->set_table_for_first_display
          EXPORTING
          is_layout                     = w_layout
          CHANGING
          it_outtab                     = itab2
          it_fieldcatalog               = i_fieldcat.
    Kindly reward points by clicking the star on the left of reply,if it helps.

  • ALV Grid fields from editable to non-editable mode

    Hi,
    I am displaying my data through ALV Grid. In my grid the non-key fields are in editable mode.
    When I edit any of the editable fields and place the cursor on other field the field which I have edited should become disable(non-editable). Again if I want to edit the same field which is now in non-editable mode should again change to editable mode when the cursor is placed on it.
    Thanks & Regards,
    Adithya M.

    Hi Adithya,
    I am confused by your statement "place the cursor on other field the field which I have edited should become disable" -- are you stating that this is the requirement or what is currently happening with your program.  The way the edit fields should work by default is they are editable at all times unless you tell it otherwise. 
    If you are saying your requirement is to change the field to disabled once the field is edited (runtime change), first you want to handle the event on data changed then within your method of handling on data changed, you can disable the field from being edited by using cell styles and changing the value to disabled. 
    If you look at program BCALV_GRID_EDIT,
    You will find code where it disables the field for edit using Cell Style -- this will give you an idea how Cell Style controls editable fields and display fields:
            ls_cell-style  = cl_gui_alv_grid=>mc_style_enabled.
            ls_cell-maxlen = 4.
            ls_cell-fieldname = 'CARRNAME'.
            append ls_cell to gt_sflight-cell.
    This specific code will set the field disabled when the program is first exectued, in your case if you need to do this at run time, after someone edits the field, you need to implement handling the event on data changed, in the same program you will find:
    method handle_data_changed.                 
       perform data_changed using er_data_changed.
    endmethod.                     
    It is within this method that you can disable a field for editing.
    However, once it is disabled you will not get back into the handle_data_changed method.  I'm not sure I understand your statement "Again if I want to edit the same field which is now in non-editable mode should again change to editable mode when the cursor is placed on it."  Why would you want the user to be able to edit something, then show it disabled, then let them click on it and edit it again?  Why not just leave it in edit mode?  Maybe if I understand the requirement better, I can answer this portion of the question. 
    If this is based on security or changing from edit to display for the entire grid, you can run the same program mentioned above and click on the Change/Display button in the top left to see how it enables and disables the entire grid for editing.
    Cheers,
    Bonnie

  • ALV grid disply with edit columns in output

    Hi all,
      i am using   CALL METHOD MY_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    to display the output in alv format.there is  3 edit columns in output display.
       if i fill one field & then put 'ENTER' then other two fields of that row should be filled with the appropriate data from the program.still control should be in output display.
    which method i should use to go inside the program when i put 'ENTER' on any field of ALV output disply & how to use those methods inside the program.
    i need some materials regarding OOPS (class, method ) . now i want to put OOPS concept in alv display.
    correct answers will be rewarded.
    Thanks & regards

    Hi,
    Check,
    OOPS
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    ABAP Objects
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/35eaef9c-0b01-0010-dd8b-e3b0f9ed7ccb#section7 [original link is broken]
    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
    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
    <b>Reward if helpful.</b>

  • 2 alv grids in 1 screen with 2 different header

    Hi All,
    I have a requirement where in I need to display 2 alv grids in 1 screen and each has its own set of header information. If anybody has come across such a requirement then pls send the code. I can do this using BLOCKED list alv but I want to do in grids.
    Thanks in advance.
    Sutapa Sengupta

    thr u go with code..
    Code listing for: Z_011_ALV_GRID_EVENT
    Description: EXAMPLE OF ALV GRID CONTROL
    SCREEN 101 : FLOW LOGIC
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0101.
    MODULE GET_DATA.
    MODULE CREATE_OBJECTS.
    MODULE SHOW_ALV.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0101.
    MODULE POOL Z_011_ALV_GRID_EVENT
    PROGRAM Z_011_ALV_GRID_EVENT.
    CLASS CL_EVENT_HANDLER DEFINITION
    CLASS CL_EVENT_HANDLER DEFINITION.
    PUBLIC SECTION.
    METHODS: ON_DOUBLE_CLICK FOR EVENT
    DOUBLE_CLICK OF CL_GUI_ALV_GRID
    IMPORTING ES_ROW_NO E_COLUMN,
    ON_RIGHT_CLICK FOR EVENT
    RIGHT_CLICK OF CL_GUI_ALV_GRID.
    ENDCLASS. "CL_EVENT_HANDLER DEFINITION
    CLASS CL_EVENT_HANDLER IMPLEMENTATION
    CLASS CL_EVENT_HANDLER IMPLEMENTATION.
    METHOD ON_DOUBLE_CLICK.
    DATA: TEXT TYPE STRING,
    ES_ROW_STRING TYPE STRING.
    ES_ROW_STRING = ES_ROW_NO-ROW_ID.
    CONCATENATE 'ROW : ' ES_ROW_STRING 'COLUMN : '
    E_COLUMN-FIELDNAME INTO TEXT SEPARATED BY SPACE.
    MESSAGE TEXT TYPE 'I'.
    ENDMETHOD. "ON_DOUBLE_CLICK
    METHOD ON_RIGHT_CLICK.
    MESSAGE 'RIGHT MOUSE BUTTON HAS CLICKED !!!' TYPE 'I'.
    ENDMETHOD. "ON_RIGHT_CLICK
    ENDCLASS. "CL_EVENT_HANDLER IMPLEMENTATION
    INCLUDE PROGRAMS
    INCLUDE Z_011_ALV_GRID_EVENT_TOP. " Global Data
    INCLUDE Z_011_ALV_GRID_EVENT_O01. " PBO-Modules
    INCLUDE Z_011_ALV_GRID_EVENT_I01. " PAI-Modules
    INCLUDE Z_011_ALV_GRID_EVENT_F01. " FORM-Routines
    TOP INCLUDE Z_011_ALV_GRID_EVENT_TOP
    TYPES AND DATA DECLARATION
    TABLES: SFLIGHT.
    DATA: OK_CODE TYPE SY-UCOMM,
    IT_SFLIGHT TYPE STANDARD TABLE OF SFLIGHT,
    R_HANDLER TYPE REF TO CL_EVENT_HANDLER,
    R_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
    R_GRID TYPE REF TO CL_GUI_ALV_GRID.
    PBO INCLUDE Z_011_ALV_GRID_EVENT_O01
    Module SHOW_ALV OUTPUT
    MODULE SHOW_ALV OUTPUT.
    CHECK OK_CODE IS INITIAL.
    CALL METHOD R_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_STRUCTURE_NAME = 'SFLIGHT'
    CHANGING
    IT_OUTTAB = IT_SFLIGHT.
    ENDMODULE. " SHOW_ALV OUTPUT
    Module GET_DATA OUTPUT
    MODULE GET_DATA OUTPUT.
    CHECK OK_CODE IS INITIAL.
    PERFORM GET_DATA
    USING
    SFLIGHT-CARRID.
    ENDMODULE. " GET_DATA OUTPUT
    Module CREATE_OBJECTS OUTPUT
    MODULE CREATE_OBJECTS OUTPUT.
    IF R_HANDLER IS NOT BOUND. "CHECKS WHETHER A REFERENCE
    "VARIABLE CONTAINS VALID REFERENCE
    CREATE OBJECT R_HANDLER.
    ENDIF.
    IF R_CONTAINER IS NOT BOUND. "CHECKS WHETHER A REFERENCE
    "VARIABLE CONTAINS VALID REFERENCE
    CREATE OBJECT R_CONTAINER
    EXPORTING
    CONTAINER_NAME = 'CC_ALV'.
    ENDIF.
    IF R_GRID IS NOT BOUND.
    CREATE OBJECT R_GRID
    EXPORTING
    I_PARENT = R_CONTAINER.
    SET HANDLER R_HANDLER->ON_DOUBLE_CLICK
    R_HANDLER->ON_RIGHT_CLICK FOR ALL INSTANCES
    ENDIF.
    ENDMODULE. " CREATE_OBJECTS OUTPUT
    Module STATUS_0101 OUTPUT
    MODULE STATUS_0101 OUTPUT.
    SET PF-STATUS 'Z_010_STATUS'.
    "SET TITLEBAR 'xxx'.
    ENDMODULE. " STATUS_0101 OUTPUT
    PAI INCLUDE Z_011_ALV_GRID_EVENT_I01
    Module USER_COMMAND_0101 INPUT
    MODULE USER_COMMAND_0101 INPUT.
    CASE OK_CODE .
    WHEN 'SEARCH'.
    PERFORM GET_DATA
    USING
    SFLIGHT-CARRID.
    CALL METHOD R_GRID->REFRESH_TABLE_DISPLAY.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0101 INPUT
    FORM INCLUDE Z_011_ALV_GRID_EVENT_F01
    FORM : GET_DATA
    Created : 26.03.2008 12:34:09
    FORM GET_DATA USING VALUE(P_CARRID) TYPE SFLIGHT-CARRID.
    IF P_CARRID IS INITIAL.
    SELECT * FROM SFLIGHT INTO CORRESPONDING
    FIELDS OF TABLE IT_SFLIGHT.
    ELSE.
    SELECT * FROM SFLIGHT INTO CORRESPONDING
    FIELDS OF TABLE IT_SFLIGHT WHERE CARRID = P_CARRID.
    ENDIF.
    ENDFORM. "GET_DATA

  • ALV Grid Editable

    How to make the ALV grid data as editable ?
    Regards
    Badari

    In the field catalog, set the EDIT field to X for whichever field you want to be editable.
    Regards,
    Ravi
    Note : Please mark all the helpful answers

  • ALV Grid editable fields

    Hello,
    I got a dynpro with 3 ALV grids. I edit a value of grid 3, then I execute a pushbutton of grid 1. The value of grid 3 is resetted then.
    What should I do to keep the value?
    Reward points guaranteed.
    Regards
    René

    Sounds like the event handler method for event data_changed  is not being fired.  In one of my programs, I am registering the "ENTER" key, the user must hit enter after editing the field to fire the data_changed event. 
    * Set for first display
            call method alv_grid->set_table_for_first_display
                exporting
                     is_layout              = lt_layout
                     it_toolbar_excluding   = lt_exclude
                changing
                     it_outtab       = ialv[]
                     it_fieldcatalog = fieldcat[].
    * If cancelling points, register "ENTER" as event
    * and create the event receiver
    <b>          call method alv_grid->register_edit_event
                            exporting
                               i_event_id = cl_gui_alv_grid=>mc_evt_enter.</b>
    *   create Event Receiver
              create object event_receiver.
    *   handler for ALV grid
              set handler event_receiver->handle_data_changed for alv_grid.
    Do this records the changes that the user has made.  I believe that this must be done before you start the processing of the button on Grid1.
    Regards,
    Rich Heilman

  • Editing of the ALV grids

    hi Experts!!
    i am working in the editing of the ALV grids using objects..when we edit the alv i want the same to be update to the DB tables..i tryied most of the methods like GET_CEL_VALUES(this i m getting only cursor value)/ get_changed valuse and also demo perog BCALVEDIT_04 but its not working..i am not understanding how to code. plz suggest me on this that is there any good procedure which i can follwo,,plz replyem...

    Hi Mahesh,
    The major difference between editable and non-editable ALV Grid is "registering edit event".
    In your program you might not have registered your ALV Grid as editable.  You can try using below code for the same.
    Registering edit event
        call method w_grid->register_edit_event
          exporting
            i_event_id = cl_gui_alv_grid=>mc_evt_modified
          exceptions
            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.
    Note: w_grid is ref to cl_gui_alv_grid.
    Best Regards
    Ali S

  • ALV Grid display on SAP Module Pool

    Hi All,
    I need to create a module pool screen, which would have 2 different ALV's. The format of screen would be something like:
    Some I/Ofields
    ALV 1
    ALV 2
    How can I restrict the display of ALV data to the areas predefined on the screen?
    What type of component is required to be defined on module pool for restricting ALV to that particular area?
    or , while displaying ALV (i am using ALV FM's) is there any addition that is required?
    Regards-
    Harmeet.
    Edited by: Harmeet Singh on Jun 5, 2009 4:56 PM

    Hi,
    There are number of examples in net, SCN and wherever you look for.
    Basically what you need is:
    - a screen
    - your screen fields placed on top of this screen
    - custom control on this screen underneath your screen fields
    - in PBO module of that screen you need to create splitter container
    - by means of this splitter container you get two containers
    - in both you place your ALVs
    For details how to implement this please refer [Displaying two ALVs on the screen|http://sample-code-abap.blogspot.com/2008/06/displaying-two-alv-grid-on-screen.html].
    Note!
    In above example you have such coding:
       CREATE OBJECT ob_custom
          EXPORTING
            container_name = 'CONTAINER' .   "CONTAINER is the name of CUSTOM CONTROL placed on screen (as exlapained above)
    Alternatively you can use two custom controls for each ALV separately. This will ensure that they have fixed position on screen (size too). Using splitter container as in the example it is, however, more flexible as you hold two alvs in one container and have nice splitter, which you can drag and rezise ALVs vertically. Custom container remains unchanged and is fixed on screen. It also defines boundaries of your ALVs (we can call it an area)
    I don't think you can achieve this using standard FMs, so you must use this OO aproach.
    Regards
    Marcin

  • Display only cell in ALV Grid in OO

    Hi Folks,
    Hope someone can help me with this little issue.  I have a series of columns in my ALV grid that are editable, but I need to a) make some of the cells on specific lines uneditable and b) display time based fields on this line as blank (presently they shoe 00:00:00). 
    For problem a) I have set the layout style frame as 'cellstyles' 
        es_layout-stylefname = 'CELLSTYLES'.
    I have also set the edit flag in the field catalog for the individual columns to 'X' eg     
         WHEN 'CUSTTS_DATE_N'.
              ls_fieldcat-edit = 'X'.
    And coded:
           gwa_stylerow-fieldname = 'CUSTTS_DATE_N'.
          gwa_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
          APPEND gwa_stylerow TO gt_stylerow.
          wa_delivery_list-cellstyle[] = gt_stylerow[].
          APPEND wa_delivery_list TO it_delivery_list.
    Yet, the ALV cells are still being displayed as editable.  Can't for the life of me figure out what's missing.  The only other thought I had around this is that the wa_delivery_list-cellstyle table is being set in the data extraction code, before the ALV grid is built, and that the cell formats are being overwritten/on not being called by the field catalog entries.  Any thoughts on how to make these fields/cells display only when the ALV is first displayed would be greatly appreciated.
    As for option b) I'm clueless, as the cell style commands are not being picked up (see problem a.).  Again any thoughts would be appreciated, and points will be rewarded for solutions/suggestions that lead to solutions.
    Cheers,
    Stephen Keam

    Hello Stephen
    I have created a simple report ZUS_SDN_ALV_EDITABLE_1B which shows how to use editability on cell level.
    The crucial parts of the coding for your requirements are shown below, followed by the entire report.
      READ TABLE gt_fcat INTO ls_fcat
           WITH KEY fieldname = 'UPTIM'.
      IF ( syst-subrc = 0 ).
        DELETE gt_fcat INDEX syst-tabix.
        ls_fcat-no_zero = abap_true.  " suppresses 00:00:00
        INSERT ls_fcat INTO gt_fcat INDEX 7.
      ENDIF.
    *&      Form  SET_CELL_EDITABLE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_cell_editable .
    * define local data
      DATA: ld_idx      TYPE i,
            ls_outtab   TYPE ty_s_outtab,
            ls_style    TYPE lvc_s_styl.
      LOOP AT gt_outtab INTO ls_outtab.
        ld_idx = syst-tabix.
        REFRESH: ls_outtab-celltab.
        " NOTE: if you change the year of column ERDAT to 2008 then two columns will become non-editable
        IF ( ls_outtab-erdat+0(4) = '2008' ).
          CLEAR: ls_style.
          ls_style-fieldname = 'UPDAT'.
          ls_style-style     = cl_gui_alv_grid=>mc_style_disabled.
          INSERT ls_style INTO TABLE ls_outtab-celltab.
          CLEAR: ls_style.
          ls_style-fieldname = 'UPTIM'.
          ls_style-style     = cl_gui_alv_grid=>mc_style_disabled.
          INSERT ls_style INTO TABLE ls_outtab-celltab.
        ELSE.
        ENDIF.
        MODIFY gt_outtab FROM ls_outtab INDEX ld_idx
          TRANSPORTING celltab.
      ENDLOOP.
    ENDFORM.                    " SET_CELL_EDITABLE
    *& Report  ZUS_SDN_ALV_EDITABLE
    *& Thread: Display only cell in ALV Grid in OO
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="765083"></a>
    * Flow logic of screen '100' (no elements, ok-code => gd_okcode ):
    **PROCESS BEFORE OUTPUT.
    **  MODULE STATUS_0100.
    **PROCESS AFTER INPUT.
    **  MODULE USER_COMMAND_0100.
    *& GUI-Status: ok-codes BACK, EXIT, CANC
    REPORT  zus_sdn_alv_editable_1b.
    TYPE-POOLS: abap.
    CONSTANTS:
      gc_tabname       TYPE tabname  VALUE 'KNB1'.
    TYPES: BEGIN OF ty_s_outtab.
    INCLUDE TYPE knb1 AS knb1.
    TYPES: celltab    TYPE lvc_t_styl.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab    TYPE STANDARD TABLE OF ty_s_outtab
                          WITH DEFAULT KEY.
    DATA:
      gd_okcode        TYPE ui_func,
      gd_repid         TYPE syst-repid,
      gt_fcat          TYPE lvc_t_fcat,
      gs_layout        TYPE lvc_s_layo,
      gs_variant       TYPE disvariant,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_grid          TYPE REF TO cl_gui_alv_grid.
    DATA:
      gs_outtab        TYPE ty_s_outtab,
      gt_outtab        TYPE ty_t_outtab,
      gt_outtab_pbo    TYPE ty_t_outtab.
    DATA:
      gd_answer        TYPE c.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler  DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_data_changed
             FOR EVENT data_changed OF cl_gui_alv_grid
                 IMPORTING er_data_changed.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_data_changed.
        " Just trigger PAI followed by PBO
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = 'REFRESH'
    *        IMPORTING
    *          rc       =
      ENDMETHOD.                    "handle_data_changed
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT * FROM  (gc_tabname) INTO CORRESPONDING FIELDS
                                  OF TABLE gt_outtab UP TO 99 ROWS.
      gt_outtab_pbo = gt_outtab.  " set PBO data
      PERFORM init_controls.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    END-OF-SELECTION.
    *&      Form  INIT_CONTROLS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          OTHERS = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid
        EXPORTING
          i_parent = go_docking
        EXCEPTIONS
          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.
      " NOTE: not required
    *  set handler:
    *    lcl_eventhandler=>handle_data_changed for go_grid.
    * Build fieldcatalog and set hotspot for field KUNNR
      PERFORM build_fieldcatalog.
      PERFORM set_layout_and_variant.
      PERFORM set_cell_editable.
    *§3.Optionally register ENTER to raise event DATA_CHANGED.
    *   (Per default the user may check data by using the check icon).
      CALL METHOD go_grid->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_enter.
      SET HANDLER: lcl_eventhandler=>handle_data_changed FOR go_grid.
    * Display data
      CALL METHOD go_grid->set_table_for_first_display
        EXPORTING
          is_layout       = gs_layout
          is_variant      = gs_variant
          i_save          = 'A'
        CHANGING
          it_outtab       = gt_outtab
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          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.
    * NOTE:
    * Documenation of I_SAVE ("An Easy Reference for ALV Grid Control")
    *I_SAVE
    *Determines the options available to the user for saving a layout:
    *? 'X': global saving only
    *? 'U': user-specific saving only
    *? 'A': corresponds to 'X' and 'U'
    *? SPACE: no saving
    * Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          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.
    ENDFORM.                    " INIT_CONTROLS
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      " NOTE: retrieve changed data from frontend (grid control) into
      "       the backend (itab in ABAP)
      go_grid->check_changed_data( ).
      CASE gd_okcode.
        WHEN 'BACK'  OR
             'EXIT'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'REFRESH'.
          PERFORM set_cell_editable.
          " NOTE: Refresh required
          CALL METHOD go_grid->refresh_table_display
    *        EXPORTING
    *          is_stable      =
    *          i_soft_refresh =
    *        EXCEPTIONS
    *          finished       = 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.
        WHEN 'SAVE'.
          IF ( gt_outtab = gt_outtab_pbo ).
            MESSAGE 'No data changed' TYPE 'S'.
          ELSE.
            CLEAR: gd_answer.
            CALL FUNCTION 'POPUP_TO_CONFIRM'
              EXPORTING
    *             TITLEBAR                    = ' '
    *             DIAGNOSE_OBJECT             = ' '
                text_question               = 'Save data?'
    *             TEXT_BUTTON_1               = 'Ja'(001)
    *             ICON_BUTTON_1               = ' '
    *             TEXT_BUTTON_2               = 'Nein'(002)
    *             ICON_BUTTON_2               = ' '
    *             DEFAULT_BUTTON              = '1'
    *             DISPLAY_CANCEL_BUTTON       = 'X'
    *             USERDEFINED_F1_HELP         = ' '
    *             START_COLUMN                = 25
    *             START_ROW                   = 6
    *             POPUP_TYPE                  =
    *             IV_QUICKINFO_BUTTON_1       = ' '
    *             IV_QUICKINFO_BUTTON_2       = ' '
              IMPORTING
                answer                      = gd_answer
    *           TABLES
    *             PARAMETER                   =
              EXCEPTIONS
                text_not_found              = 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.
            IF ( gd_answer = '1' ).  " yes
              MESSAGE 'Data successfully saved' TYPE 'S'.
              gt_outtab_pbo = gt_outtab.  " update PBO data !!!
            ELSE.
              MESSAGE 'Action cancelled by user'  TYPE 'S'.
            ENDIF.
          ENDIF.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_FIELDCATALOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = gc_tabname
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ls_fcat-edit = abap_true.
      MODIFY gt_fcat FROM ls_fcat
          TRANSPORTING edit
        WHERE ( key NE abap_true ).
      READ TABLE gt_fcat INTO ls_fcat
           WITH KEY fieldname = 'UPTIM'.
      IF ( syst-subrc = 0 ).
        DELETE gt_fcat INDEX syst-tabix.
        ls_fcat-no_zero = abap_true.  " suppresses 00:00:00
        INSERT ls_fcat INTO gt_fcat INDEX 7.
      ENDIF.
      READ TABLE gt_fcat INTO ls_fcat
       WITH KEY fieldname = 'UPDAT'.
      IF ( syst-subrc = 0 ).
        DELETE gt_fcat INDEX syst-tabix.
        INSERT ls_fcat INTO gt_fcat INDEX 7.
      ENDIF.
      LOOP AT gt_fcat INTO ls_fcat.
        ls_fcat-col_pos = syst-tabix.
        MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
        IF ( syst-tabix > 10 ).
          DELETE gt_fcat INDEX syst-tabix.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  SET_LAYOUT_AND_VARIANT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_layout_and_variant .
      CLEAR: gs_layout,
             gs_variant.
      gs_layout-cwidth_opt = abap_true.
      gs_layout-zebra      = abap_true.
    *§3.Provide the fieldname of the celltab field by using field
    *   STYLEFNAME of the layout structure.
      gs_layout-stylefname = 'CELLTAB'.
      gs_variant-report = syst-repid.
      gs_variant-handle = 'GRID'.
    ENDFORM.                    " SET_LAYOUT_AND_VARIANT
    *&      Form  SET_CELL_EDITABLE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_cell_editable .
    * define local data
      DATA: ld_idx      TYPE i,
            ls_outtab   TYPE ty_s_outtab,
            ls_style    TYPE lvc_s_styl.
      LOOP AT gt_outtab INTO ls_outtab.
        ld_idx = syst-tabix.
        REFRESH: ls_outtab-celltab.
        IF ( ls_outtab-erdat+0(4) = '2008' ).
          CLEAR: ls_style.
          ls_style-fieldname = 'UPDAT'.
          ls_style-style     = cl_gui_alv_grid=>mc_style_disabled.
          INSERT ls_style INTO TABLE ls_outtab-celltab.
          CLEAR: ls_style.
          ls_style-fieldname = 'UPTIM'.
          ls_style-style     = cl_gui_alv_grid=>mc_style_disabled.
          INSERT ls_style INTO TABLE ls_outtab-celltab.
        ELSE.
        ENDIF.
        MODIFY gt_outtab FROM ls_outtab INDEX ld_idx
          TRANSPORTING celltab.
      ENDLOOP.
    ENDFORM.                    " SET_CELL_EDITABLE
    Regards
      Uwe

Maybe you are looking for

  • HP Laserjet P4010 Problems!

    The HP Laserjet P4010 at my office is having problems, When we try to print something, the printer goes and sounds like its printing but does not grab the paper from the tray, and the display reads "Paper Jam" when there is no paper jam what so ever.

  • Permissions issues - Adobe CC programs

    Hi,      I have been having continuous problems with the new Adobe CC programs, and after many times of running Adobe's cleaner tools, reinstalling and following the suggestions laid out by Adobe and the forums with no success  - I am am going to try

  • How can I open Camera RAW for Nikon D7100 with CC?

    Downloaded the trial version of Photoshop CC 2014 yesterday but it could not open the RAW file created by my newly purchased Nikon D7100. Please help. Regards

  • Baggage Files not displaying in Project Mgr

    I want to add a few Word documents into the Baggage Files. I have done this before without a problem. From the Project Manager I right click on the Main Baggage File icon and select Add New Baggage File. I then locate my Word document, select it and

  • Send To Attachment Properties

    When the Send To link is used within the portal it provides an attachment with a link such as... https://servername/irj/servlet/prt/portal/prtroot/com.sap.km.cm.navigation/FolderA/FolderB/FolderC?StartUri=/FolderA/FolderB/FolderC Which when opened sh