4 LEVEL ALV BASED ON DOUBLECLICK

hi friends,
i Want to make 4 level Alv Based on Doubleclick,
Eg.
1 level :- Based On selectionscreen (ALV)        
2nd level :- double click on any cell of 1st alv (ALV)
3rd level :- double click on any cell of 2st alv (ALV)
4th level :- double click on any cell of 3rd alv (Call Tranasaction)
i make till second level using class lcl_event_receiver...
i need ur help to go ahead..
thankx..
Swapnil.

Hi Swapnil,
I tried that and got the same in first attempt itself. i am not sure where you got strucked.
Here is the sample code... try this..
REPORT Z195_ALV_LEVELS.
DATA: ispfli TYPE TABLE OF spfli.
DATA: isflight TYPE TABLE OF sflight.
DATA: iscarr TYPE TABLE OF scarr.
DATA: imara TYPE TABLE OF mara.
DATA: xspfli TYPE spfli.
DATA: gr_table TYPE REF TO cl_salv_table.
DATA: gr_table1 TYPE REF TO cl_salv_table.
DATA: gr_table2 TYPE REF TO cl_salv_table.
DATA: gr_table3 TYPE REF TO cl_salv_table.
DATA: gr_functions TYPE REF TO cl_salv_functions_list.
DATA: gr_events TYPE REF TO cl_salv_events_table.
DATA: gr_selections TYPE REF TO cl_salv_selections.
DATA: w_level TYPE sy-index.
* CLASS lcl_handle_events DEFINITION
CLASS lcl_handle_events DEFINITION.
  PUBLIC SECTION.
    METHODS: on_user_command FOR EVENT added_function OF cl_salv_events
    IMPORTING e_salv_function,
    on_double_click FOR EVENT double_click OF cl_salv_events_table
    IMPORTING row column.
ENDCLASS. "lcl_handle_events DEFINITION
DATA: event_handler TYPE REF TO lcl_handle_events.
START-OF-SELECTION.
  SELECT * INTO CORRESPONDING FIELDS OF TABLE ispfli FROM spfli UP TO 100 ROWS.
  CALL METHOD cl_salv_table=>factory
    IMPORTING
      r_salv_table = gr_table
    CHANGING
      t_table      = ispfli.
  gr_table->set_screen_status(
  pfstatus = 'SALV_TABLE_STANDARD'
  report = sy-repid
  set_functions = gr_table->c_functions_all ).
  gr_events = gr_table->get_event( ).
  CREATE OBJECT event_handler.
  SET HANDLER event_handler->on_user_command FOR gr_events.
  SET HANDLER event_handler->on_double_click FOR gr_events.
* Set up selections.
  gr_selections = gr_table->get_selections( ).
  gr_selections->set_selection_mode( 1 ). "Single
* Display
  gr_table->display( ).
* CLASS lcl_handle_events IMPLEMENTATION
CLASS lcl_handle_events IMPLEMENTATION.
  METHOD on_user_command.
* Get the selection rows
    DATA: lr_selections TYPE REF TO cl_salv_selections.
    DATA: lt_rows TYPE salv_t_row.
    DATA: ls_rows TYPE i.
    DATA: message TYPE string.
    CASE e_salv_function.
      WHEN 'MYFUNCTION'.
*        lr_selections = gr_table->get_selections( ).
*        lt_rows = lr_selections->get_selected_rows( ).
*        READ TABLE lt_rows INTO ls_rows INDEX 1.
*        READ TABLE ispfli INTO xspfli INDEX ls_rows.
*        CONCATENATE xspfli-carrid xspfli-connid xspfli-cityfrom xspfli-cityto
*         INTO message SEPARATED BY space.
*        MESSAGE i001(00) WITH 'You pushed the button!' message.
    ENDCASE.
  ENDMETHOD. "on_user_command
  METHOD on_double_click.
    IF w_level EQ 0.
      w_level = 1.
      PERFORM display_2ndlevel.
    ELSEIF w_level EQ 1.
      w_level = 2.
      PERFORM display_3rdlevel.
    ELSEIF w_level EQ 2.
      w_level = 3.
      PERFORM display_4thlevel.
    ELSEIF w_level EQ 3.
      w_level = 4.
      MESSAGE i001(00) WITH 'No further digging is possible'.
    ENDIF.
*    DATA: message TYPE string.
*    DATA: row_c(4) TYPE c.
*    row_c = row.
*    CONCATENATE 'Row' row_c 'Column' column INTO message SEPARATED BY space.
*    MESSAGE i001(00) WITH 'You double-clicked on ' message.
  ENDMETHOD. "on_double_click
ENDCLASS. "lcl_handle_events IMPLEMENTATION
*&      Form  DISPLAY_2NDLEVEL
*       text
*  -->  p1        text
*  <--  p2        text
FORM display_2ndlevel .
  SELECT * INTO CORRESPONDING FIELDS OF TABLE isflight FROM sflight UP TO 100 ROWS.
  CALL METHOD cl_salv_table=>factory
    IMPORTING
      r_salv_table = gr_table1
    CHANGING
      t_table      = isflight.
  gr_table1->set_screen_status(
  pfstatus = 'SALV_TABLE_STANDARD'
  report = sy-repid
  set_functions = gr_table1->c_functions_all ).
  gr_events = gr_table1->get_event( ).
  CREATE OBJECT event_handler.
  SET HANDLER event_handler->on_user_command FOR gr_events.
  SET HANDLER event_handler->on_double_click FOR gr_events.
* Set up selections.
  gr_selections = gr_table1->get_selections( ).
  gr_selections->set_selection_mode( 1 ). "Single
* Display
  gr_table1->display( ).
ENDFORM.                    " DISPLAY_2NDLEVEL
*&      Form  DISPLAY_3RDLEVEL
*       text
*  -->  p1        text
*  <--  p2        text
FORM display_3rdlevel .
  SELECT * INTO CORRESPONDING FIELDS OF TABLE iscarr FROM scarr UP TO 100 ROWS.
  CALL METHOD cl_salv_table=>factory
    IMPORTING
      r_salv_table = gr_table2
    CHANGING
      t_table      = iscarr.
  gr_table2->set_screen_status(
  pfstatus = 'SALV_TABLE_STANDARD'
  report = sy-repid
  set_functions = gr_table2->c_functions_all ).
  gr_events = gr_table2->get_event( ).
  CREATE OBJECT event_handler.
  SET HANDLER event_handler->on_user_command FOR gr_events.
  SET HANDLER event_handler->on_double_click FOR gr_events.
* Set up selections.
  gr_selections = gr_table2->get_selections( ).
  gr_selections->set_selection_mode( 1 ). "Single
* Display
  gr_table2->display( ).
ENDFORM.                    " DISPLAY_3RDLEVEL
*&      Form  DISPLAY_4THDLEVEL
*       text
*  -->  p1        text
*  <--  p2        text
FORM display_4thlevel .
  SELECT * INTO CORRESPONDING FIELDS OF TABLE imara FROM mara UP TO 100 ROWS.
  CALL METHOD cl_salv_table=>factory
    IMPORTING
      r_salv_table = gr_table3
    CHANGING
      t_table      = imara.
  gr_table3->set_screen_status(
  pfstatus = 'SALV_TABLE_STANDARD'
  report = sy-repid
  set_functions = gr_table3->c_functions_all ).
  gr_events = gr_table3->get_event( ).
  CREATE OBJECT event_handler.
  SET HANDLER event_handler->on_user_command FOR gr_events.
  SET HANDLER event_handler->on_double_click FOR gr_events.
* Set up selections.
  gr_selections = gr_table3->get_selections( ).
  gr_selections->set_selection_mode( 1 ). "Single
* Display
  gr_table3->display( ).
ENDFORM.                    " DISPLAY_4THLEVEL

Similar Messages

  • Grey out a particular row in ALV based on some condition.

    Hi All,
    How can we grey out the particular row in ALV based on some condition( I am using the function modules and not OOPS).
    Regards
    Ramesh.

    Hello Ramesh
    In this case you need to add a specific field to your structure:
    TYPES: BEGIN OF ty_s_outtab.
    INLCUDE TYPE <my table or structure>.
    TYPES: CELLTAB   TYPE lvc_t_styl.  " name is arbitrary but this one is most frequently used
    TYPES: END OF ty_s_outtab.
    DATA: gt_outtab  TYPE STANDARD TABLE OF ty_s_outtab
                                 WITH DEFAULT KEY.
    You can use the fieldcatalog to make an entire column non-editable (LVC_S_FCAT-EDIT = ' ' ).
    However, in case of rows you need to inactivate all cells of this row. For sample coding please refer to thread:
    How to conditionally set ALV field as hotspot
    Regards
      Uwe

  • Drop down in alv based on data in other calumn of same row

    Hi Guys,
    I need to provide drop down in an ALV based on data in other calumn in same row.
    if i have two calumns country and region in my alv then drop down values for region should come depending upon country value.
    i went through lot of blogs and forum threads but none seems to solve my problem.
    I'm able to achieve this in Table but not in ALV. I'm using DropdownbyIndex Ui element.

    Hi Guys finally i am able to get my dropdown data visible.
    I am posting the code here so that others can make use of it.
    In your context node add an attribute type WDR_CONTEXT_ATTR_VALUE_LIST
    after getting data into your context node table fill the above attribute as shown in the below code
    LOOP AT lt_mara INTO ls_mara.
    clear: lv_indx.
    lv_indx = sy-tabix.
    clear ls_valueset.
    *refresh: lt_valueset.
    ls_valueset-value = ls_mara-mtart.
    ls_valueset-text = ls_mara-mtart.
    APPEND ls_valueset to ls_mara-valueset.
    clear ls_valueset.
    *ls_valueset-text = ls_mara-matnr.
    APPEND ls_valueset to ls_mara-valueset.
    *lr_element = lo_nd_mara->get_element( lv_indx ).
    *lr_child_node = lr_element->get_child_node( 'DDVALUE' ).
    *lr_child_node->bind_table( lt_valueset ).
    MODIFY lt_mara FROM ls_mara INDEX lv_indx.
    CLEAR ls_mara.
    ENDLOOP. lo_nd_mara->bind_table( lt_mara ).
    DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
    lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
    *---set data
    lo_interfacecontroller->set_data( r_node_data = lo_nd_mara ).
    DATA lv_value TYPE REF TO   cl_salv_wd_config_table.
      lv_value = lo_interfacecontroller->get_model(
    *----dropdown logic
    data: lr_col type ref to CL_SALV_WD_COLUMN,
          lr_ddn type ref to cl_salv_wd_uie_dropdown_by_idx.
    CALL METHOD lv_value->if_salv_wd_column_settings~get_column
      EXPORTING
        id     = 'MTART'
      receiving
        value  = lr_col
    *lr_ddn ?= lr_col->get_cell_editor( ).
    CREATE OBJECT lr_ddn
      EXPORTING
        selected_key_fieldname = 'MTART'
    CALL METHOD lr_ddn->set_valueset_fieldname
      EXPORTING
        value  = 'VALUESET'
    lr_ddn->set_selected_key_fieldname( value = 'MTART' ).
    CALL METHOD lr_ddn->set_type
      EXPORTING
        value  = IF_SALV_WD_C_UIE_DRDN_BY_INDEX=>type_key_value
    CALL METHOD lr_col->set_cell_editor
      EXPORTING
        value  = lr_ddn
    lv_value->if_salv_wd_table_settings~set_read_only( abap_false ).
    Just follow the above code you will be able to achieve dropdown by index in your alv.

  • HOW TO DISABLE ALL BUT ONE CHECKBOX IN ALV BASED ON ITEM LEVEL

    Hi All,
    I have a report that has output format in ALV , first column is a Checkbox and second in agreement number . the data is displayed on item level , now my requirement is check box must be displayed in front of only first line item per agreement number and should not be displayed infront of any other ,
    rewadard points are waiting.....for correct answer...

    The same thing can be done using Object Oriented ALV.
    Following are the steps...
    1. HANDLE_STYLE TYPE LVC_T_STYL.
    DECLARE work area,and table
    2.  DATA: LS_EDIT TYPE LVC_S_STYL,
            LT_EDIT TYPE LVC_T_STYL.
    changing the style...
    3.
    LOOP AT IT_FINAL INTO LS_OUTTAB WHERE FLAG = 'X'.
        V_INDEX = SY-TABIX.
        LS_EDIT-FIELDNAME = 'MATNR'.
        LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
        LS_EDIT-STYLE2 = SPACE.
        LS_EDIT-STYLE3 = SPACE.
        LS_EDIT-STYLE4 = SPACE.
        LS_EDIT-MAXLEN = 8.
        INSERT LS_EDIT INTO TABLE LT_EDIT.
        LS_EDIT-FIELDNAME = 'VBELN'.
        LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENAABLED.
        LS_EDIT-STYLE2 = SPACE.
        LS_EDIT-STYLE3 = SPACE.
        LS_EDIT-STYLE4 = SPACE.
        LS_EDIT-MAXLEN = 8.
        INSERT LS_EDIT INTO TABLE LT_EDIT.
        LS_EDIT-FIELDNAME = 'POSNR'.
        LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
        LS_EDIT-STYLE2 = SPACE.
        LS_EDIT-STYLE3 = SPACE.
        LS_EDIT-STYLE4 = SPACE.
        LS_EDIT-MAXLEN = 8.
        INSERT LS_EDIT INTO TABLE LT_EDIT.
        INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
        MODIFY IT_FINAL INDEX V_INDEX FROM LS_OUTTAB  TRANSPORTING
                                          HANDLE_STYLE .
      ENDLOOP.
    assigning the style to Layout..
    4.   GS_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
    Check the sample code..
    create a screen 100, place a control on that and name it as TEST. and also activate the pf-status.
    REPORT  ZTEST1234    MESSAGE-ID ZZ                           .
    DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID. 
    DATA: L_VALID TYPE C,
          V_FLAG,
          V_DATA_CHANGE,
          V_ROW TYPE LVC_S_ROW,
          V_COLUMN TYPE LVC_S_COL,
          V_ROW_NUM TYPE LVC_S_ROID.
    DATA: OK_CODE LIKE SY-UCOMM,
          SAVE_OK LIKE SY-UCOMM,
          G_CONTAINER1 TYPE SCRFNAME VALUE 'TEST', "First Container
          GS_LAYOUT TYPE LVC_S_LAYO.
    DATA:BEGIN OF  ITAB OCCURS 0,
         VBELN LIKE LIKP-VBELN,
         POSNR LIKE LIPS-POSNR,
         LFDAT like lips-vfdat,
         BOX(1),
         HANDLE_STYLE TYPE LVC_T_STYL,
         END OF ITAB.
    *       CLASS lcl_event_handler DEFINITION
    CLASS LCL_EVENT_HANDLER DEFINITION .
      PUBLIC SECTION .
        METHODS:
    **Hot spot Handler
        HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
                          IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
    **Handler to Check the Data Change
        HANDLE_DATA_CHANGED FOR EVENT DATA_CHANGED
                             OF CL_GUI_ALV_GRID
                             IMPORTING ER_DATA_CHANGED
                                       E_ONF4
                                       E_ONF4_BEFORE
                                       E_ONF4_AFTER,
    **Double Click Handler
        HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
                                         IMPORTING E_ROW E_COLUMN ES_ROW_NO.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    *       CLASS lcl_event_handler IMPLEMENTATION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
    *Handle Hotspot Click
      METHOD HANDLE_HOTSPOT_CLICK .
        CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
        V_ROW  = E_ROW_ID.
        V_COLUMN = E_COLUMN_ID.
        V_ROW_NUM = ES_ROW_NO.
        MESSAGE I000 WITH V_ROW 'clicked'.
      ENDMETHOD.                    "lcl_event_handler
    *Handle Double Click
      METHOD  HANDLE_DOUBLE_CLICK.
        CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
        V_ROW  = E_ROW.
        V_COLUMN = E_COLUMN.
        V_ROW_NUM = ES_ROW_NO.
        IF E_COLUMN = 'VBELN'.
          SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
          CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
        ENDIF.
        IF E_COLUMN = 'POSNR'.
          MESSAGE I000 WITH 'Click on POSNR row number '  E_ROW.
          "with this row num you can get the data
        ENDIF.
      ENDMETHOD.                    "handle_double_click
    **Handle Data Change
      METHOD HANDLE_DATA_CHANGED.
        CALL METHOD G_GRID->REFRESH_TABLE_DISPLAY
          EXCEPTIONS
            FINISHED = 1
            OTHERS   = 2.
        IF SY-SUBRC NE 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDMETHOD.                    "HANDLE_DATA_CHANGED
    ENDCLASS.                    "LCL_EVENT_HANDLER IMPLEMENTATION
    *&             Global Definitions
    DATA:      G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,"Container
                G_HANDLER TYPE REF TO LCL_EVENT_HANDLER. "handler
    *- Fieldcatalog for First and second Report
    DATA: IT_FIELDCAT  TYPE  LVC_T_FCAT,
          X_FIELDCAT TYPE LVC_S_FCAT,
          LS_VARI  TYPE DISVARIANT.
    *                START-OF_SELECTION
    START-OF-SELECTION.
      SELECT VBELN
             POSNR
             FROM LIPS
             UP TO 20 ROWS
             INTO CORRESPONDING FIELDS OF TABLE ITAB.
    END-OF-SELECTION.
      IF NOT ITAB[] IS INITIAL.
        CALL SCREEN 100.
      ELSE.
        MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
      ENDIF.
    *&      Form  CREATE_AND_INIT_ALV
    *       text
    FORM CREATE_AND_INIT_ALV .
      DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
      CREATE OBJECT G_CUSTOM_CONTAINER
             EXPORTING CONTAINER_NAME = G_CONTAINER1.
      CREATE OBJECT G_GRID
             EXPORTING I_PARENT = G_CUSTOM_CONTAINER.
    * Set a titlebar for the grid control
      CLEAR GS_LAYOUT.
      GS_LAYOUT-GRID_TITLE = TEXT-003.
      GS_LAYOUT-ZEBRA = SPACE.
      GS_LAYOUT-CWIDTH_OPT = 'X'.
      GS_LAYOUT-NO_ROWMARK = 'X'.
      GS_LAYOUT-BOX_FNAME = 'BOX'.
      GS_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
      CALL METHOD G_GRID->REGISTER_EDIT_EVENT
        EXPORTING
          I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
      CREATE OBJECT G_HANDLER.
      SET HANDLER G_HANDLER->HANDLE_DOUBLE_CLICK FOR G_GRID.
    *  SET HANDLER G_HANDLER->HANDLE_HOTSPOT_CLICK FOR G_GRID.
      SET HANDLER G_HANDLER->HANDLE_DATA_CHANGED FOR G_GRID.
    data: ls_outatb like line of itab,
          v_index type sy-tabix.
    DATA: LS_EDIT TYPE LVC_S_STYL,
            LT_EDIT TYPE LVC_T_STYL.
    LOOP AT ITAB INTO ls_outatb WHERE POSNR = '000010'.
        V_INDEX = SY-TABIX.
        LS_EDIT-FIELDNAME = 'VBELN'.
        LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
        LS_EDIT-STYLE2 = SPACE.
        LS_EDIT-STYLE3 = SPACE.
        LS_EDIT-STYLE4 = SPACE.
        LS_EDIT-MAXLEN = 8.
        INSERT LS_EDIT INTO TABLE LT_EDIT.
        INSERT LINES OF LT_EDIT INTO TABLE ls_outatb-handle_style.
        MODIFY ITAB INDEX V_INDEX FROM ls_outatb  TRANSPORTING
                                          HANDLE_STYLE.
      ENDLOOP.
    * setting focus for created grid control
      CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
        EXPORTING
          CONTROL = G_GRID.
    * Build fieldcat and set editable for date and reason code
    * edit enabled. Assign a handle for the dropdown listbox.
      PERFORM BUILD_FIELDCAT.
    * Optionally restrict generic functions to 'change only'.
    *   (The user shall not be able to add new lines).
      PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
    **Vaiant to save the layout
      LS_VARI-REPORT      = SY-REPID.
      LS_VARI-HANDLE      = SPACE.
      LS_VARI-LOG_GROUP   = SPACE.
      LS_VARI-USERNAME    = SPACE.
      LS_VARI-VARIANT     = SPACE.
      LS_VARI-TEXT        = SPACE.
      LS_VARI-DEPENDVARS  = SPACE.
      CALL METHOD G_GRID->REGISTER_EDIT_EVENT
        EXPORTING
          I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
    **Calling the Method for ALV output for First Grid
      CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
          IS_VARIANT           = LS_VARI
          IS_LAYOUT            = GS_LAYOUT
          I_SAVE               = 'A'
        CHANGING
          IT_FIELDCATALOG      = IT_FIELDCAT
          IT_OUTTAB            = ITAB[].
    * Set editable cells to ready for input initially
      CALL METHOD G_GRID->SET_READY_FOR_INPUT
        EXPORTING
          I_READY_FOR_INPUT = 1.
    ENDFORM.                               "CREATE_AND_INIT_ALV
    *&      Form  EXCLUDE_TB_FUNCTIONS
    *       text
    *      -->PT_EXCLUDE text
    FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
    * Only allow to change data not to create new entries (exclude
    * generic functions).
      DATA LS_EXCLUDE TYPE UI_FUNC.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    *&      Form  build_fieldcat
    *       Fieldcatalog
    FORM BUILD_FIELDCAT .
      DATA: L_POS TYPE I.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Delivery'(024).
      X_FIELDCAT-FIELDNAME = 'VBELN'.
      X_FIELDCAT-TABNAME = 'ITAB'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-NO_ZERO    = 'X'.
      X_FIELDCAT-EDIT      = 'X'.
      X_FIELDCAT-OUTPUTLEN = '10'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Item'(025).
      X_FIELDCAT-FIELDNAME = 'POSNR'.
      X_FIELDCAT-TABNAME = 'ITAB'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '5'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
        L_POS = L_POS + 1.
        X_FIELDCAT-SCRTEXT_M = 'Del Date'(015).
      X_FIELDCAT-FIELDNAME = 'LFDAT'.
      X_FIELDCAT-TABNAME = 'ITAB'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '10'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      L_POS = L_POS + 1.
    ENDFORM.                    " build_fieldcat
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      IF G_CUSTOM_CONTAINER IS INITIAL.
    **Initializing the grid and calling the fm to Display the O/P
        PERFORM CREATE_AND_INIT_ALV.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT

  • Do sum in ALV based on the color of the column

    Hi ,
    I have one column in ALV which has color red or green based on the whether to consider it in summationn or not based on some condition. Now I want to do 'Total' of this column, but not all the values should be considered. Instead of that only those values which have color green should be considered. Whether it is possible by capturing the do sum event or something like that? If yes, Please tell me the steps
    Thanks in advance,
    Rgds,
    Madhuri

    Hi,
    Try this :
    IT_FIELDCAT-DATATYPE = 'CURR' .
    IT_FIELDCAT-CFIELDNAME = 'WAERS' " internal table field.
    IT_FIELDCAT-CTABNAME = 'IT_TAB'. " internal table name
    IT_FIELDCAT-FIELDNAME = 'NETPR'." internal table of nettpr field
    IT_FIELDCAT-DO_SUM = 'X'.
    Regards,
    Prashant

  • Dynamic Headers in ALV Based on Different layouts

    Hi Experts,
    I Have a requirement in an ALV Report wherein After the report run as the user chooses different layouts from saved ones the ALV header should change accordingly.
    I'm using Function modules to write the ALV.
    First of all , is it possible? and if yes how?
    Thanks,
    Sachin Soni

    hi rohit ,
    thanks for replying but i think ppl have not understood it clearly.
    I'm not asking about the variants which the user saves before calling the report but rather the layout which after the report run user creates based on what columns he wishes to see at that moment.
    thanks
    sachin soni

  • Sales order item level deliveryblock based on the material's destin country

    Hi Experts
    I have a requirement to set delivery block to an order at the item level based on of country of destination and material.
    -Requirement is to block automatically order line when a material is not authorized (Regulatory affair) to be shipped to the country.
    -We need to allow only authorized person to have ability to remove the block-How can this be set up?
    - Delivery block like these are usually set up for sales org & material (and not country level), the issue here is different countries in same sales org.
    Awaiting for earliest comments
    Thanks
    Banu

    Hi,
    In standard SAP you can not have delivery block at the item level based on the country of destination. Because contry of destination comes from Ship to party master data and material master is not based on the country.
    You need to have development or Exit and Z table. You need to maintain the list of materials allowed to various countries in the Ztable. Exit/development needs to check the table at the time of saving the sales order, 'If there is no table entry, delevery block needs to be maintained on the particular item shipping tab.
    Further you can discuss with your technical consultant about the logic and the possibilities.
    Regards,
    Ravi Duggirala

  • How to get field values in ALV based on user provided input

    Hi,
    In my ALV grid, I have 2 fields:
    1. Material ID
    2. Material Description
    When user provides input to Material ID field, the material Description field should get populated immediately.
    Note: Curretly I am able to do it based on the sy-ucomm = 'Enter', i.e. when the user presses "Enter" outside the ALV grid, I retrieve Description from Mat Table and populate this in Mat_Desc in ALV grid.
    I want to do the same operation whenever tab is pressed (not when user presses enter outside the ALV grid).
    Please provide your inputs for this.
    Thanks & regards,
    Ravish

    Hi Ravish,
    Check <b>BCALV_TEST_GRID_F4_HELP</b> program for F4 help on ALV Grid.
    Thanks
    Venkat.O

  • Conversion of the ABAP Report (ALV based) into BSP Application

    Hello Friends,
    I tried to convert the abap report into a bsp application. I have followed all the steps mentoined in the previous threads regarding this topic.
    I have created a simple Z report in CRM, that displays the business partner details from the table BUT000 based on the partner entered. Partner is the input given to this report. I have defined the partner field in PARAMETERS.
    Now I have written all the code in the onInitialization of the BSP Page looking at the previous threads and also in the layout of the page.
    submit ZTEST_PARTNER
    exporting list to memory and return
    with p_part = 'HR10079430'.
    and also the rest of the code.
    It is working fine. The BSP page is displayed with all the Business Partner details.
    Now the problem is I have another Z report that displays the result in the ALV grid. The report uses the Function Module REUSE_ALV_GRID_DISPLAY to display the output.
    If I use the same method above this is giving a dump, I mean it says the page cannot be displayed.
    So, how should I use the above method to convert the ALV Grid based Z report into a BSP Application.
    Please give your suggestions.
    Thanks & Regards,
    Raju.

    you cannot .
    even if you use a normal report to
    submit the alv grid report
    exporting list to memory and return
    it will show the alv on screen and will nt just export the list to memory.

  • Any option to restrict SE16 record level access based on company code?

    Hi All,
    I have a requirement to restrict record level access in SE16 based on company code.
    Our SAP system has two company codes. The requirement is that users of one company code should not be able to see records of other company code in SE16.
    Is it possible through some exits/badis/other methods?
    Thanks in advance.
    Regards,
    Arun Mohan

    You could write a small front end that accepts the company code, applies custom authorization code for each value and retains or removes, then calls the transaction and enters the selections the user requested and that your authorization check resulting in "passing"....  Of course, you'd have to block those users from "pure" SE16...   I once worked in situation similar, users in one country couldn't see USA data, etc. I think someone wrote an entire new program, called by ZSE16, for that.

  • Filtering top level tabs based on user attributes

    Hello everyone ~
    I've been creating role and workset filters based on the Webinar demonstration given by Marion Schlotte (<a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/17968de1-0a01-0010-1f9f-c090fbc7001a">Filtering Role and Workset Content for Developers</a>) and things have been going well.  I've been assigning the filter to a role (an entry-point role) and then filtering what worksets the user sees at the second level navigation.
    Now what I'm trying to do is filter what top-level tabs the user sees using this filter.  So I assigned the worksets in the role as entry points, instead of the role itself being an entry point.  However, the filter doesn't work now.  I don't see any of the worksets in the top level navigation at all.  I also don't see any errors in the logs.  All of the messages I have logged during the filtering process are logging as normal, and I don't see any errors being thrown.  But still the top-level tabs for my worksets don't appear.
    Has anyone been testing with this functionality?  Why would setting the worksets as entry points cause the filter to no longer work?  Has anyone tried this, or have any ideas?
    Thanks for your help,
    Fallon

    Hi Will,
    I'm thinking on using this filtering approach to solve another problem... But for that, I need this filtering to work based on URL entered, not on the logged in user.
    I was thinking about implementing the method
    getObjectInstance(obj, name, nameCtx, environment)
    from
    FilterDemoCountryFactory
    to perform the filter based on URL (from context or environment). Do you know if this information (URL) is available in Context ou in Environment (hashtable)??
    Thanks in advance.
    Best regards,
    Raphael

  • Setting an app level item based on :APP_USER

    I am trying to set an application level item right after I log in and I want the value to be based on the setting of :APP_USER. I created an application level process at the "On New Session: After Authentication" point containing the following code:
    select id into :F107_VOTER
    from el_person
    where userid = :APP_USER;
    This works fine when I run the page from the builder, but fails when I fire up a separate browser session and access the app directly. I'm suspicious that perhaps APP_USER built in item is not defined when the process point runs. Can someone confirm when APP_USER is set relative to this application level process point and/or perhaps suggest an alternative way to initialize an application level item that is dependent on APP_USER?

    Bill,
    The first page that runs in your new session is the login page. So your process runs at the very first opportunity (On New Session:After Authentication) when APP_USER is null, which doesn't do what you want. The name of that process point is misleading, it means after authentication for the current page. For the login page, which is necessarily a public page, the authentication steps are completed immediately after the show processing begins. So then you enter username/password and submit the login page which takes you to the first real page in the app, but still in that same session, but the process has already fired and won't run again.
    I suggest that you create another application item, F107_VOTER_INITIALIZED, change the process point to be Before Header, add a condition so that it runs only if F107_VOTER_INITIALIZED is null, then have the process run the query and set the initialization flag to a non-null value. Of course F107_VOTER itself can be the initialization flag if it is to remain constant throughout the session.
    Scott

  • Using Page/Portlet level  BackingFile based approach in Oracle Portal 11g

    Hi,
    I have a portal application that is running on Weblogic Portal 10.2, which is based on portlet/page level backing files. We are looking to upgrade to 11g now.
    I installed the Oracle 11g instalation (with web center) but that does not support any of the weblogic's backing file based portlets.
    I am not sure if i needed to install Oracle Portal 11g or is there also a separate weblogic portal 11g that we can upgrade to?
    If Oracle Portal 11g is what i need to install, then is thre a way we can continue to support the weblogic backing file based portlets in Oracle Portal 11g?
    Thanks,

    The new WebCenter portlet container does not, by default, directly support WebLogic Portal-style .portlet files and their corresponding WLP-specific features (i.e. backing files, WLP-native IPC, forked render, etc.) However, the WebCenter portlet container is a full java portlet 2.0 (JSR 286) and WSRP 2.0 container. Many things you could do with backing files and WLP-specific technology can be done with JSR 286 java portlet classes.
    Additionally, WebCenter portal framework, spaces, and ADF contains a WSRP 2.0 complaint consumer. So, you can keep your WebLogic Portal server and application running, and consume the individual portlets into a WebCenter webapp over WSRP. See http://download.oracle.com/docs/cd/E17904_01/webcenter.1111/e10148/jpsdg_pages.htm#CIHDCBGC for more information. You WLP webapp's WSDL URL will normally be of the format http://<host>:<port>/<webapp>/producer?WSDL, e.g. http://localhost:7001/www/producer?WSDL
    Greg

  • 3 level ALV grid display

    Hi,
    i have a ALV report on the line selection it will call a ZFM and displays 2nd ALV report.
    In 2nd ALV report based on selection it will display 3rd ALV report.
    My requirement is on selection of BACK button in 3rd ALV, i need to display 1st ALV.
    any suggestions will be helpful
    Giri

    Giri,
    after the 3rd ALV display in code,
    u can write as
    If sy-ucomm eq 'BACK'. " ur code for back button
    leave to screen 0.
    endif.
    Regards
    Syed A.

  • CRM 2015 - How to limit Field Level Security based on unit/subunit ?

    Hello,
    I have a problem with field level security. 
    I have entity entityX, and then have set of financial fields on this entityX.
    These fields are under field level security profile named "Financials".
    Next, I have a team which can read/write those fields. This team "Team1" is in business unit called "Subunit1".
    "Team1" has a role "ReadWholeOrganization", which enables it to read entityX from complete organization.
    "Team1" also has a role "WriteOwnOrganization", which enables users from this team to read and change entityX in his unit and sub-units.
    How can I disable "Team1" users to see financial data for entityX, if entityX is  owned by users outside "Team1" users unit?
    In other words,  i want "Team 1" users to see all entityX entities based on "ReadWholeOrganization" role, but I don't want them to see financial data for complete organization. I want "Team1" to see financial data only
    for their unit and subunits.
    How can I solve this?
    Extracting financial fields in another entity is out of the question.

    Write javascript to hide the fields if you need to hide them just from the form. Here is
    sample to assist.  However this way they will still see the fields in Advanced Find. 
    Hope this helps.
    Minal Dahiya
    blog : http://minaldahiya.blogspot.com.au/
    If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

Maybe you are looking for

  • Delivery vs Invoice in Sales A/R  --- Return vs A/R Credit Memo

    1. What is the difference & relation between Delivery in Sales-A/R vs Invoice in Sales-A/R? They both similar. Does it mean we can make Delivery only and skip Invoice? According to definition: 'The Delivery is a legally binding document indicating th

  • How to use multithreads in servlet or beans?

    I need a servlet to run every 2 minutes to refresh a application varible.How can I do this?Please show me code examples,Thanks!!

  • How to create a new Structure of Data screen and screen sequence

    Hi, Can you give any link or explain all the steps required to create a new structure of data screen and how to assign it to our comapnay code or plant etc.  also when i check the screen ref. which is assign to material type in OUR system i ROH but i

  • Stacked canvasses changing color when changing subclassed VA colors

    I am using Forms developer 10g and I have a visual attribute STD_CURRENT_RECORD in my object library which is subclassed in all forms in the application. This VA is referenced from the 'Current record visual attribute' property (and nowhere else) of

  • Shipping conditions in sales order Header

    Hi  For certain users , field shipping conditions  VSBED (Header)  needs to be  in display mode only in T-code Va02 i am creating a security object and that will be assigned to those  user roles. I need user exit which can be used to trigger this cha