F4 help in Editable ALV

Hello Experts,
We have a requirement of showing F4 help for a editable field of ALV Grid. I'm able to register the on_f4 event, but I do have a problem while implementing the method, as the pop up values are not appearing. I have used following logic for implementing the class(PFB the code I have used for implementing the method). Can you please suggest the corrections in the following code or suggest a new method, if the following will not work.
  METHOD on_f4.
  TYPE-POOLS: slis.
        DATA: gs_selfield TYPE slis_selfield,
              gs_private TYPE slis_data_caller_exit,
              g_exit(1) TYPE c,
              gs_fieldcat_popup TYPE slis_fieldcat_alv.
        DATA: gt_fieldcat_popup TYPE TABLE OF slis_fieldcat_alv,
              pt_value type standard table of ztable.
    SELECT * FROM ztable
    INTO TABLE pt_value.
        gs_fieldcat_popup-fieldname   = 'Z_SALES'.
        gs_fieldcat_popup-seltext_l   =  'Sales'.
        gs_fieldcat_popup-col_pos     = 1.
        gs_fieldcat_popup-outputlen   = 34.
        gs_fieldcat_popup-datatype    = 'CHAR'.
        APPEND gs_fieldcat_popup TO gt_fieldcat_popup .
   CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
      EXPORTING
      I_TITLE                       =
      I_SELECTION                   = 'X'
      I_ZEBRA                       = ' '
      I_SCREEN_START_COLUMN         = 0
      I_SCREEN_START_LINE           = 0
      I_SCREEN_END_COLUMN           = 0
      I_SCREEN_END_LINE             = 0
      I_CHECKBOX_FIELDNAME          =
      I_LINEMARK_FIELDNAME          =
      I_SCROLL_TO_SEL_LINE          = 'X'
        i_tabname                     = '1'
      I_STRUCTURE_NAME              =
       IT_FIELDCAT                   = gt_fieldcat_popup[]
      IT_EXCLUDING                  =
      I_CALLBACK_PROGRAM            =
      I_CALLBACK_USER_COMMAND       =
      IS_PRIVATE                    =
    IMPORTING
      ES_SELFIELD                   =
      E_EXIT                        =
      tables
        t_outtab                      = pt_value
    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.
  ENDMETHOD.
Best Regards,
Bharath.

Hello ,
while implementing F4 for Editable ALV , you need to make sure follwing steps.
1. Field Catalog.
     gs_fieldcat-f4availabl = 'X '.
2.Register f4 event.
      gs_f4-fieldname  = 'CONNID'.
      gs_f4-getbefore  = check.
      gs_f4-chngeafter = change.
      append gs_f4 to gt_f4.
      call method grid->register_f4_for_fields
        exporting
          it_f4 = gt_f4.
3.Implementing F4 Method.

Similar Messages

  • Exception while creating f4 help for editable alv field

         hi experts
    i have created search help for editable alv field by following link
    http://scn.sap.com/docs/DOC-39832
    But i m getting an exception :  Field symbol has not yet been assigned.
    exception area code
       read table <tab1> into <ls_wa> index i_row_id.
        assign component m_cl_variant->ms_layout-stylefname
               of structure <ls_wa> to <l_field>.
        read table <l_field> into ls_style
                with table key fieldname = is_col_id-fieldname.
        if sy-subrc eq 0.
          if ls_style-style o mc_style_enabled.
            ready_for_input = 1.
            exit.
          elseif ls_style-style o mc_style_disabled.
            ready_for_input = 0.
            exit.
          endif.
    first read statement is giving sy-subrc =4.
    PS: exception from method..:IS_READY_FOR_INPUT
    kindly help

    Hello Ankush,
    read table <tab1>  ASSIGNING <ls_wa> index i_row_id.
    IF  <ls_wa> IS ASSIGNED.
        assign component m_cl_variant->ms_layout-stylefname
               of structure <ls_wa> to <l_field>.
        read table <l_field> into ls_style
                with table key fieldname = is_col_id-fieldname.
        if sy-subrc eq 0.
          if ls_style-style o mc_style_enabled.
            ready_for_input = 1.
            exit.
          elseif ls_style-style o mc_style_disabled.
            ready_for_input = 0.
            exit.
          endif.
    ENDIF.
    Regards,
    TP

  • F4 help -- on editable alv field.

    <b><i>Hi ABAPers,</i></b>
    <i><b>I want to incorporate F4 help with the editable field of my ALV report.</b></i>
    The editable field is type of IHPA-PARNR.
    At present user is able to enter value at this field. but the requirement is to give F4 help there.
    I am not using the OOPs alv.
    <i><b>Please suggest me
    Thanks in advance
    Regards
    Debjani</b></i>

    For F4 help, you must register the fields whose F4 request will trigger the “onf4” event. For this you must prepare a table of type “LVC_T_F4” and register this table using the method “register_f4_for_fields”. While preparing table you must include a line for each field which will trigger F4 event. For each field in the structure;
    - Pass the fieldname to ‘FIELDNAME’
    - Set ‘REGISTER’ to make the field registered,
    - Set ‘GETBEFORE’ to provide field content transport before F4 in editable mode
    - Set ‘CHNGEAFTER’ to make the data changed after F4 in editable mode.
    DATA: lt_f4 TYPE lvc_t_f4 WITH HEADER LINE .
    lt_f4-fieldname = 'Your field name'.
    lt_f4-register = 'X' .
    lt_f4-getbefore = 'X' .
    APPEND lt_f4 .
    CALL METHOD gr_alvgrid->register_f4_for_fields
    EXPORTING
    it_f4 = lt_f4[] .
    A sample “onf4” method implementation
    METHOD handle_on_f4 .
    PERFORM f4_help USING e_fieldname es_row_no .
    er_event_data->m_event_handled = 'X' .
    ENDMETHOD .
    The attribute “er_event_data->m_event_handled” is to prevent further processing of standard F4 help.

  • Step to step document for F4 Help in Editable ALV

    Hi Gurus,
        I am new to Web Dynpros,
    It would be great if any one of you can send me a document for creating a F4 help for individual cells of an Editable Table....
    Its Very Urgent.....
    Pleas mail me @ [email protected]
    Points will be awarded to the useful answers / documents....

    Hello Kiran,
    In your context structure, where you have defined your context nodes and attributes, select the attribute for which you would like to have an F4 help and select the type of input help in the properties table underneath.
    Regards,
    Neha

  • Search Help For An Editable ALV List

    Hi,
    All ABAP Gurus !!
    I have made an Editable ALV with the fields of ZTable. In ALV I want the search help in one of the columns.The entry in that should come from the standard table name-TVM5 and the field which should come is MVGR5. MVGR5  does not contain the search help .Following are the description for my ZTable-------
    Field Name    - MC_NO,
    Data Element - ZZMC_NO1,
    Domain          -ZZMC_NO1.
    While creating this ZTable, in the Entry help/check tab I have also mention Input help with fixed values in the column- Origin of the input help and entered the entries also.
    About ALV (Only one alv column is shown here for reference in which search help or input help is needed of all the possible entries)---
    DATA: INT_FIELDCATALOG2 TYPE LVC_T_FCAT WITH HEADER LINE.
    DATA: WA_FIELDCATALOG2  TYPE LVC_S_FCAT ,
               WA_LAYOUT2        TYPE SLIS_LAYOUT_ALV ,
              GD_LAYOUT2        TYPE LVC_S_LAYO.     "slis_layout_alv.
      WA_FIELDCATALOG2-FIELDNAME      = 'MC_NO'.
      WA_FIELDCATALOG2-TABNAME        = 'T_ITAB2'.            " T_ITAB2 contains all the other fields
      WA_FIELDCATALOG2-SCRTEXT_M     = 'Machine No.'.
      WA_FIELDCATALOG2-EDIT                  = 'X'.
      WA_FIELDCATALOG2-F4AVAILABL   = 'X'.
      WA_FIELDCATALOG2-REF_FIELD       = 'MVGR5'.
      WA_FIELDCATALOG2-REF_TABLE     = 'TVM5'.
    APPEND WA_FIELDCATALOG2 TO INT_FIELDCATALOG2.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          I_CALLBACK_PROGRAM              = V_REPID
          I_CALLBACK_PF_STATUS_SET   = 'SET_PF_STATUS1'
          I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
          IT_FIELDCAT_LVC                        = INT_FIELDCATALOG2[]
          IS_LAYOUT_LVC                         = GD_LAYOUT2
        TABLES
          T_OUTTAB                 = T_ITAB2.
    Please explain in detail
    Thanks to all in advance.

    Please check the following links :
    F4 help -- on editable alv field.
    F4 help in editable ALV
    ALV Editable Grid Control F4 help problem
    And search the forum for  f4 help on editable alv
    KR
    Veeranji Reddy P.

  • F4 help for REUSE ALV grid

    Hi,
    I am doing an ALV report using REUSE_ALV_GRID_DISPLAY . This is my requirement
    If user press F4 in field in WERKS then i need to get values from table T001W and also from my custom table YT001W and display, so user can select from the f4 list.
    How to do this.
    Your help is appreciated
    Sa_R

    DATA : alvgrid TYPE REF TO cl_gui_alv_grid,
    custom_container TYPE REF TO cl_gui_custom_container,
    fieldcatalog TYPE lvc_t_fcat.
    table to contain fields that require f4...............................
    DATA : lt_f4 TYPE lvc_t_f4 WITH HEADER LINE.
    ok_code declaration...................................................
    DATA : ok_code TYPE sy-ucomm.
    Tables declaration....................................................
    TABLES : zaemp.
    Types declaration.....................................................
    TYPES : BEGIN OF ty_emp,
    code LIKE zaemp-code,
    designation LIKE zaemp-designation,
    END OF ty_emp.
    Internal table declaration............................................
    DATA : i_emp TYPE TABLE OF ty_emp.
    Workarea declaration..................................................
    DATA : wa_emp TYPE ty_emp.
    Selection screen parameters...........................................
    SELECT-OPTIONS : s_code FOR zaemp-code.
    CLASS lcl_event_handler DEFINITION
    CLASS lcl_event_handler DEFINITION.
    PUBLIC SECTION.
    METHODS :
    handle_on_f1 FOR EVENT onf1 OF cl_gui_alv_grid
    IMPORTING e_fieldname es_row_no er_event_data,
    handle_on_f4 for event onf4 of cl_gui_alv_grid
    importing e_fieldname es_row_no er_event_data
    ENDCLASS.
    CLASS lcl_event_handler IMPLEMENTATION
    CLASS lcl_event_handler IMPLEMENTATION.
    METHOD handle_on_f1.
    custom f1 help for code field.......................................
    IF e_fieldname = 'code'.
    CALL SCREEN 3001.
    ENDIF.
    to prevent processing of standard f1 help............................
    er_event_data->m_event_handled = 'X'.
    ENDMETHOD.
    Method handle_on_f4.
    standard f4 help will be invoked......................................
    endmethod.
    ENDCLASS.
    start of selection....................................................
    START-OF-SELECTION.
    SELECT code designation FROM zaemp
    INTO CORRESPONDING FIELDS OF TABLE i_emp
    WHERE code IN s_code.
    CALL SCREEN 3000.
    *& Module STATUS_3000 OUTPUT
    text
    MODULE status_3000 OUTPUT.
    SET PF-STATUS 'ZTOOL'.
    SET TITLEBAR 'ZTITLE'.
    IF alvgrid IS INITIAL.
    CREATE OBJECT custom_container
    EXPORTING
    container_name = 'ZCONTAINER'.
    CREATE OBJECT alvgrid
    EXPORTING
    i_parent = custom_container.
    PERFORM prepare_f4.
    CALL METHOD alvgrid->register_f4_for_fields
    EXPORTING
    it_f4 = lt_f4[]
    creating instance for event handler..................................
    DATA : event_handler TYPE REF TO lcl_event_handler.
    CREATE OBJECT event_handler.
    SET HANDLER event_handler->handle_on_f1 FOR alvgrid.
    SET HANDLER event_handler->handle_on_f4 FOR alvgrid.
    preparing field catalog..............................................
    PERFORM prepare_fieldcatalog CHANGING fieldcatalog.
    CALL METHOD alvgrid->set_table_for_first_display
    EXPORTING
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    IS_LAYOUT =
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    CHANGING
    it_outtab = i_emp
    it_fieldcatalog = fieldcatalog
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR = 2
    TOO_MANY_LINES = 3
    others = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.
    ENDMODULE. " STATUS_3000 OUTPUT
    preparing field catalog...............................................
    FORM prepare_fieldcatalog CHANGING i_fieldcatalog TYPE lvc_t_fcat.
    DATA : ls_fcat TYPE lvc_s_fcat.
    ls_fcat-fieldname = 'code'.
    ls_fcat-ref_table = 'zaemp'.
    ls_fcat-coltext = 'EMPLOYEE ID'.
    APPEND ls_fcat TO i_fieldcatalog.
    CLEAR ls_fcat.
    ls_fcat-fieldname = 'designation'.
    ls_fcat-ref_table = 'zaemp'.
    ls_fcat-coltext = 'EMPLOYEE NAME'.
    APPEND ls_fcat TO i_fieldcatalog.
    ENDFORM.
    *& Module USER_COMMAND_3000 INPUT
    text
    MODULE user_command_3000 INPUT.
    CASE ok_code.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_3000 INPUT
    *& Module USER_COMMAND_3001 INPUT
    text
    MODULE user_command_3001 INPUT.
    CASE ok_code.
    WHEN 'SAVE'.
    LEAVE TO SCREEN 0.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_3001 INPUT
    *& Module STATUS_3001 OUTPUT
    text
    MODULE status_3001 OUTPUT.
    SET PF-STATUS 'GUI'.
    SET TITLEBAR 'TITLE'.
    ENDMODULE. " STATUS_3001 OUTPUT
    preparing fields to be registered for f4 help.........................
    FORM prepare_f4.
    lt_f4-fieldname = 'designation'.
    lt_f4-register = 'X'.
    lt_f4-getbefore = 'X'.
    lt_f4-chngeafter = 'X'.
    APPEND lt_f4.
    ENDFORM.
    Hi
    For creating the F4 Help see the sample code and do accordingly
    See the following ex:
    TYPES: BEGIN OF TY_MBLNR,
    MBLNR LIKE MKPF-MBLNR,
    END OF TY_MBLNR.
    DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.
    data: it_ret like ddshretval occurs 0 with header line.
    At selection-screen on value-request for s_mat-low.
    Select MBLNR from mkpf into table it_mblnr.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    DDIC_STRUCTURE = ' '
    RETFIELD = 'MBLNR'
    PVALKEY = ' '
    DYNPPROG = ' '
    DYNPNR = ' '
    DYNPROFIELD = ' '
    STEPL = 0
    WINDOW_TITLE =
    VALUE = ' '
    VALUE_ORG = 'S'
    MULTIPLE_CHOICE = ' '
    DISPLAY = ' '
    CALLBACK_PROGRAM = ' '
    CALLBACK_FORM = ' '
    MARK_TAB =
    IMPORTING
    USER_RESET =
    TABLES
    VALUE_TAB = IT_MBLNR
    FIELD_TAB =
    RETURN_TAB = IT_RET
    DYNPFLD_MAPPING =
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 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.
    IF SY-SUBRC = 0.
    read table it_ret index 1.
    move it_ret-fieldval to S_mat-low.
    ENDIF.
    Go through the test program.
    REPORT Ztest_HELP .
    TABLES : MARA.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_MATNR(10) TYPE C.
    SELECTION-SCREEN END OF BLOCK B1.
    DATA : BEGIN OF ITAB OCCURS 0,
    MATNR TYPE MATNR,
    END OF ITAB.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.
    SELECT MATNR
    FROM MARA
    INTO TABLE ITAB
    UP TO 10 ROWS.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    RETFIELD = 'MATERIAL NUMBER'
    DYNPPROG = SY-REPID
    DYNPNR = SY-DYNNR
    DYNPROFIELD = 'P_MATNR'
    VALUE_ORG = 'S'
    TABLES
    VALUE_TAB = ITAB
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3.
    F4 help -- on editable alv field.
    The specified item was not found.
    Message was edited by:
            Karthikeyan Pandurangan

  • Search help for date field in Editable ALV

    Hello Friends,
    I am using editable alv using 'reuse_* '.
    I have used date as input field. While creating fieldcatlog also i have  declared dat as a mkpf-budat.
    But i am not getting serach help for date in output.
    Is it possible with reuse or i have to go by object oriented ?

    Hi,
    Just pass the Edit option of the fieldcatalog for those specific fields...
    fcat-edit = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-cprog
          i_callback_pf_status_set = 'PF_STATUS_SET'
          i_callback_user_command  = 'USER_COMMAND'    "<----  pass this
          i_callback_top_of_page   = 'TOP'
          is_layout                = it_layout
          it_fieldcat              = it_fcat
          i_default                = 'X'
          i_save                   = 'A'
          it_events                = it_event
        TABLES
          t_outtab                 = it_final
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    *&      Form  USER_COMMAND
    *       text
    *      -->R_UCOMM      text
    *      -->RS_SELFIELD  text
    FORM user_command USING r_ucomm LIKE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&DATA_SAVE'.                "<-------check this
          PERFORM save_data.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND

  • Editable ALV : Need PERNR & ENAME on PERNR F4 help

    Dear Friends,
    I have created a GRID ALV for my customized HR module. In this ALV, there is a field PERNR and alongwith that there is another field ENAME.
    PERNR field is editable & supported with F4 help. My requirement is like, when I change the PERNR, say, I clicked on F4 help (PREM - for PERNR) & select any PERNR, then automatically, the ENAME should get changed.
    My requirement can also be achieved, if after getting the New PERNR, the user presses the ENTER button, then the ENAME of the PERNR should also get updated.
    I tried to check the way with which SAP is going through the whole process by debugging (/H method).
    But on clicking ENTER the control remains doesn't go anywhere, that means ENTER is not considered as an EVENT. Also, when I click on F4 Help button, the control remains in SAPLSLVC_FULLSCREEN program & it doesn't come in my Z report.
    My problem can be solved in one of the following ways :
    1). Can someone please tell me the way to get customized F4 help in GRID ALV & also how can I
    populate ENAME alongwith PERNR in one go.
    2). Any example code of OOPS ALV with this scenario. (I know, this can be done with OOPS
    methods, but I'm novice in OOPS).
    OR any other possible way, that you think can solve my problem.
    PLS DON'T GIVE THE SOLUTION TO CHECK BCALV REPORTS ... I've already checked those, but there is so much functionality included that it is very difficult to understand a single functionality from those.
    Waiting for your replies Gurus ...
    Thanks & Regards,
    Mohit Grover

    Hi,
    class lcl_event_receiver definition.
      public section.
        methods:
          handle_data_changed
             for event data_changed of cl_gui_alv_grid
                 importing er_data_changed.
        methods: check_price
         importing
            ps_good_price type lvc_s_modi
            pr_data_changed type ref to cl_alv_changed_data_protocol.
    endclass.                    "lcl_event_receiver DEFINITION
    class lcl_event_receiver implementation.
      method handle_data_changed.
        data: ls_good type lvc_s_modi.
        loop at er_data_changed->mt_good_cells into ls_good.
          case ls_good-fieldname.
    * check if column PLANETYPE of this row was changed
            when 'PRICE'.
              call method check_price
                exporting
                  ps_good_price   = ls_good
                  pr_data_changed = er_data_changed.
          endcase.
        endloop.
      endmethod.                    "handle_data_changed
      method check_price.
        data: l_price type sflight-price.
        call method pr_data_changed->get_cell_value
          exporting
            i_row_id    = ps_good_price-row_id
            i_fieldname = ps_good_price-fieldname
          importing
            e_value     = l_price.
        read table t_sflight into fs_sflight index sy-tabix.
        if sy-subrc = 0.
          move l_price to fs_sflight-cost.
          modify t_sflight from  fs_sflight
                           transporting price cost
                           where carrid = fs_sflight-carrid
                           and connid = fs_sflight-connid.
         endif.
        endmethod.
    or use the standard program BCALV_EDIT_03 if any dought pls let me know!!
    thanks
    ravi

  • ALV: Search help for editable column using OVS/Input Help Component Usage?

    Hi all,
    Is is possible to assign a value help like OVS or "Input Help Component Usage" to a editable ALV column using Web Dynpro?
    Thanks and regards,
    Ulrich

    Hi Madhu,
    Than I must have made something wrong because this is exactly what I've tried.
    I'll check my freely prgrammed value  and the assigning again.
    Thanks a lot for your quick reply.
    Ulrich

  • Explicit Search Helps Short-Dump in Editable ALV with included structure

    I have an editable ALV grid defined as follows:
      TYPES: BEGIN OF gs_outtab200.
        TYPES: row_indx(4)      TYPE n.
        TYPES: multipurp        TYPE c.
        INCLUDE structure zxrfwc_test.
      TYPES: end of gs_outtab200.
      DATA:
        gt_outtab200             TYPE TABLE OF gs_outtab200,
        wa_outtab200             TYPE gs_outtab200.
    The included structure zxrfwc_test has a component (field) which is defined with a data element that has an explicit search helps associated with it.
    I know that this search help is working properly because it works fine in the program's selection screen.
    But when I invoke the search help from within a column of the ALV itself, I get a short dump with a "GETWA_NOT_ASSIGNED" error.
    I have done plenty of editable ALVs with search helps defined on the data elements and never encountered this problem. 
    Am I hitting this problem because the zxrfwc_test structure is defined within the
    gs_outtab200 structure ??
    If not, what is causing this problem.  (Please note that I have set  ls_fcat-F4AVAILABL = 'X' in the fieldcat routine - this doesn't seem to help at all.)
    Please advise!!!!
    I'm really stuck on this one because it's always worked before when I'm not dealing with a dictionary structure that's included within a larger ALV structure.
    Thanks.

    Hi,
    How you are creating your field catalog?
    Try to create a field catalog in the following way giving reference to your structure. is it possible for you create a DDIC structure as same as
    TYPES: BEGIN OF gs_outtab200.
        TYPES: row_indx(4)      TYPE n.
        TYPES: multipurp        TYPE c.
        INCLUDE structure zxrfwc_test.
      TYPES: end of gs_outtab200.
    * Form f_generate_fieldcatalog                                         *
    * Form generate the field catalog table                                *
    form f_generate_fieldcatalog.
    * Private variable
      data : v_structure like dd02l-tabname.   " Table Name
      v_structure = c_yatt_alv.                      " Structure Name
    * Build the fieldcat according to DDIC structure YATT_ALV:
      call function 'LVC_FIELDCATALOG_MERGE'
        exporting
          i_structure_name       = v_structure
          i_client_never_display = c_x
        changing
          ct_fieldcat            = i_fieldcat[].
    endform.                                 " F_generate_fieldcatalog

  • Editable ALV with F4 help

    Hi Gurus,
    I have created an editable ALV with F4 help, but the value doesnt reflect in the F4 help.
    Regards,
    Chinmaya

    Hi Chinmaya,
    Include the field F4AVAILABL in your field catalog internal table.
    itab_fieldcatalog-F4AVAILABL = X
    if you are not using the data element for the field 'F4' help won't come. in this situation, use the ONF4 event to build the F4 Help.
    Reward if found helpful.
    Regards,
    Boobalan Suburaj

  • Check unchanged data in an editable alv grid

    Hi,
    I have a problem with my editable ALV. As long as I'm changing my data the event DATA_CHANGED is raised and my fields are checked correctly. But what about unchanged data like appended rows. In that case no changes have been made and the event is not triggered.
    Even if i raise the event by using the method:      
    CALL METHOD gr_grid1->check_changed_data
        IMPORTING
          e_valid   = lv_valid
        CHANGING
          c_refresh = lv_refresh.
    there are no changed data so that my checks:
    FORM data_changed USING  lr_data_changed TYPE REF TO
                                             cl_alv_changed_data_protocol.
      DATA: ls_mod_cells TYPE lvc_s_modi.
      DATA: ls_cells TYPE lvc_s_modi,
            lv_value TYPE lvc_value ,
            lv_matnr TYPE matnr,
            lv_maktx TYPE maktx,
            lv_error TYPE c.
      CLEAR lv_error.
      LOOP AT lr_data_changed->mt_good_cells INTO ls_mod_cells.
        CASE ls_mod_cells-fieldname.
          WHEN 'MATNR'.
            CALL METHOD lr_data_changed->get_cell_value
              EXPORTING
                i_row_id    = ls_mod_cells-row_id
                i_fieldname = 'MATNR'
              IMPORTING
                e_value     = lv_value.
    * CHECK MARA SEGMENT
            SELECT SINGLE mara~matnr
                          makt~maktx INTO (lv_matnr,
                                           lv_maktx)
                                      FROM mara AS mara
                                INNER JOIN makt AS makt
                                        ON mara~matnr = makt~matnr
                                WHERE mara~matnr = lv_value AND
                                      makt~spras = sy-langu.
            IF NOT sy-subrc IS INITIAL.
              CALL METHOD lr_data_changed->add_protocol_entry
                EXPORTING
                  i_msgid     = 'M3'
                  i_msgno     = '305'
                  i_msgty     = 'E'
                  i_msgv1     = lv_value
                  i_fieldname = ls_mod_cells-fieldname
                  i_row_id    = ls_mod_cells-row_id.
              lv_error = 'X'.
            ELSE.
              CALL METHOD lr_data_changed->modify_cell
                EXPORTING
                  i_row_id    = ls_mod_cells-row_id
                  i_fieldname = 'MAKTX'
                  i_value     = lv_maktx.
            ENDIF.
          WHEN OTHERS.
        ENDCASE.
      ENDLOOP.
    ENDFORM.
       are not working.
    Thank you for your help
    Gregor
    Edited by: Gregor Sure on Oct 13, 2009 1:58 PM

    Try to capture the event DATA_CHANGED_FINISHED. You can use the method REGISTER_EDIT_EVENT of the class CL_GUI_ALV_GRID to register the edit events.
    Regards,
    Naimesh Patel

  • Check_changed_data method on editable ALV Grid ( class cl_gui_alv_grid)

    Hi guys,
    I use the following method (register_edit_event) in the PBO soon after first display of an editable ALV grid to register enter as an event to do validations on fields like qty. If user enters some character like 'abc' for qty and hits enter on keyboard, ALV grid pop's up a standard message ( I haven't coded for this.Since I use DDIC structure in field catalog, the Std. ALV program takes care of it. ). THis takes care of the validation before I click on save.
    call method alv_grid->register_edit_event
                            exporting
                               i_event_id = cl_gui_alv_grid=>mc_evt_enter.
    This works fine. But I want this validation to run when I also click the SAVE button of the screen. Is it possible to run this standard validation in my PAI event eg. SAVE ? I thought I will be, by calling the method check_changed_data in my PAI event. But this is doing nothing. Does this method conflict with register_edit_event or something ? So , basically what I am looking for is to trigger the event or call the method which does the same work as the "check" button on ALV grid.
    Any advice or tips or sample code is greatly appreciated.
    Thanks,
    Shareen

    Hi Shareen,
    Handle the data_changed event in the grid.
    Whenever you make changes in the data in ALV Grid this event would be triggered. Here you can perform additional validations that you may need to perform.
        METHODS handle_data_changed
          FOR EVENT data_changed OF cl_gui_alv_grid
          IMPORTING er_data_changed.
    Implementation:
      METHOD handle_data_changed.
        PERFORM validations USING er_data_changed.
      ENDMETHOD.
    FORM validations USING er_data_changed TYPE REF TO cl_alv_changed_data_protocol.
      DATA: ls_good TYPE lvc_s_modi.
      DATA  wa LIKE LINE OF lt_good_cells.
      CALL METHOD g_grid->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_modified.
      LOOP AT er_data_changed->mt_good_cells INTO ls_good.
        CASE ls_good-fieldname.
        WHEN 'FIELDNAME'. "Your fieldname
            CALL METHOD er_data_changed->get_cell_value "Get the changed value
              EXPORTING
                i_row_id    = ls_good-row_id
                i_fieldname = ls_good-fieldname
              IMPORTING
                e_value     = temp. "Your temp variable
            "Make your validations here.
        ENDCASE.
    Ps: Reward points if helpful.
    Regards,
    Wenceslaus.

  • Capture contents from an editable alv

    I'm trying to capture fields from an editable alv. I have an update button in the application toolbar. So when i press this button, whatever changes I have done on the screen, the internal table should get updated. I'm using the function module    REUSE_ALV_GRID_DISPLAY.
    Can anybody help me out??

    Yes you can,
    If you have access to the element in the context that is bound to the row in the ALV then you can connect the message. Marking a * is not possible by default with the WD message manager and you willl need to do it manually. Use the element method of the message manager API for this purpose.

  • Regarding editable alv

    Hi all,
              Frnds i am working in editable alv using function modules not object oriented abap.
    i m trying to edit a Field(MATNR ) in my output list and finally update it with changed values in the DB table.
    But i m getting syntax error like
    "the work area i_final is not alligned properly
    below i m providing my code.
    <code>
    *& Report  ZEDITABLE_ALV1
    REPORT  ZEDITABLE_ALV1.
    TABLES: vbak,vbap.
    TYPE-POOLS: slis. "ALV Declarations
    data: BEGIN OF i_final occurs 0,
          vbeln like vbap-vbeln,
          posnr like vbap-posnr,
          matnr like vbap-matnr,
          erdat like vbap-erdat,
    END OF i_final.
    DATA : C_X(1) TYPE C VALUE 'X',
           C_FC_MODIFY(6) TYPE C VALUE 'MODIFY'.
    *DATA: i_final TYPE STANDARD TABLE OF T_FINAL with header line.
         i_temp type standard table of T_FINAL with header line.
    *wa_final like line of i_final.
    *DATA:i_final LIKE vbap OCCURS 0.
    *DATA:wa_final LIKE vbap.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
    gd_tab_group TYPE slis_t_sp_group_alv,
    gd_layout TYPE slis_layout_alv,
    gd_repid LIKE sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    PERFORM data_retrieval.
    PERFORM build_fieldcatalog.
    PERFORM build_layout.
    PERFORM display_alv_report.
    *& Form BUILD_FIELDCATALOG
    *•     Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
    fieldcatalog-fieldname = 'VBELN'.
    fieldcatalog-seltext_m = 'sales order'.
    fieldcatalog-col_pos = 0.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'ERDAT'.
    fieldcatalog-seltext_m = 'date'.
    fieldcatalog-col_pos = 1.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'MATNR'.
    fieldcatalog-seltext_m = 'material no.'.
    fieldcatalog-col_pos = 2.
    fieldcatalog-edit = 'X'.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'POSNR'.
    fieldcatalog-seltext_m = 'line item no.'.
    fieldcatalog-col_pos = 3.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-FIELDNAME = 'REC_SEL'.
    fieldcatalog-NO_OUT = C_X.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    ENDFORM. " BUILD_FIELDCATALOG
    *& Form BUILD_LAYOUT
    *•     Build layout for ALV grid report
    FORM build_layout.
    gd_layout-no_input = 'X'.
    gd_layout-colwidth_optimize = 'X'.
    gd_layout-totals_text = 'Totals'(201).
         gd_layout-totals_only = 'X'.
         gd_layout-f2code = 'DISP'. "Sets fcode for when double
         "click(press f2)
         gd_layout-zebra = 'X'.
         gd_layout-group_change_edit = 'X'.
         gd_layout-header_text = 'helllllo'.
    ENDFORM. " BUILD_LAYOUT
    *& Form DISPLAY_ALV_REPORT
    *•     Display report using ALV grid
    FORM display_alv_report.
    gd_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = gd_repid
    i_callback_user_command = 'USER_COMMAND'
    i_callback_pf_status_set = 'GUI_STAT'
    *i_grid_title = outtext
    is_layout = gd_layout
    it_fieldcat = fieldcatalog[]
    *it_special_groups = gd_tabgroup
    *it_events = it_events
    i_save = 'X'
    *is_variant = z_template
    TABLES
    t_outtab = i_final
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " DISPLAY_ALV_REPORT
    **& Form DATA_RETRIEVAL
    *•     Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
    *SELECT avbeln aerdat bmatnr bposnr FROM vbak AS a
    *INNER JOIN vbap AS b ON avbeln = bvbeln
    *INTO TABLE i_final WHERE a~vbeln = b~vbeln.
    select VBELN ERDAT MATNR POSNR up to 10 rows from vbap into corresponding fields of  table i_final.
    ENDFORM. " DATA_RETRIEVAL
    *•     FORM GUI_STAT *
    *•     --> RT_EXTAB *
    FORM gui_stat USING rt_extab TYPE slis_t_extab.
    SET PF-STATUS 'MODIFY' EXCLUDING rt_extab.
    ENDFORM.
    *•     FORM USER_COMMAND *
    *•     --> U_COMM *
    *•     --> RS_SELFIELD *
    FORM user_command USING u_comm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    DATA:selfield TYPE slis_selfield.
    *RS_SELFIELD-REFRESH = C_X.
    CASE u_comm.
    *IF U_COMM = C_FC_MODIFY.
    WHEN 'UPDATE'.
    LOOP AT i_final. " into wa_final."into wa_final.
    *READ TABLE I_TEMP WITH KEY VBELN = I_FINAL-VBELN.
    *IF SY-SUBRC = 0.
    i_final-matnr = vbap-matnr.
    *MODIFY I_final INDEX SY-TABIX.
    *ENDIF.
    ENDLOOP.
    *ENDIF.
    MODIFY VBAP FROM TABLE i_final.
    IF SY-SUBRC = 0.
    COMMIT WORK AND WAIT.
    *MESSAGE I000 WITH SY-DBCNT
    *' Record(s) has been Updated'(020).
    ENDIF.
    *append i_final.
    *it_temp = i_final.
    *append it_temp.
    **UPDATE sflight FROM TABLE sflight_tab.
    *ENDLOOP.
    *update vbap from table i_final.
    *IF sy-subrc = 0.
    *MESSAGE s000(0) WITH 'records updated successfully'.
    *ENDIF.
    ENDCASE.
    ENDFORM.
    </code>
    Frnds plz help me in this regard.
    Thanks,
    satya

    Try something like this...ur code was not clear..i have done something u can understand.
    First check that u r not trying to update the primary key field.
    first before updating.
    Before updating select the record u r going to update from the main table.
    select single * from VBAP where <pass the key values>.
    if sy-subrc = 0.
    move the rest of the values to the table header except the key values.
    vbap-<field1> = value1.
    vbap-<field2> = value2.
    after moving the values.
    update <table>.
    if sy-subrc = 0.
    commit work.
    endif.
    data:st_vbap type vbap.
    WHEN 'UPDATE'.
    LOOP AT i_final. " into wa_final."into wa_final.
    select single * from vbap where vbeln = I_FINAL-VBELN.
    move-corresponding i_final to vbap.
    update vbap.
    if sy-subrc = 0.
    commit work.
    wk_cnt = wk_cnt + 1.
    endif.
    at last.
    *MESSAGE I000 WITH SY-DBCNT
    *' Record(s) has been Updated'(020).
    endat.
    endloop

Maybe you are looking for

  • Transfer my purchased items to a new computer

    I am on a temporary computer. I have purchased a movie and other things on the itunes online store. Is it possible for me to put those on my new computer when i get it? If so, how would i go about doing that?

  • Different due dates for the same SC

    Hi dear experts, We are facing a problem with our customer, the customer wants to have the flexibility in the system to create SC´s with 2 different characteristics, the first category are plans which work with the standard and we already have them w

  • Inventory Count (1 material under 1 loc have multiple tags)

    Hi, SAP standard inventory count is 1 material 1 location can only have 1 physical document. But our scenario is based on the tag number (which means there will be different tag number for the same code), and our tag number does not have any linkage

  • Using adobe 11.0.03

    I've installed adobe 11.0.03.  Now many pdf files appear as a black screen and leave no trace of having been downloaded. What's going wrong!  How can I fix it?

  • CS6 installer in Ukrainian language

    Turned Adobe site and all of download assistants, application managers and download sections upside down, but couldn't find Creative Suite CS6 installer in Ukrainian language. When I try to use application manager / Download Assistant - it gives me R