TO enable the menu button in ALV Grid Display

Hi Mates,
I have a peculiar problem while doing ALV Grid display for screens.
In the main Screen i have Three coloumns.The 1st coloum will interacted
next screen 101 and 2nd coloum will interacted to screen 102.
Now the problem is in the menu of ALV Grid display,the Total button was enabled for screen
101 and same button is disabled in screen 102.
But the code semms to be fine .
Below i have pasted the code and please have a look and help to come out of this cris.
My Code  :
FORM CREATE_ALV_GRID USING R_SCREEN.
  DATA: LS_LAYOUT TYPE LVC_S_LAYO,
  ITAB_FUNCTIONS     TYPE UI_FUNCTIONS.   "MHTK903257(+)(add)
  CASE R_SCREEN.
*--> SCREEN 9000
    WHEN C_SCREEN_9000.
*-- Build the field catalog for the ALV grid.
      PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_9000
                                  USING:
*ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_OVERVIEW' 'WADAT'     'Due date'(004)  'X' 'D' ' ' ' ' ' ' 'C100',
*'ITAB_OVERVIEW' 'HU_UNLOAD' 'Unloaded HU'(005) 'X' 'I' '15' ' ' ' ' 'C500',  "MHTK903257(-)
'ITAB_OVERVIEW' 'TOT_TO'    'Total TO'(006)   'X' 'I' ' '  ' ' ' ' 'C30',
GMTK901103: REMOVE HOTSPOT ON ESTIMATED TO:
'ITAB_OVERVIEW' 'EST_TO'    'Estim TO'(030)    ' ' 'I' ' '  ' ' ' ' 'C500'.
      LOOP AT ITAB_INB_LOC WHERE OUTPUT = 'X'.
            PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_9000
                                    USING:
   ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
        'ITAB_OVERVIEW' ITAB_INB_LOC-FIELDNAME
        ITAB_INB_LOC-Z_INBND_LOC 'X' '' ' ' ' ' 'R' 'C500'.  "MHTK903418
        ENDLOOP.
      LOOP AT ITAB_STORAGE_TYPE WHERE OUTPUT = 'X'.
        PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_9000
                                    USING:
*ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_OVERVIEW' ITAB_STORAGE_TYPE-FIELDNAME
  ITAB_STORAGE_TYPE-LGTYP 'X' 'I' ' ' ' ' 'R' 'C500'.
      ENDLOOP.
*-- Create the ALV grid object.
      CREATE OBJECT PT_ALV_1000
        EXPORTING
          I_PARENT  = PT_DOCK_1000.
      PERFORM EXCLUDE_FUNCTIONS TABLES ITAB_FUNCTIONS   "MHTK903257(+)(add)
                                USING  R_SCREEN.
*-- Get the title of the ALV grid.
      PERFORM GET_ALV_GRID_TITLE USING    C_SCREEN_1000
                                 CHANGING LS_LAYOUT-GRID_TITLE.
*-- Display the ALV grid.
      CALL METHOD PT_ALV_1000->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IS_LAYOUT       = LS_LAYOUT
          IT_TOOLBAR_EXCLUDING = ITAB_FUNCTIONS
        CHANGING
          IT_OUTTAB       = ITAB_OVERVIEW
          IT_FIELDCATALOG = ITAB_FIELDCAT_9000.
*--> SCREEN 9100
    WHEN C_SCREEN_1100.
*-- Build the field catalog for the ALV grid.
      PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1100
                                  USING:
*ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_DETIAL' 'WAUHR'     'Due time'(007)  ' ' 'T' ' ' 'X' ' ' 'C100',
'ITAB_DETAIL' 'TOT_TO'    'Total TO'(006)   'X' 'I' ' '  ' ' ' ' 'C30',
'ITAB_DETAIL' 'EST_TO'    'Estim TO'(030)   ' ' 'I' ' '  ' ' ' ' 'C500'.
   CLEAR ITAB_INB_LOC.
    LOOP AT ITAB_INB_LOC WHERE SELECTED = 'X'.
         CHECK SY-SUBRC EQ 0.
            PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1100
                                    USING:
   ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
        'ITAB_DETAIL' ITAB_INB_LOC-FIELDNAME
        ITAB_INB_LOC-Z_INBND_LOC '' '' ' ' ' ' 'R' 'C500'.
     ENDLOOP.
     CLEAR: ITAB_STORAGE_TYPE.
      LOOP AT ITAB_STORAGE_TYPE WHERE SELECTED = 'X'.
        CHECK SY-SUBRC EQ 0.
        PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1100
                                    USING:
*ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_DETAIL' ITAB_STORAGE_TYPE-FIELDNAME
  ITAB_STORAGE_TYPE-LGTYP 'X' 'I' ' ' ' ' 'R' 'C500'.
      ENDLOOP.
*-- Create the ALV grid object.
      CREATE OBJECT PT_ALV_1100
        EXPORTING
          I_PARENT  = PT_DOCK_1100.
      PERFORM EXCLUDE_FUNCTIONS TABLES ITAB_FUNCTIONS   "MHTK903257(+)(add)
                                USING  R_SCREEN.
*-- Get the title of the ALV grid.
      PERFORM GET_ALV_GRID_TITLE USING    C_SCREEN_1100
                                 CHANGING LS_LAYOUT-GRID_TITLE.
*-- Display the ALV grid.
      CALL METHOD PT_ALV_1100->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IS_LAYOUT       = LS_LAYOUT
          IT_TOOLBAR_EXCLUDING = ITAB_FUNCTIONS
        CHANGING
          IT_OUTTAB       = ITAB_DETAIL
          IT_FIELDCATALOG = ITAB_FIELDCAT_1100.
screen 1300 TO detail.
*--> SCREEN 9300
    WHEN C_SCREEN_1300.
*-- Build the field catalog for the ALV grid.
      PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1300
                                  USING:
*ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_TO2' 'TANUM' 'TO'(020)  ' '   'C' ' ' ' ' ' ' 'C100',
'ITAB_TO2' 'NLPLA' 'Location'(021) ' '   'C' ' '  ' ' ' ' 'C500',
'ITAB_TO2' 'LETY1' 'SUT'(013)  ' ' 'C'  ' ' ' ' ' ' 'C500',
'ITAB_TO2' 'MATNR' 'Material'(016) ' '  'C' ' '  ' ' ' ' 'C500',
'ITAB_TO2' 'NSOLM' 'Quantity'(017) ' ' 'I' ' '  ' ' ' ' 'C500',
'ITAB_TO2' 'NLTYP' 'Storage type'(014) ' ' '' ' '  ' ' ' ' 'C500'.  "MHTK903257(-)
*'ITAB_TO2' 'POSNR' 'Line'(015) ' ' 'C' ' ' ' ' ' ' 'C500'.       "MHTK903257(-)
*-- Create the ALV grid object.
      CREATE OBJECT PT_ALV_1300
        EXPORTING
          I_PARENT  = PT_DOCK_1300.
*-- Exclude the non-applicable functions from the ALV grid.
      PERFORM EXCLUDE_FUNCTIONS TABLES ITAB_FUNCTIONS
                                USING  R_SCREEN.
*-- Get the title of the ALV grid.
      PERFORM GET_ALV_GRID_TITLE USING    C_SCREEN_1300
                                 CHANGING LS_LAYOUT-GRID_TITLE.
      SORT ITAB_TO2 BY TANUM VBELN POSNR.
*-- Display the ALV grid.
      CALL METHOD PT_ALV_1300->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IS_LAYOUT       = LS_LAYOUT
          IT_TOOLBAR_EXCLUDING = ITAB_FUNCTIONS
        CHANGING
          IT_OUTTAB       = ITAB_TO2
          IT_FIELDCATALOG = ITAB_FIELDCAT_1300.
screen 9400 Pre Processing detail.
*--> SCREEN 9400
    WHEN C_SCREEN_9400.          "MHTK903418(BEgin Of change)
*-- Build the field catalog for the ALV grid.
      PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1400
                                  USING:
*ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_PRE_PROC2' 'Z_PRE_PROC' 'Pre Processing Number'(030)  ' '   'C' ' ' ' ' ' ' 'C100',
'ITAB_PRE_PROC2' 'Z_PRE_PROC_LN' 'Pre Processing Number'(035) ' '   'C' ' '  ' ' ' ' 'C100',
'ITAB_PRE_PROC2' 'MATNR' 'Material'(035) ' '   'C' ' '  ' ' ' ' 'C500',
'ITAB_PRE_PROC2' 'Z_PSH_QTY' 'Quantity'(035) ' '   'C' ' '  ' ' ' ' 'C500'.
*'ITAB_TO2' 'MATNR' 'Material'(016) ' '  'C' ' '  ' ' ' ' 'C500',
*'ITAB_TO2' 'NSOLM' 'Quantity'(017) ' ' 'I' ' '  ' ' ' ' 'C500',
*'ITAB_TO2' 'NLTYP' 'Storage type'(014) ' ' '' ' '  ' ' ' ' 'C500'.  "MHTK903257(-)
**'ITAB_TO2' 'POSNR' 'Line'(015) ' ' 'C' ' ' ' ' ' ' 'C500'.       "MHTK903257(-)
*-- Create the ALV grid object.
      CREATE OBJECT PT_ALV_1400
        EXPORTING
          I_PARENT  = PT_DOCK_1400.
*-- Exclude the non-applicable functions from the ALV grid.
      PERFORM EXCLUDE_FUNCTIONS TABLES ITAB_FUNCTIONS
                                USING  R_SCREEN.
*-- Get the title of the ALV grid.
      PERFORM GET_ALV_GRID_TITLE USING    C_SCREEN_1400
                                 CHANGING LS_LAYOUT-GRID_TITLE.
      SORT ITAB_PRE_PROC2 BY Z_PRE_PROC.
*-- Display the ALV grid.
      CALL METHOD PT_ALV_1400->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IS_LAYOUT       = LS_LAYOUT
          IT_TOOLBAR_EXCLUDING = ITAB_FUNCTIONS
        CHANGING
          IT_OUTTAB       = ITAB_PRE_PROC2
          IT_FIELDCATALOG = ITAB_FIELDCAT_1400.  "MHTK903418(End of change)
  ENDCASE.

Hi
U copy from standard program and paste ur report ...It will work..'
Regards:
Prabu

Similar Messages

  • How to capture the checkbox status in ALV Grid display

    I need some immediate help regarding Grid ALV.
    My Requirement: I need to display an ALV grid report along with checkboxes. Further, I need to provide an option wherein the user can checkboxes and select the records that I need to process further (by clicking the process button on the ALV Report).
    My Query: The problem here is that I am not able to capture the status of the checkboxes. This means that I am not able to capture which of the records have been selected by checking their resp checkboxes.
    Solutions that I have tried: I have tried capturing the same at user command by checking the value in slis_selfield. But all the records show the value as 1 for the checkbox field.
    Kinldy suggest how to go about it.
    I am not using Object Oriented ALV. Please suggest something to be used in ALV Grid display in 4.6C version.
    Regards,
    Namrata

    Here is a Sample code , it might help you
    TABLES : sflight.
    TYPE-POOLS: slis.
    DATA : w_repid LIKE sy-repid.
    w_repid = sy-repid.
    DATA: BEGIN OF it_sflight OCCURS 0,
      checkbox(1),
      carrid LIKE sflight-carrid,
    END OF it_sflight.
    *layout
    DATA: wa_layout TYPE slis_layout_alv.
    *field catalog
    DATA: it_fieldcatalog TYPE slis_t_fieldcat_alv,
              wa_fieldcatalog TYPE slis_fieldcat_alv.
    START-OF-SELECTION.
      SELECT carrid FROM sflight
         INTO CORRESPONDING FIELDS OF TABLE it_sflight.
    END-OF-SELECTION.
      CLEAR it_fieldcatalog.
      REFRESH it_fieldcatalog.
      wa_fieldcatalog-fieldname = 'CHECKBOX'.
      wa_fieldcatalog-outputlen = '3'.
      wa_fieldcatalog-col_pos = '1'.
      wa_fieldcatalog-seltext_m = 'Chk'.
      wa_fieldcatalog-checkbox = 'X'.
      wa_fieldcatalog-edit = 'X'.
      APPEND wa_fieldcatalog TO it_fieldcatalog.
      CLEAR wa_fieldcatalog.
      wa_fieldcatalog-fieldname = 'CARRID'.
      wa_fieldcatalog-outputlen = '10'.
      wa_fieldcatalog-col_pos = '2'.
      wa_fieldcatalog-seltext_m = 'Carrid'.
      APPEND wa_fieldcatalog TO it_fieldcatalog.
      CLEAR wa_fieldcatalog.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = w_repid
          is_layout = wa_layout
          i_callback_user_command = 'USER_COMMAND'
          it_fieldcat = it_fieldcatalog
        TABLES
          t_outtab = it_sflight
        EXCEPTIONS
          program_error = 1
          OTHERS = 2.
    *& Form USER_COMMAND
    FORM user_command USING p_ucomm TYPE sy-ucomm
      p_selfld TYPE slis_selfield.
      CASE p_ucomm.
       WHEN '&DATA_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.
          LOOP AT it_sflight WHERE checkbox = 'X'.
             DELETE it_sflight INDEX sy-tabix.
          ENDLOOP.
          p_selfld-refresh = 'X'.
      ENDCASE.
    ENDFORM. "user_command

  • Push button in ALV Grid Display

    Hi all,
    I have a requirement wherin i need to place a button in the ALV Grid Display which should update all the records whatever are displayed in the specified infotype. This is to be done in a report.
    Can anybody give me any pointers or sample code for the above query.
    Regards,
    Amrita

    Simply add a button on your GUI status. Then when pushed, code your logic for update IT0008.
    AT USER-COMMAND event block will be triggered when you press your button.
    AT USER-COMMAND.
      if sy-ucomm = 'PUSHBUTTON'.    "here comes function code of your pushbutton
         "update your diplayed records
      endif.

  • Push Button on Alv Grid display

    Hi experts,
       I strcuk in the middle of one program, i need to have push buttons on the output ALV Grid display, i have copied the standard status and used the same in the Function module for pf-status, iam able to get the output
    but my requirement is how to add the push buttons to the out put screen, as when iam clicking on status which i have copied iam unable to find where to add these push button in the application tool bar, iam unable to edit the push button can any body help me out, thanks in advance.

    Hello Madan
    I cannot help you with the FM-based ALV lists. However, for OO-based ALV grids (CL_GUI_ALV_GRID) I have a sample program that simulates radio buttons by using icons with hotspots.
    PROGRAM ZUS_SDN_BCALV_GRID_DEMO_2.
    * Based on: BCALV_GRID_DEMO.
    TYPE-POOLS: icon.
    TYPES: BEGIN OF ty_s_sflight.
    INCLUDE TYPE sflight.
    TYPES: button1    TYPE lvc_emphsz.
    TYPES: button2    TYPE lvc_emphsz.
    TYPES: button3    TYPE lvc_emphsz.
    TYPES: button4    TYPE lvc_emphsz.
    TYPES: END OF ty_s_sflight.
    DATA:
      gt_sflight    TYPE STANDARD TABLE OF ty_s_sflight,
      gt_fcat       TYPE lvc_t_fcat.
    DATA: ok_code LIKE sy-ucomm,
    *      gt_sflight TYPE TABLE OF sflight,
          g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
          grid1  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          md_cnt    TYPE i.
        CLASS-METHODS:
          handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
            IMPORTING
              e_row_id
              e_column_id
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_hotspot_click.
    * define local data
        FIELD-SYMBOLS:
          <ls_entry>    TYPE ty_s_sflight,
          <ld_fld>      TYPE ANY.
        READ TABLE gt_sflight ASSIGNING <ls_entry> INDEX es_row_no-row_id.
        CHECK ( <ls_entry> IS ASSIGNED ).
    *   Set all radio buttons "unselected"
        <ls_entry>-button1 =  icon_wd_radio_button_empty.
        <ls_entry>-button2 =  icon_wd_radio_button_empty.
        <ls_entry>-button3 =  icon_wd_radio_button_empty.
        <ls_entry>-button4 =  icon_wd_radio_button_empty.
        ASSIGN COMPONENT e_column_id-fieldname OF STRUCTURE <ls_entry>
                                                  TO <ld_fld>.
        IF ( <ld_fld> IS ASSIGNED ).
    *     Set selected radio button "selected".
          <ld_fld> = icon_wd_radio_button.
        ENDIF.
    *   Force PAI followed by refresh of table display in PBO
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = 'DUMMY'
    *      IMPORTING
    *        RC       =
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
    *       MAIN                                                          *
      PERFORM select_data.
      CALL SCREEN 100.
    *       MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      IF g_custom_container IS INITIAL.
        CREATE OBJECT g_custom_container
               EXPORTING container_name = g_container.
        CREATE OBJECT grid1
               EXPORTING i_parent = g_custom_container.
        PERFORM build_fieldcatalog.
        CALL METHOD grid1->set_table_for_first_display
    *      EXPORTING
    *        i_structure_name = 'SFLIGHT'
          CHANGING
            it_fieldcatalog  = gt_fcat
            it_outtab        = gt_sflight.
    *   Set event handler for event TOOLBAR
        SET HANDLER:
          lcl_eventhandler=>handle_hotspot_click FOR grid1.
      else.
        CALL METHOD grid1->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.
      ENDIF.
    ENDMODULE.                    "PBO OUTPUT
    *       MODULE PAI INPUT                                              *
    MODULE pai INPUT.
    *   to react on oi_custom_events:
      CALL METHOD cl_gui_cfw=>dispatch.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM exit_program.
        WHEN OTHERS.
    *     do nothing
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                    "PAI INPUT
    *       FORM EXIT_PROGRAM                                             *
    FORM exit_program.
    *  CALL METHOD G_CUSTOM_CONTAINER->FREE.
    *  CALL METHOD CL_GUI_CFW=>FLUSH.
      LEAVE PROGRAM.
    ENDFORM.                    "EXIT_PROGRAM
    *&      Form  BUILD_FIELDCATALOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat,
        ls_hype        TYPE lvc_s_hype.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'LVC_S_FCAT'
    *     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.
      DELETE gt_fcat WHERE ( fieldname <> 'EMPHASIZE' ).
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'SFLIGHT'
    *     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.
      READ TABLE gt_fcat INTO ls_fcat
           WITH KEY fieldname = 'EMPHASIZE'.
      IF ( syst-subrc = 0 ).
        DELETE gt_fcat INDEX syst-tabix.
      ENDIF.
      ls_fcat-fieldname = 'BUTTON4'.
      ls_fcat-icon    = 'X'.
      ls_fcat-hotspot = 'X'.
      INSERT ls_fcat INTO gt_fcat INDEX 4.
      ls_fcat-fieldname = 'BUTTON3'.
      INSERT ls_fcat INTO gt_fcat INDEX 4.
      ls_fcat-fieldname = 'BUTTON2'.
      INSERT ls_fcat INTO gt_fcat INDEX 4.
      ls_fcat-fieldname = 'BUTTON1'.
      INSERT ls_fcat INTO gt_fcat INDEX 4.
      LOOP AT gt_fcat INTO ls_fcat.
        ls_fcat-col_pos = syst-tabix.
        MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
      ENDLOOP.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  SELECT_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM select_data .
    * define local data
      DATA:
        ls_sflight    TYPE ty_s_sflight.
      SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_sflight.
      ls_sflight-button1 = icon_wd_radio_button.
      ls_sflight-button2 = icon_wd_radio_button_empty.
      ls_sflight-button3 = icon_wd_radio_button_empty.
      ls_sflight-button4 = icon_wd_radio_button_empty.
      MODIFY gt_sflight FROM ls_sflight
          TRANSPORTING button1 button2 button3 button4
        WHERE ( carrid IS NOT INITIAL ).
    ENDFORM.                    " SELECT_DATA
    Regards
    Uwe

  • EDIT THE FIELV VALUE IN ALV GRID DISPLAY

    Hi Guru ,
    How can I edit the value of a particular one or two fields in ALV GRID DISPLAY .
    Please reply me

    hi,
    1.Set status of all cells to editable using the layout structure.
    2.Use SET_READY_FOR_INPUT to activate the edit feature initially.
       (state "editable activated").
    3.Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
    4.Use SET_READY_FOR_INPUT to switch between the substates.
        CALL METHOD g_grid->set_table_for_first_display
             EXPORTING i_structure_name = 'SFLIGHT'
                       is_layout        = gs_layout
             CHANGING  it_outtab        = gt_outtab.
    *§2.Use SET_READY_FOR_INPUT to allow editing initially.
    *   (state "editable and ready for input").
        CALL METHOD g_grid->set_ready_for_input
              EXPORTING i_ready_for_input = 1.
    *Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
      IF g_grid->is_ready_for_input( ) EQ 0.
    *Use SET_READY_FOR_INPUT to switch between the substates.
        CALL METHOD g_grid->set_ready_for_input
                         EXPORTING i_ready_for_input = 1.
      ELSE.
        CALL METHOD g_grid->set_ready_for_input
                         EXPORTING i_ready_for_input = 0.
      ENDIF.

  • What is the excel button in alv grid supposed to do?

    Hi All.
    In the ALV reports, we see an Excel button too.
    But on pressing it, a blank excel sheet opens, and there is no way to go out of it. We have to exit the report.
    What is it supposed to do?
    Thanks everybody !

    Hi Aishi,
    Yes you are correct.Well i would change my previous statement :
    EXCEL/Word Processing is not to open a BLANK SHEET, but to open an EXCEL/WORD document and paste the ALV output data into the Sheet. You have several option when you click on EXCEL. You can paste the ouput as a  PIVOT TABLE in excel sheet or Excel SAP Macros or a normal table.
    Open program <b>BCALV_FULLSCREEN_GRID_EDIT</b> in SE38 and execute it. Click EXCEL. And follow the directions. It will copy paste the code from the ALV output into Excel/Word File.
    The difference in EXPORT is that in EXPORT, you can download it in different formats ( VIz. excel, text etc ) without any formatting ( COlors etc.). But in the EXCEL button case, the data is copied and has different colours for columns etc.
    Best regards,
    Prashant

  • Remove buttons in ALV grid display in ABAP Web Dynpro

    Hi,
    Sub: ALV grid-->Web Dynpro ABAP.
    Request guidance to prevent display of the buttons "Microsoft Excel" and "Print Version" (which provide options to export the ALV grid output into an Excel format document).
    Is there a way we could hide this from being displayed on the ALV grid in a Web dynpro ABAP component output?
    Thanks very much.
    Best Regards,
    Adi

    Hi Adithya,
    really simple solution is to call cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs=>set_all( abap_false ). This deactivates all ALV functionality.
    For individual setting cl_salv_wd_config_table if_salv_wd_standard_functions~set_<x>_allowed.
    - Michelle

  • Not diaplsy buttons on alv grid display

    Hi,
    In the below code,i dont understand where i made a mistake,i used a user command on alv it's working but not display the buttons on a output.Please check the below code and solve it.
    REPORT  Y_ALV_VERSION.
    TYPE-POOLS : SLIS.
    DATA : BEGIN OF ITAB OCCURS 0,
           MATNR LIKE MARC-MATNR,       "Plant Data for Material-Material Number
           WERKS LIKE MARC-WERKS,       "Plant Data for Material-Plant
           EKGRP LIKE MARC-EKGRP,       "Plant Data for Material-Purchasing Group
           END OF ITAB.
    DATA : BEGIN OF ITAB1 OCCURS 0,
           MATNR LIKE MARD-MATNR,       "Storage Location Data for Material-Material Number
           WERKS LIKE MARD-WERKS,       "Storage Location Data for Material-Plant
           LGORT LIKE MARD-LGORT,       "Storage Location Data for Material-Storage Location
           END OF ITAB1.
    DATA : REPID LIKE SY-REPID.
    DATA : V_LINE TYPE SY-TABIX.
    DATA : X_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA : I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA : I_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
    DATA : X_ALV_EVENTS TYPE SLIS_ALV_EVENT.
    DATA : T_ALV_EVENTS TYPE SLIS_T_EVENT.
    DATA : X_ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
    *********************START-OF-SELECTION***************
    START-OF-SELECTION.
      PERFORM SUB_SELECT_RECORD.
      PERFORM SUB_PREPARE_FIELDCATALOG.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = T_ALV_EVENTS
    EXCEPTIONS
      LIST_TYPE_WRONG       = 1
      OTHERS                = 2
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE T_ALV_EVENTS INTO X_ALV_EVENTS WITH KEY NAME = 'USERCOMMAND'.
      IF SY-SUBRC = 0.
        X_ALV_EVENTS-FORM = 'USER_ACTION'.
        MODIFY T_ALV_EVENTS FROM X_ALV_EVENTS INDEX SY-TABIX.
      ENDIF.
      READ TABLE T_ALV_EVENTS INTO X_ALV_EVENTS WITH KEY NAME = 'PF_STATUS_SET'.
      IF SY-SUBRC = 0.
        X_ALV_EVENTS-FORM = 'PF_STATUS'.
        MODIFY T_ALV_EVENTS FROM X_ALV_EVENTS INDEX SY-TABIX.
      ENDIF.
      PERFORM SUB_DETERMINE_ALV_LAYOUT.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = REPID
       I_CALLBACK_PF_STATUS_SET          = 'PF_STATUS'
       I_CALLBACK_USER_COMMAND           = '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                         = X_ALV_LAYOUT
          IT_FIELDCAT                       = I_FIELDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
       I_DEFAULT                         = 'X'
       I_SAVE                            = 'A'
      IS_VARIANT                        =
          IT_EVENTS                         = T_ALV_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
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = ITAB
    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.
    *&      Form  PF_STATUS
          text
         -->RT_EXTAB   text
    FORM PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'ALV_PF_STATUS'.  " excluding rt_extab.
    ENDFORM.                    "PF_STATUS
    *&      Form  user_action
          text
         -->R_UCOMM      text
         -->RS_SELFIELD  text
    FORM USER_ACTION USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      DATA : OKCODE TYPE SY-UCOMM.
      OKCODE = R_UCOMM.
      CLEAR R_UCOMM.
      V_LINE = RS_SELFIELD-TABINDEX.
      CASE OKCODE.
        WHEN 'PICK'.
          READ TABLE ITAB INDEX V_LINE.
          PERFORM SUB_SELECT_RECORD1.
          PERFORM SUB_PREPARE_FIELDCATALOG1.
          CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = 'REPID'
      I_CALLBACK_PF_STATUS_SET          = '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                         =
      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
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
            TABLES
              T_OUTTAB                          = ITAB1
    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.
        WHEN 'EXIT'.
          RS_SELFIELD-EXIT = 'X'.
      ENDCASE.
    ENDFORM.                    "user_action
    *&      Form  SUB_PREPARE_FIELDCATALOG
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_PREPARE_FIELDCATALOG .
      X_FIELDCAT-SELTEXT_L = 'MATERIAL'.
      X_FIELDCAT-DATATYPE = 'CHAR'.
      X_FIELDCAT-OUTPUTLEN = 18.
      X_FIELDCAT-FIELDNAME = 'MATNR'.
      X_FIELDCAT-HOTSPOT = 'X'.
      APPEND X_FIELDCAT TO I_FIELDCAT.
      CLEAR X_FIELDCAT.
      X_FIELDCAT-SELTEXT_L = 'PLANT'.
      X_FIELDCAT-DATATYPE = 'CHAR'.
      X_FIELDCAT-OUTPUTLEN = 4.
      X_FIELDCAT-FIELDNAME = 'WERKS'.
      APPEND X_FIELDCAT TO I_FIELDCAT.
      CLEAR X_FIELDCAT.
      X_FIELDCAT-SELTEXT_L = 'PUR.GROUP'.
      X_FIELDCAT-DATATYPE = 'CHAR'.
      X_FIELDCAT-OUTPUTLEN = 4.
      X_FIELDCAT-FIELDNAME = 'EKGRP'.
      X_FIELDCAT-EDIT = 'X'.
      APPEND X_FIELDCAT TO I_FIELDCAT.
      CLEAR X_FIELDCAT.
    ENDFORM.                    " SUB_PREPARE_FIELDCATALOG
    *&      Form  SUB_SELECT_RECORD
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_SELECT_RECORD.
      SELECT MATNR WERKS EKGRP FROM MARC INTO TABLE ITAB UP TO 10 ROWS WHERE WERKS = '1000'.
    ENDFORM.                    " SUB_SELECT_RECORD
    *&      Form  SUB_DETERMINE_ALV_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_DETERMINE_ALV_LAYOUT .
      X_ALV_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
      X_ALV_LAYOUT-F2CODE = 'PICK'.
      X_ALV_LAYOUT-WINDOW_TITLEBAR = 'PLANT DATA'.
      X_ALV_LAYOUT-KEY_HOTSPOT = 'X'.
    ENDFORM.                    " SUB_DETERMINE_ALV_LAYOUT
    *&      Form  SUB_PREPARE_FIELDCATALOG1
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_PREPARE_FIELDCATALOG1 .
      X_FIELDCAT-SELTEXT_L = 'MATERIAL'.
      X_FIELDCAT-DATATYPE = 'CHAR'.
      X_FIELDCAT-OUTPUTLEN = 18.
      X_FIELDCAT-FIELDNAME = 'MATNR'.
      X_FIELDCAT-HOTSPOT = 'X'.
      APPEND X_FIELDCAT TO I_FIELDCAT1.
      CLEAR X_FIELDCAT.
      X_FIELDCAT-SELTEXT_L = 'PLANT'.
      X_FIELDCAT-DATATYPE = 'CHAR'.
      X_FIELDCAT-OUTPUTLEN = 4.
      X_FIELDCAT-FIELDNAME = 'WERKS'.
      APPEND X_FIELDCAT TO I_FIELDCAT1.
      CLEAR X_FIELDCAT.
      X_FIELDCAT-SELTEXT_L = 'Storage Location'.
      X_FIELDCAT-DATATYPE = 'CHAR'.
      X_FIELDCAT-OUTPUTLEN = 4.
      X_FIELDCAT-FIELDNAME = 'LGORT'.
      X_FIELDCAT-EDIT = 'X'.
      APPEND X_FIELDCAT TO I_FIELDCAT1.
      CLEAR X_FIELDCAT.
    ENDFORM.                    " SUB_PREPARE_FIELDCATALOG1
    *&      Form  SUB_SELECT_RECORD1
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_SELECT_RECORD1 .
      SELECT MATNR WERKS LGORT FROM MARD INTO TABLE ITAB1 WHERE MATNR = ITAB-MATNR AND WERKS = ITAB-WERKS.
      REFRESH I_FIELDCAT1.
    ENDFORM.                    " SUB_SELECT_RECORD1
    thanks and regards

    Consider this logic.
    DATA:
      g_exclude                  TYPE slis_t_extab.
    *       FORM display_alv_report                                       *
    FORM display_alv_report.
      PERFORM fieldcat_init      USING g_fieldcat[].
      PERFORM build_sort_fields  USING g_sort[].
      PERFORM eventtab_build     USING g_events[]
                                       g_events_ex[].
      PERFORM layout_build       USING g_layout.
      PERFORM exclude_icons.
      PERFORM list_view.
    ENDFORM.                    " display_alv_report.
    *      Form  exclude_icons
    FORM exclude_icons.
      APPEND '&ETA' TO g_exclude.     "Details
    *  APPEND '&OUP' TO g_exclude.     "Sort Up
    *  APPEND '&ODN' TO g_exclude.     "Sort Down
      APPEND '&ILT' TO g_exclude.     "Set Filter
      APPEND '&UMC' TO g_exclude.     "Sum
      APPEND '&RNT_PREV' TO g_exclude.     "Print preview
    *  APPEND '&VEXCEL' TO g_exclude.     "Excel
      APPEND '&AQW' TO g_exclude.     "Word processing
      APPEND '%PC' TO g_exclude.     "Local File
      APPEND '%SL' TO g_exclude.     "Mail recepient
      APPEND '&ABC' TO g_exclude.     "ABC Analysis
      APPEND '&GRAPH' TO g_exclude.     "Graphic
    *  APPEND '&OL0' TO g_exclude.     "Change layout
    *  APPEND '&OAD' TO g_exclude.     "Select layout
      APPEND '&AVE' TO g_exclude.     "Save Layout
      APPEND '&INFO' TO g_exclude.  "Information
    ENDFORM.                    " exclude_icons
    FORM list_view.
      g_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program = g_repid
                is_layout          = g_layout
                it_sort            = g_sort[]
                it_events          = g_events[]
                it_fieldcat        = g_fieldcat[]
                i_save             = g_save
                it_excluding       = g_exclude     "<== Exclude
           TABLES
                t_outtab           = it_work
           EXCEPTIONS
                program_error      = 1
                OTHERS             = 2.
      IF sy-subrc <> 0.
        MESSAGE e208(00) WITH 'Error: ALV Grid'.
      ENDIF.
    ENDFORM.                    " layout_build

  • Custom buttons in ALV grid display

    I want to add custom buttons on application toolbar while displaying an ALV report using grid display.
    how can it be done?

    Hi
    In order to add user command functioality to the ALV grid you need to perform the following steps:
                        1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include 'USER_COMMAND' FORM
                    2. Create 'USER_COMMAND' FORM
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                I_callback_user_command = 'USER_COMMAND'   "see FORM
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
          FORM USER_COMMAND                                          *
          --> R_UCOMM                                                *
          --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
      Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
        Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
        Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
        Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDCASE.
    ENDFORM.
    In order modify PF_STATUS of ALV grid report you need to perform the following steps:
         1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include:
                        i_callback_pf_status_set = 'SET_PF_STATUS' statement.
         2. Create 'SET_PF_STATUS' FORM
         3. Create pf_status (i.e. 'ZNEWSTATUS').
              - It is recommend that you copy standard status'STANDARD' from function group SALV
                and modify it accordingly. ALV standard function codes always start with '&'.
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                i_callback_pf_status_set = 'SET_PF_STATUS'   "see FORM
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
          FORM SET_PF_STATUS                                         *
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZNEWSTATUS'.
                      "Copy of 'STANDARD' pf_status from fgroup SALV
    ENDFORM.

  • How to Edit the CheckBox in Classic ALV GRID Display

    Hi,
    I want to Edit the checkbox in Grid Display.
    I have one checkbox field in my internal Table,
    Code Of the Program,
    Data :
    Begin of itab occurs 0,
    CHK type C,
    MATNR like MARA-MATNR,
    end of itab.
    Iam building the fieldcatelog using Merge Funcion module.
    After that I am chaning the properties of the field
    catelog like below,
    loop at I_FCAT assigning <FCAT>.
    Case <FCAT>-Fieldname
    When 'CHK'.
    <FCAT>-Checkbox = 'X'.
    <FCAT>-INPUT = 'X'.
    I dont have edit option in fieldcatelog.
    modify I_FCAT from <FCAT>.
    endcase.
    endloop.
    In the Layout,
    I_LAYOUT-box_fieldname = 'CHK'.
    I_LAYOUT-box_tabname = 'ITAB'.
    It is displaying the Checkbox field.but I couldnt edit the checkBox.
    I can able to edit in REUSE_ALV_LIST_DISPLAY.
    But I  have to use REUSE_ALV_GRID_DISPLAY.How to edit the checkbox.
    Thanks in Advance,
    Sumithra

    Hi vasu,
    The below procedure explains you to create a checkbox cloumn in the grid and allows you to edit i hope this will helps u.
    The ALV Grid Control displays the cells of a column as checkboxes if the column is marked as a checkbox column in the field catalog.
    •     Add another field to the output table in which you want to display checkboxes
    OR
    •     Define an existing field as a checkbox.
    Procedure
    1.     Add a field to your output table:
    Data: gt_fieldcat type lvc_t_fcat.
    Types: begin of gs_outtab.
    Types: checkbox type c. "field for checkbox
    Include structure <ABAP Dictionary structure> .
    Types: end of gs_outtab.
    Data: gt_outtab type gs_outtab occurs 0 with header line.
    2 * Add an entry for the checkbox to the field catalog
    clear ls_fcat.
    ls_fcat-fieldname = 'CHECKBOX'.
    * Essential: declare field as checkbox and
    * mark it as editable field:
    ls_fcat-checkbox = 'X'.
    ls_fcat-edit = 'X'.
    * do not forget to provide texts for this extra field
    ls_fcat-coltext = text-f01.
    ls_fcat-tooltip = text-f02.
    ls_fcat-seltext = text-f03.
    append ls_fcat to gt_fieldcat.
    regards,
    venu.

  • Button in ALV grid display

    Hi frenz,
    I have a requirement in PS module.The problem is, i am fetching 'lessons learned from the project' from CJ20N tcode which i have to display in ALV.If it is one line or two line i can display in the ALV but if it is of 1 or 2 pages ? here i have to place an icon or button for that and upon clicking that it shud go to that long text(cj20n tcode).pls help me .
    reward is guaranteed.
    BR,
    ANIl.

    Hello Anil
    Here is an example of how to display the long text of a PSP project.
    *& Report  ZUS_SDN_PS_LONGTEXT_DISPLAY
    REPORT  zus_sdn_ps_longtext_display.
    DATA:
      go_docking     TYPE REF TO cl_gui_docking_container,
      go_textedit    TYPE REF TO cl_gui_textedit,
      gd_name        TYPE thead-tdname,
      gs_header      TYPE thead,
      gd_langu       TYPE thead-tdspras,
      gt_lines       TYPE STANDARD TABLE OF tline.
    PARAMETERS:
      p_pspnr    TYPE prps-pspnr.
    START-OF-SELECTION.
    * Get the text object
      gs_header-tdid = 'LTXT'.  " long text
      gs_header-tdspras = syst-langu.
      CONCATENATE syst-langu p_pspnr
          INTO gs_header-tdname.
      gs_header-tdobject = 'PMS'.
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
    *     CLIENT                        = SY-MANDT
          id                            = gs_header-tdid
          language                      = gs_header-tdspras
          name                          = gs_header-tdname
          object                        = gs_header-tdobject
    *     ARCHIVE_HANDLE                = 0
    *     LOCAL_CAT                     = ' '
    *   IMPORTING
    *     HEADER                        =
        TABLES
          lines                         = gt_lines
        EXCEPTIONS
          id                            = 1
          language                      = 2
          name                          = 3
          not_found                     = 4
          object                        = 5
          reference_check               = 6
          wrong_access_to_archive       = 7
          OTHERS                        = 8.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL SCREEN '0100'.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
    *  SET PF-STATUS 'xxxxxxxx'.
    *  SET TITLEBAR 'xxx'.
      IF ( go_textedit IS NOT BOUND ).
        CREATE OBJECT go_docking
           EXPORTING
             parent                      = cl_gui_container=>screen0
    *        REPID                       =
    *        DYNNR                       =
    *        SIDE                        = DOCK_AT_LEFT
    *        EXTENSION                   = 50
    *        STYLE                       =
    *        LIFETIME                    = lifetime_default
    *        CAPTION                     =
    *        METRIC                      = 0
            RATIO                       = 90
    *        NO_AUTODEF_PROGID_DYNNR     =
    *        NAME                        =
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            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 OBJECT go_textedit
          EXPORTING
    *        MAX_NUMBER_CHARS       =
    *        STYLE                  = 0
            wordwrap_mode          =
                c_textedit_control=>wordwrap_at_windowborder
    *        WORDWRAP_POSITION      =
            wordwrap_to_linebreak_mode =
               c_textedit_control=>true
    *        FILEDROP_MODE          = DROPFILE_EVENT_OFF
            parent                 = go_docking
    *        LIFETIME               =
    *        NAME                   =
          EXCEPTIONS
            error_cntl_create      = 1
            error_cntl_init        = 2
            error_cntl_link        = 3
            error_dp_create        = 4
            gui_type_not_supported = 5
            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.
        CALL METHOD go_textedit->set_text_as_r3table
          EXPORTING
            table           = gt_lines
          EXCEPTIONS
            error_dp        = 1
            error_dp_create = 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.
        CALL METHOD go_textedit->set_enable
          EXPORTING
            enable            = CL_GUI_cfw=>false
           EXCEPTIONS
             CNTL_ERROR        = 1
             CNTL_SYSTEM_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.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      SET SCREEN 0. LEAVE SCREEN.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    Dynpro '0100' has no elements with the following flow logic:
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    You simply add the button on your ALV list. When the user pushes this button you have to handle event BUTTON_CLICK. There you could call a function module containing the sample code above (has to be adjusted a little bit) which displays the long text.
    Regards
      Uwe

  • Regarding enabled check box's in alv grid display

    hi ,
    in alv output i have three fields i have enabled check boxes of  this three field  i want to display the out put of them
    could u please explain clearly with code

    Hi,
    Go to Se38 --> Input BCALV_EDIT* and press F4. You can find many demo program with chekbox in ALV.
    Thanks,
    Sriram Ponna.

  • Increase the field width in ALV grid display

    hi
    My problem is that when i am trying to print data through REUSE_ALV_GRID_DISPLAY, a particular field which contain message is being truncated, i used ls_layout-colwidth_optimiser as 'X' and also t_fieldcat-outputlen = 1000, but still i am having this prblm, but i checked in the internal table that is passed in ALV, the entire data is stored there, but while printing its getting truncated for a particular field, please suggest me  a solution to my problem.
    Regards
    Swarnali

    Hey Neelam
    this is a very old thread, so I don t remember the exact solution which I implemented,
    however can you use the i_tab name in the field TABNAME of the field catalog.
    Regarding breaking the message, you can use a STRLEN if you are aware at the no. of chars where it should break always or split at space the string in 4 strings.
    Inside the field catalog you have to take an internal table with 4 different fields and show it.
    Hopefully it should resolve your problem.
    Regards
    SB

  • How to merge the 2 field in alv gride display

    Tables for ALV display
    DATA: it_fieldcat   TYPE  slis_t_fieldcat_alv,
          wa_fieldcat   TYPE  slis_fieldcat_alv,
          wa_layout     TYPE  slis_layout_alv,
          it_exclude    TYPE  slis_t_extab,
          wa_exclude    TYPE  slis_extab,
          it_header TYPE STANDARD TABLE OF zqm_imir_hdr,
          wa_header LIKE LINE OF it_header,
          it_final TYPE STANDARD TABLE OF zqm_imir_itm,
          wa_final LIKE LINE OF it_final,
          it_vcode      TYPE RANGE OF zqm_wtr_itm-vcode,
           wa_vcode      LIKE LINE OF  it_vcode.
    DEFINE m_fieldcat.
      wa_fieldcat-fieldname = &1.
      wa_fieldcat-tabname   = &2.
      wa_fieldcat-seltext_m = &3.
      wa_fieldcat-outputlen = &4.
      wa_fieldcat-col_pos   = &5.
      append wa_fieldcat to it_fieldcat.
      clear wa_fieldcat.
    END-OF-DEFINITION.
    DEFINE m_vcode.
      wa_vcode-option   = &1.
      wa_vcode-sign     = &2.
      wa_vcode-low      = &3.
      wa_vcode-high     = ''.
      append wa_vcode to it_vcode.
      clear wa_vcode.
    END-OF-DEFINITION.
    START-OF-SELECTION.
      PERFORM data_retrival.
      PERFORM lead_time_calculation.
      IF it_final[] IS NOT INITIAL.
        PERFORM alv_display.
      ENDIF.
    Display ALV
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          is_layout          = wa_layout
          it_fieldcat        = it_fieldcat
          i_save             = c_x
          it_excluding       = it_exclude
        TABLES
          t_outtab           = IT_OUTPUT[]
        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.
      m_fieldcat: 'ZIMIRNO'  'IT_OUTPUT' text-003 21  0,
                  'PRUEFLOS'  'IT_OUTPUT' text-004 21  1,
                  'ZCRDAT'    'IT_OUTPUT' text-030 9 2,
                  'INITS'     'IT_OUTPUT' text-031 6 3,
                  'SPLIT'     'IT_OUTPUT' text-005 12  4,
                  'WERK'     'IT_OUTPUT' text-006  5 5,
                  'LOSMENGE'  'IT_OUTPUT' text-007 24  6,
                  'MENGENEINH' 'IT_OUTPUT' text-008  15  7,
                  'NAMEVEND'   'IT_OUTPUT' text-009  11  8,
    *& Hypercare - 721600 - IMIR Changes - Start
                 'KONT_PSPNR' 'IT_OUTPUT' text-023  15  7,
                  'POSID' 'IT_OUTPUT' text-023  15  9,
    *& Hypercare - 721600 - IMIR Changes - End
                  'LTEX1' 'IT_OUTPUT'  text-024  24  10,
                  'EBELN'    'IT_OUTPUT' text-010  26  11,
                  'MBLNR'    'IT_OUTPUT' text-011  24  12,
                  'ANZGEB'   'IT_OUTPUT' text-012  17  13,
                  'GEBEH'    'IT_OUTPUT' text-013  4 14,
                  'MATNR'    'IT_OUTPUT' text-014  18 15,
                  'TXZ01'   'IT_OUTPUT' text-015  128 16,
                  'SPECE'    'IT_OUTPUT' text-016  23  17,
                  'VCODE'   'IT_OUTPUT' text-017 24  18,
                  'TAGNO'   'IT_OUTPUT' text-018 10  19,
                  'HEATNO'   'IT_OUTPUT' text-019  11  20,
                  'IDCODE'   'IT_OUTPUT' text-020  7 21,
                  'TCNO'   'IT_OUTPUT' text-021  9 22,
                  'REMARKS'   'IT_OUTPUT' text-022 30 23,
                  'BUDAT'   'IT_OUTPUT' text-025 30 24,
                  'CPUTM'   'IT_OUTPUT' text-026 30 25,
                  'VDATUM'   'IT_OUTPUT' text-027 30 26,
                  'VEZEITERF'   'IT_OUTPUT' text-028 30 27,
                 'ZLTIME'    'IT_OUTPUT' text-029 30 26,
                  'LEADTIME'   'IT_OUTPUT' text-029 30 28.
    DATA : v_unit like T006-MSEHI VALUE 'HR',
           v_FCALID like SCAL-FCALID,
           v_zltim TYPE f,
           v_zltime TYPE p LENGTH 8 DECIMALS 2.
    SELECT SINGLE FABKL INTO v_FCALID FROM T001W WHERE WERKS = s_werks.
    SELECT zcrdat INTO TABLE it_zqm_imir_hdr
           from zqm_imir_hdr
            FOR ALL ENTRIES IN it_final
            where zcrdat EQ it_final-zcrdat.
    SELECT mblnr mjahr budat cputm
          INTO TABLE it_mkpf
          from mkpf
            FOR ALL ENTRIES IN it_final
          where mblnr EQ it_final-mblnr
            AND mjahr EQ it_final-mjahr.
    SELECT prueflos vdatum vezeiterf
          INTO TABLE it_qave
          from qave
            FOR ALL ENTRIES IN it_final
          where prueflos EQ it_final-prueflos.
    SORT it_mkpf    BY mblnr mjahr.
    SORT it_qave    by prueflos.
    SORT it_zqm_imir_hdr  BY zcrdat.
        LOOP AT it_final into wa_final.
          CLEAR: wa_output,wa_mkpf,wa_qave,wa_zqm_imir_hdr.
          MOVE-CORRESPONDING wa_final to wa_output.
    READ TABLE it_zqm_imir_hdr INTO wa_zqm_imir_hdr WITH KEY zcrdat = wa_final-zcrdat
                                                   BINARY SEARCH.
          READ TABLE it_mkpf INTO wa_mkpf WITH KEY mblnr = wa_final-mblnr
                                                   mjahr = wa_final-mjahr
                                                   BINARY SEARCH.
          MOVE wa_zqm_imir_hdr-zcrdat TO wa_output-zcrdat.
          MOVE wa_mkpf-budat TO wa_output-budat.
          MOVE wa_mkpf-cputm TO wa_output-cputm.
          READ TABLE it_qave INTO wa_qave WITH KEY prueflos = wa_final-PRUEFLOS
                                                   BINARY SEARCH.
          MOVE wa_qave-vdatum     TO wa_output-vdatum.
          MOVE wa_qave-vezeiterf  TO wa_output-vezeiterf.
    LV_START_DATE = wa_zqm_imir_hdr-zcrdat.
    LV_START_DATE = wa_mkpf-budat.
    LV_START_TIME =  wa_mkpf-cputm.
    LV_END_TIME   = wa_qave-vezeiterf.
    LV_END_DATE   =  wa_qave-vdatum.
    IF LV_START_DATE IS NOT INITIAL.
       IF LV_END_DATE IS NOT INITIAL.
          CALL FUNCTION 'SD_CALC_DURATION_FROM_DATETIME'
            EXPORTING
              i_date1                =  LV_START_DATE
              i_time1                =  LV_START_TIME
              i_date2                =  LV_END_DATE
              i_time2                =  LV_END_TIME
           IMPORTING
             E_TDIFF                =  LV_DIFF
            E_DATE2_EARLY          =  E_DATE2_EARLY
          EXCEPTIONS
            INVALID_DATETIME       = 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.
    eNDFORM.}
    This is my code unable to merge the to tabs position is on 3rd and 4th.
    need help ......
    thanks,

    Hi,
    From Your code I saw that you called Macro of fieldcat after Calling the ALV Function Did You Check That One.
    Following links may be useful for you ,
    ALV report: How to merge 2 columns into 1 column?
    Hope this information helps You
    Regards,
    Raghava Channooru

  • How to capture the event in ALV grid display?

    Hi experts,
      How to capture the event in an ALV grid display which is editable. I have to capture the TAB key or ENTER key.
    regards,
    Arul Jothi.

    Hi Arul,
    Take a look at sample program BCALV_EDIT_03. (Find string "register ENTER" in the program to see how to register)
    Basically you have to Register edit events using method call REGISTER_EDIT_EVENT and then write a handler method for event DATA_CHANGED..
    If you are using a REUSE..GRID fm then first get the grid reference using function module GET_GLOBALS_FROM_SLVC_FULLSCR and then repeat the above procedure..
    Hope this helps..
    Sri
    Message was edited by: Srikanth Pinnamaneni

Maybe you are looking for

  • No sound through HDMI alternative solution

    If you are not able to get sound through your TV through HDMI and have tried all the System Preferences/Audio MIDI steps detailed on here in other threads but nothing works, try just shutting down all running apps. I had to Force Quit Spotify, Viber,

  • Continuous Kernel Panic - Unable to use Arch :(

    Good evening, yesterday i tried on my vbox Arch Linux and i was fascinated with his elegance and cleanness. Today i decided to install it on my physical machine, an HP tx2000 tablet pc with AMD Turion 64 processor, 2GB RAM, NVidia graphic chip. I dow

  • Why is my entire CS3 crashing??

    Hello, For the past week I've tried to use Photoshop, InDesign and Illustrator but almost immediately after launching them, they crash.  I followed everything on the discussion boards including deleting TWAIN files but nothing seems to be fixing the

  • ALV Edit in place.

    Hi I want to have the "Edit in place" functionality in an ALV. Do you have an URL or example of how to do this? Thanx in advance

  • Infotype 2

    Hello, In Infotype 2 if the firstname and lastname are same is there any function module to get the name without duplicate. Regards, Aravind