ALV edit not capturing new value

Hi
In my alv i have made one field as editable..when i edit the field and click save button the control comes to below code. 
CALL METHOD gro_grid->get_selected_rows
    IMPORTING
      et_index_rows = gwa_selected_rows.
*Through the index capturing the values of selected rows
  LOOP AT gwa_selected_rows INTO gv_selected_rows.
    READ TABLE git_data INTO gwa_data INDEX gv_selected_rows-index.
here git_data is the internal table given to alv grid...i nthe above read stmt..gwa_data gives the value in field as old one..its not capturing the new value..how to solve this ..pls help

Hi,
Use event data_changed.
When 'SAVE' is pressed, call check_changed_data( ) which will trigger event data_changed.
Inside handler method copy the modified cells to table.
*PAI
When 'SAVE'.
g_o_grid->check_changed_data( ).  " It triggers event 'data_changed'.
LOOP AT g_t_modcells INTO g_r_modcells.   " Loop at modified cells table
READ TABLE git_data INTO gwa_data INDEX g_r_modcells-row_id .      " <---- Ur code
ENDLOOP.
clear: g_t_modcells[],g_t_modcell[].
*Declare data for handler method.
Data:  g_t_modcells type lvc_t_modi,
          g_t_modcell type lvc_t_modi.
*Declare handler method for event 'data_changed'.
METHODS: data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed.
*Handler method implementation
  METHOD data_changed.
    IF er_data_changed->mt_good_cells[] IS NOT INITIAL.
      g_t_modcell[] = er_data_changed->mt_good_cells[].
      APPEND LINES OF g_t_modcell TO g_t_modcells.  " Modified cells are copied to table g_t_modcells[]
    ENDIF.
  ENDMETHOD.
Thanks,

Similar Messages

  • REUSE_ALV_GRID_DISPLAY with editable field -- Recuperate new value

    Hi everybody,
    I try to explain my problem. I created an ALV grid with the function REUSE_ALV_GRID_DISPLAY and an internal table.
    The user can change the value of one field and can save it. Indeed, in debbug mode, I can see in the internal table the new value entered by the user. So I can do all the actions with the launch of a routine.
    But the user can forger to save his change. So, when he clicks on "Back" I want to propose him to save. THE PROBLEM : in debbug mode, when the routine is launched, the internal table does't have the new value..
    So have you got an idea to recuperate the new value?
    Thank you very much in advance.
    Best regards.

    I had the same problem and solved it: I used SET_TABLE_FOR_FIRST_DISPLAY.
    The MT_OUTPUT tab has the ALV data and the column in here must be modifed. Steps:
    data: p_grid  type ref to lcl_gui_alv_grid.
    Step 1. Create a sub class for LCL_GUI_ALV_GRID_DEFINITION.
    *       class lcl_gui_alv_grid  definitio
    CLASS lcl_gui_alv_grid DEFINITION
            INHERITING FROM cl_gui_alv_grid.
      PUBLIC SECTION.
        METHODS: update_outtab
                   IMPORTING i_good_cells TYPE lvc_t_modi.
    **             check_changed_data.
    ENDCLASS.                    "lcl_gui_alv_grid  DEFINITIO
    Step2
    Use event data_changed_finished of LCL_EVENT_RECEIVER
    *       CLASS lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
          handle_data_changed
             FOR EVENT data_changed OF cl_gui_alv_grid
                 IMPORTING er_data_changed,
          handle_data_change_finished    "****<----------
             FOR EVENT data_changed_finished OF cl_gui_alv_grid
                 IMPORTING e_modified et_good_cells,
          handle_double_click
             FOR EVENT double_click OF cl_gui_alv_grid
                 IMPORTING e_row e_column,
          handle_after_refresh
             FOR EVENT after_refresh OF cl_gui_alv_grid.
    *Implementation
    CLASS lcl_event_receiver IMPLEMENTATION.
    METHOD handle_data_change_finished.
        DATA: lt_goodcells TYPE lvc_t_modi.
        CHECK NOT e_modified IS INITIAL AND NOT et_good_cells IS INITIAL.
        lt_goodcells[] = et_good_cells[].
        CALL METHOD p_grid->update_outtab
          EXPORTING
            i_good_cells = lt_goodcells.
        CALL METHOD p_grid->refresh_table_display.
      ENDMETHOD.                    "data_changed_finished
    *-- ALV data updated in class implementation below
    CLASS lcl_gui_alv_grid IMPLEMENTATION.
      METHOD update_outtab.
        FIELD-SYMBOLS: <tab1> TYPE STANDARD TABLE,
                       <good> TYPE lvc_s_modi,
                       <fs1> TYPE ANY,
                       <fs2> TYPE ANY.
        DATA: ls_alv TYPE type_alv,
              fldabgru(32) TYPE c VALUE '<TAB1>-ABGRU_NEW',
              fldbezei(32) TYPE c VALUE '<TAB1>-BEZEI_NEW',
              lv_bezei TYPE bezei40.
        ASSIGN mt_outtab->* TO <tab1>.  "ALV display table
        LOOP AT i_good_cells ASSIGNING <good>.
          READ TABLE <tab1> INTO ls_alv INDEX <good>-row_id.
          IF sy-subrc EQ 0.
            SELECT SINGLE bezei INTO ls_alv-bezei_new
              FROM tvagt
              WHERE spras = sy-langu
                AND abgru = ls_alv-abgru_new.
            IF sy-subrc EQ 0.
              MODIFY <tab1> FROM ls_alv INDEX <good>-row_id.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDMETHOD.                    "update_outtab

  • ALV Editable not working

    Hello Abapers,
    I am not getting the desired output as per example.
    I have followed all the steps as per the example but still a looser can anyone help me in this.
    When I execute the program I get the following run time error
    Field symbol has not been assigned.
    I tried commenting the subroutine call
    1} perform Change_fieldcatalogue and fetch data.
    and i was getting the 2 custom container (top, bottom)  on the screen output this time.
    I have also created a screen 600 with all the attributes.
    But i have doubt with this statement
    Create a Custom container and name it CCONT and OK code as OK_CODE.
    Save check and Activate the screen painter.
    I hope on the layout screen the one which says custom control is only the custom container but i see that the fct code box is not highlighted then how can i assign a fctcode.
    Could you plz also clear this.
    Thanks in advance.
    Ranjith Nambiar
    Program code below
    A small note about this program
    *& AS : ALV report which displays the contents of the table T006
    *& (as a docking container in the bottom) along with the
    *& editable ALV which contains the ALV fieldcatalogue table structure.
    *& With the available toolbar options of the editable ALV in the output,
    *& user can change the fieldcatalogue as per his requirement.
    *& When the user clicks 'SUBMIT',the display of the ALV with table T006
    *& gets modified and customised accordingly to the user's requirement.
    REPORT  ZNRD_ALV_EDITABLE.
    * Structure declaration for t006
    types : begin of ty_t006.
            include structure t006.
    types : end of ty_t006.
    * Internal table and work area declaration for t006.
    data : it_t006 type standard table of ty_t006,
           wa_t006 type ty_t006.
    * Declaration for ALV
    data : ok_code type sy-ucomm,            " Ok code.
           it_fcat type lvc_t_fcat,          " Fieldcatalogue.
           it_fieldcat type lvc_t_fcat,      "  Fieldcatalogue for Fieldcatalogue itself.
           it_layout type lvc_s_layo.
    *Declaration for toolbar functions
    data : it_excl_func type ui_functions,
    * Controls to display it_t006 and its fieldcatalogue
           cont_dock type ref to cl_gui_docking_container,
           cont_alvgd type ref to cl_gui_alv_grid,
    * Controls to display fieldcatalogue as editable alv gridand container
           cont_cust type ref to cl_gui_custom_container,
           cont_editalvgd type ref to cl_gui_alv_grid.
    initialization.
    start-of-selection.
    * Local class definition for data changed in fieldcatalogue alv
    CLASS lcl_event_receiver definition.
    public section.
      methods handle_data_changed
      for event data_changed of cl_gui_alv_grid
        importing er_data_changed.
    endclass.        " lcl_event_receiver definition.
    * Local class implementation for data changed in fieldcatalogue alv
    CLASS lcl_event_receiver implementation.
      method handle_data_changed.
      endmethod.     " handle_data_changed.
    endclass.        "lcl_event_receiver implementation
    * Data declaration for event receiver
    data : event_receiver type ref to lcl_event_receiver.
    end-of-selection.
    * Setting the screen for alv output for table display and changed fieldcatalogue display
    set screen 600.
    *&      Module  STATUS_0600  OUTPUT
    *       text
    MODULE STATUS_0600 OUTPUT.
      SET PF-STATUS 'STATUS600'.
      SET TITLEBAR 'TITLE600'.
    * Create ALV grid if doesn't exits.
    if cont_dock is initial.
      perform Create_alv.
    endif.
    ENDMODULE.                 " STATUS_0600  OUTPUT
    *&      Form  Create_alv
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM Create_alv.
    * Create a docking container and dock the control at the bottom
    create object cont_dock
      exporting
        dynnr = '600'
        extension = 100
        side = cl_gui_docking_container=>dock_at_bottom.
    * Create ALV grid for displaying the table
    create object cont_alvgd
      exporting
        i_parent = cont_dock.
    * Create custom container for ALV
    create object cont_cust
      exporting
        container_name = 'CCONT'.
    * Create alv editable grid
    create object cont_editalvgd
    exporting
       i_parent = cont_cust.
    * Register events for the editable alv
    create object event_receiver.
    set handler event_receiver->handle_data_changed for cont_editalvgd.
    call method cont_editalvgd->register_edit_event
      exporting
        i_event_id = cl_gui_alv_grid=>mc_evt_modified.
    *Building fieldcatalogue for the initial display
    perform Build_fieldcatalogue changing it_fcat it_fieldcat.
    * Building the fieldcatalogue after the user has changed it
    perform Change_fieldcatalogue changing it_fieldcat.
    * Fetch data from the table.
    perform Fetch_data.
    * Get excluding functions for the alv editable tool bar
      APPEND cl_gui_alv_grid=>mc_fc_loc_append_row TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_loc_insert_row TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_loc_cut TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_sort TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_sort_asc TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_sort_dsc TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_subtot TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_sum TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_graph TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_info TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_print TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_filter TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_views TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_mb_export TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_mb_sum TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_mb_sum TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_mb_paste TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_find TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_loc_copy  TO it_excl_func.
    *Alv display for the T006 table at the bottom
      CALL METHOD cont_alvgd->set_table_for_first_display
        CHANGING
          it_outtab       = it_t006[]
          it_fieldcatalog = it_fcat[].
    * optimize column width of grid displaying fieldcatalog
      it_layout-cwidth_opt = 'X'.
    * Get fieldcatalog of table T006 - alv might have
    * modified it after passing.
      CALL METHOD cont_alvgd->get_frontend_fieldcatalog
        IMPORTING
          et_fieldcatalog = it_fcat[].
    *to Send Buffered Automation Queue to Frontend
      CALL METHOD cl_gui_cfw=>flush.
    * Display fieldcatalog of table T006 in editable alv grid
      CALL METHOD cont_editalvgd->set_table_for_first_display
        EXPORTING
          is_layout            = it_layout
          it_toolbar_excluding = it_excl_func
        CHANGING
          it_outtab            = it_fcat[]
          it_fieldcatalog      = it_fieldcat[].
    ENDFORM.                    " Create_alv
    *&      Module  USER_COMMAND_0600  INPUT
    *       text
    MODULE USER_COMMAND_0600 INPUT.
    case ok_code.
      when 'SUBMIT'.
    * To get the current fieldcatalogue from the front end
        call method cont_alvgd->set_frontend_fieldcatalog
        exporting
          it_fieldcatalog = it_fieldcat.
        call method cont_alvgd->refresh_table_display.
        call method cl_gui_cfw=>flush.
      when 'EXIT'.
        leave program.
    endcase.
    ENDMODULE.                 " USER_COMMAND_0600  INPUT
    *&      Form  Build_fieldcatalogue
    *       text
    *      <--P_IT_FCAT  text
    *      <--P_IT_FIELDCAT  text
    FORM Build_fieldcatalogue  CHANGING P_IT_FCAT
                                        P_IT_FIELDCAT.
    * Fieldcatalog for table T006: it_fldcat
    * to generate the fields automatically
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'T006'
        CHANGING
          ct_fieldcat            = it_fieldcat[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    * Fieldcatalog for table LVC_T_FCAT:it_fcat
    * Generate fieldcatalog of fieldcatalog structure.
    * This fieldcatalog is used to display fieldcatalog 'it_fldcat'
    * on the top of the screen.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'LVC_S_FCAT'
        CHANGING
          ct_fieldcat            = it_fcat[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    ENDFORM.                    " Build_fieldcatalogue
    *&      Form  Change_fieldcatalogue
    * After the user has modified the fieldcatalogue we build another fieldcat
    * for the modified alv display
    *      <--P_IT_FIELDCAT  text
    FORM Change_fieldcatalogue  CHANGING P_IT_FIELDCAT.
      DATA ls_fcat TYPE lvc_s_fcat.
      LOOP AT it_fcat INTO ls_fcat.
        ls_fcat-coltext = ls_fcat-fieldname.
        ls_fcat-edit = 'X'.
        IF ls_fcat-fieldname = 'COL_POS' OR ls_fcat-fieldname = 'FIELDNAME'.
          ls_fcat-key = 'X'.
        ENDIF.
        MODIFY it_fcat FROM ls_fcat.
      ENDLOOP.
    ENDFORM.                    " Change_fieldcatalogue
    *&      Form  Fetch_data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM Fetch_data .
      select * from t006 into table it_t006 up to 50 rows.
    ENDFORM.                    " Fetch_data

    comment this particular section deals with top container.
    CALL METHOD cont_editalvgd->set_table_for_first_display
        EXPORTING
          is_layout            = it_layout
          it_toolbar_excluding = it_excl_func
        CHANGING
          it_outtab            = it_fcat[]
          it_fieldcatalog      = it_fieldcat[].
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'LVC_S_FCAT'  "This is deep strucure
        CHANGING
          ct_fieldcat            = it_fcat[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    LVC_S_FCAT is a deep structure , so try to comment that section and see. if you want that part , populate the fieldcatalog manually.

  • UPDATE ... RETURNING does not return new value

    Hi all,
    I've created the following objects in Oracle DB 10.2.0.3.0:
    CREATE TABLE TAB1
         ID          NUMBER          PRIMARY KEY,
         EDITED_AT     DATE,
         VALUE          VARCHAR2(64)
    CREATE SEQUENCE S_TAB1
         INCREMENT BY 1
         START WITH 1;
    CREATE TRIGGER T_TAB1_BIE
    BEFORE INSERT OR UPDATE ON TAB1
    FOR EACH ROW
    BEGIN
         IF INSERTING THEN
              SELECT S_TAB1.NEXTVAL INTO :NEW.ID FROM DUAL;
         END IF;
         :NEW.EDITED_AT := SYSDATE;
    END;
    /Then I tried to do the following in SQL Plus:
    SQL> insert into tab1(value) values('ddd');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL> select * from tab1;
            ID EDITED_AT           VALUE
             1 27.03.2008 17:01:24 ddd
    SQL>
    SQL> declare dt date; val varchar2(64);
      2  begin update tab1 set value = 'ddd' where id = 1 returning edited_at, value into dt, val;
      3  dbms_output.put_line('txt = ' || dt || ', ' || val);
      4  end;
      5  /
    txt = 27.03.2008 17:01:24, ddd
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select * from tab1;
            ID EDITED_AT           VALUE
             1 27.03.2008 17:02:12 ddd
    SQL>As it can be seen Returning clause of an Update statement does not return a new date, i.e. 27.03.2008 17:02:12, that was updated by the trigger, it returns an old one - 27.03.2008 17:01:24. Please advise me why Database returns an old value? I do believe that UPDATE ... RETURNING ... statement should return new, generated by the trigger, value.
    Thanks in advance.
    Regards,
    Yerzhan.

    you need to explicitly include the column in your UPDATE statement SET clause that you expect to return the result you want it to be. here's what i think what happened even though you have a trigger the first statement that was processed was your update statement. at the time of the update it has to return the current values to the returning clause that is the values on the table. now comes next the trigger which gives edited_at column a new value. when the trigger got fired the process don't return anymore to the UPDATE RETURNING statement. it's like each sequence of codes does not executes in parallel.
      SQL> CREATE TABLE TAB_1
        2  (
        3   ID  NUMBER  PRIMARY KEY,
        4   EDITED_AT DATE,
        5   VALUE  VARCHAR2(64)
        6  );
      Table created.
      SQL> CREATE SEQUENCE S_TAB1
        2   INCREMENT BY 1
        3   START WITH 1;
      Sequence created.
      SQL> CREATE TRIGGER T_TAB1_BIE
        2  BEFORE INSERT OR UPDATE ON TAB_1
        3  FOR EACH ROW
        4  BEGIN
        5   IF INSERTING THEN
        6    SELECT S_TAB1.NEXTVAL INTO :NEW.ID FROM DUAL;
        7   END IF;
        8   :NEW.EDITED_AT := SYSDATE;
        9  END;
       10  /
      Trigger created.
      SQL> insert into tab_1(value) values('ddd');
      1 row created.
      SQL> commit;
      SQL> select * from tab_1;
              ID EDITED_AT            VALUE
               1 28-mar-2008 10:31:18 ddd
      SQL> declare dt date; val varchar2(64);
        2  begin update tab_1 set value = 'ddd', edited_at = sysdate
        3        where id = 1 returning edited_at, value into dt, val;
        4  dbms_output.put_line('txt = ' || dt || ', ' || val);
        5  end;
        6  /
      txt = 28-mar-2008 10:32:39, ddd
      PL/SQL procedure successfully completed.
      SQL> select * from tab_1;
              ID EDITED_AT            VALUE
               1 28-mar-2008 10:32:39 ddd
      SQL>

  • The .blueMultiplier (movie clip color property) does not take new value..?

    It seems I can not assign a new value to the .blueMultiplier (a movie clip color property) using AS3 ????!!!
    I have a basic movie clip 'mymc' in my scene, and this AS3 code:
    trace (mymci.transform.colorTransform.blueMultiplier);
    mymc.transform.colorTransform.blueMultiplier = 0;
    trace (mymc.transform.colorTransform.blueMultiplier);
    Values that are returned:
    1
    1
    What am I missing?
    Thanks.

    you can't assign transform/colorTransform properties directly.  you update a transform/colorTransform instance and assign your object's transform/colorTransofrm instance to be the updated transform/colorTransform instance:
    var ct:ColorTransform = mymc.transform.colorTransform;
    ct.blueMultiplier = 0;
    mymc.transform.colorTransform = ct;

  • Index array is not getting new values from DAQ

    I am measuring force values with my DAQ card and these values are always changing.  However, in my programming something is not working right with the way I have things set up.  After my DAQ I have a "Convert to Dynamic Data" and after that I have an "Index Array".  When the program is executing and I turn on the highlight option I do not get changing force values after the "Convert to Dynamic Data" and therefore no changing force values enter my "Index Array".  Whaterever the first value is that gets passed to the "Convert to Dynamic Data" is the only value that I get for the remainder of the program.  I tried plugging in an indicator between the DAQ and the "Convert to Dynamic Data" and it did show varying values.  Please help with my program.  I have tried messing with the properties of the "Convert to Dynamic Data" and nothing has worked.  I am stuck and cannot see how to fix this problem.  I have attached my program as it is currently put together.
    Thank You In Advance,
    Gabe.
    Attachments:
    Actuator_Gabe_Oct27_Flat_Sequence_XY_+Measurement_File.vi ‏131 KB

    Please know that the best option is to review the concepts discussed to further understand programming in LabVIEW.  Perhaps you could take a look through ni.com/gettingstarted and ni.com/lv101 to have a look at some of the online help materials.  I have included a VI snippet of the while loop containing the changes.  Further, the code you attached contains a lot of customer controls and VIs, which are not common to all LabVIEW users.  It is a best practice to only attach the code of value to the question/post, and to have the most simplified version of the problem.
    Best,
    Adam
    Academic Product Manager
    National Intruments

  • How to capture the value in AVL intracrivity report

    Hi ,
    i have one doubt please clarify me.
       in ALV  interactivity report if user click on the one field, how  captured the that field value in one variable. presentably i am using
      ws_field_catalog-col_pos = '2'.
      ws_field_catalog-fieldname = 'BELNR'.
      ws_field_catalog-tabname = 'I_OUTPUT'.
      ws_field_catalog-scrtext_l    = 'Original Document number.'.
      ws_field_catalog-hotspot = 'V'.
      ws_field_catalog-scrtext_m    = 'Original Doc.no.'.
      ws_field_catalog-scrtext_s    = 'Original Doc.no.'.
      APPEND ws_field_catalog TO lt_fieldcat.
      CLEAR: ws_field_catalog.
    but it is not capture the valu it is capture the only  field name please any one can you suggest me.
    Thanks,
    Hari.

    hi,
    there is one type pool availabe for the. SLIS_SELFIELD.
    make ur own structure and use case sy-ucomm.
    when '&IC1'.
    write ur code here.
    TYPE-POOLS: SLIS.
    *type declaration for values from ekko
    TYPES: BEGIN OF I_EKKO,
           EBELN LIKE EKKO-EBELN,
           AEDAT LIKE EKKO-AEDAT,
           BUKRS LIKE EKKO-BUKRS,
           BSART LIKE EKKO-BSART,
           LIFNR LIKE EKKO-LIFNR,
           END OF I_EKKO.
    DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
          WA_EKKO TYPE I_EKKO.
    *type declaration for values from ekpo
    TYPES: BEGIN OF I_EKPO,
           EBELN LIKE EKPO-EBELN,
           EBELP LIKE EKPO-EBELP,
           MATNR LIKE EKPO-MATNR,
           MENGE LIKE EKPO-MENGE,
           MEINS LIKE EKPO-MEINS,
           NETPR LIKE EKPO-NETPR,
           END OF I_EKPO.
    DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
          WA_EKPO TYPE I_EKPO .
    *variable for Report ID
    DATA: V_REPID LIKE SY-REPID .
    *declaration for fieldcatalog
    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
    declaration for events table where user comand or set PF status will
    be defined
    DATA: V_EVENTS TYPE SLIS_T_EVENT,
          WA_EVENT TYPE SLIS_ALV_EVENT.
    declartion for layout
    DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
    declaration for variant(type of display we want)
    DATA: I_VARIANT TYPE DISVARIANT,
          I_VARIANT1 TYPE DISVARIANT,
          I_SAVE(1) TYPE C.
    *PARAMETERS : p_var TYPE disvariant-variant.
    *Title displayed when the alv list is displayed
    DATA:  I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
    DATA:  I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
    INITIALIZATION.
      V_REPID = SY-REPID.
      PERFORM BUILD_FIELDCATLOG.
      PERFORM EVENT_CALL.
      PERFORM POPULATE_EVENT.
    START-OF-SELECTION.
      PERFORM DATA_RETRIEVAL.
      PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  BUILD_FIELDCATLOG
          Fieldcatalog has all the field details from ekko
    FORM BUILD_FIELDCATLOG.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'EBELN'.
      WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'AEDAT'.
      WA_FIELDCAT-SELTEXT_M = 'DATE.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'BUKRS'.
      WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'BUKRS'.
      WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'LIFNR'.
      WA_FIELDCAT-NO_OUT    = 'X'.
      WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "BUILD_FIELDCATLOG
    *&      Form  EVENT_CALL
      we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = V_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.
    ENDFORM.                    "EVENT_CALL
    *&      Form  POPULATE_EVENT
         Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
      ENDIF.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'USER_COMMAND'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-NAME.
      ENDIF.
    ENDFORM.                    "POPULATE_EVENT
    *&      Form  data_retrieval
      retreiving values from the database table ekko
    FORM DATA_RETRIEVAL.
      SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
    ENDFORM.                    "data_retrieval
    *&      Form  bUild_listheader
          text
         -->I_LISTHEADEtext
    FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
      DATA HLINE TYPE SLIS_LISTHEADER.
      HLINE-INFO = 'this is my first alv pgm'.
      HLINE-TYP = 'H'.
    ENDFORM.                    "build_listheader
    *&      Form  display_alv_report
          text
    FORM DISPLAY_ALV_REPORT.
      V_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM                = V_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
         I_GRID_TITLE                      = I_TITLE_EKKO
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         = ALV_LAYOUT
         IT_FIELDCAT                       = I_FIELDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
        i_default                         = 'ZLAY1'
         I_SAVE                            = 'A'
        is_variant                        = i_variant
         IT_EVENTS                         = V_EVENTS
        TABLES
          T_OUTTAB                          = IT_EKKO
    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  TOP_OF_PAGE
          text
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER
       i_logo                   =
       I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM    text
         -->,          text
         -->RS_SLEFIELDtext
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
          PERFORM BUILD_FIELDCATLOG_EKPO.
          PERFORM EVENT_CALL_EKPO.
          PERFORM POPULATE_EVENT_EKPO.
          PERFORM DATA_RETRIEVAL_EKPO.
          PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
          PERFORM DISPLAY_ALV_EKPO.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  BUILD_FIELDCATLOG_EKPO
          text
    FORM BUILD_FIELDCATLOG_EKPO.
      WA_FIELDCAT-TABNAME = 'IT_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'EBELN'.
      WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'EBELP'.
      WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MENGE'.
      WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MEINS'.
      WA_FIELDCAT-SELTEXT_M = 'UOM'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'NETPR'.
      WA_FIELDCAT-SELTEXT_M = 'PRICE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "BUILD_FIELDCATLOG_EKPO
    *&      Form  event_call_ekpo
      we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL_EKPO.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = V_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.
    ENDFORM.                    "event_call_ekpo
    *&      Form  POPULATE_EVENT
           Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT_EKPO.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
      ENDIF.
      ENDFORM.                    "POPULATE_EVENT
    *&      Form  TOP_OF_PAGE
          text
    FORM F_TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER
       i_logo                   =
       I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM    text
         -->,          text
         -->RS_SLEFIELDtext
    *retreiving values from the database table ekko
    FORM DATA_RETRIEVAL_EKPO.
    SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
    ENDFORM.
    FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
    DATA: HLINE1 TYPE SLIS_LISTHEADER.
    HLINE1-TYP = 'H'.
    HLINE1-INFO = 'CHECKING PGM'.
    ENDFORM.
    FORM DISPLAY_ALV_EKPO.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = V_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = 'F_USER_COMMAND'
       I_CALLBACK_TOP_OF_PAGE            = '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_TITLE_EKPO
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = I_FIELDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         =
       I_SAVE                            = 'A'
      IS_VARIANT                        =
       IT_EVENTS                         = V_EVENTS
      TABLES
        T_OUTTAB                          = IT_EKPO
    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.
    REWARD ME IF HELPFUL. PLEASE

  • ABAP needed: New Value/Old Value in Update Rules

    Hi all
    I'm updating some attributes in IObj by ABAP routine. Is it possible to get not only new value of attribute but the old one to compare them?
    Is it possible to get others attribute old and new values?
    I'll illustrate it with example.
    Say, IObj has 3 attributes:
    0ACC_GRP
    0DT_FROM
    0DT_TO
    if NEW value of 0ACC_GRP <> OLD value of 0ACC_GRP then
    new 0DT_FROM = SYSDAT
    new 0DT_TO = old 0DT_FROM
    else
    new 0DT_FROM = old 0DT_FROM
    new 0DT_TO = old 0DT_TO

    My case quite simple I guess.
    I got 0CUSTOMER infoobject and appended it with several time-dep attributes. After it my Update rules were deactvated.  I got error message with prompt to fill out FROM_DATE, TO_DATE as key fields in every attribute (time-dependable and none time-dependable) while was trying re-activate Update Rules.
    So, what's wrong with that? What I supposed to do with all those to/from date key fields  in my Update Rules??
    Edited by: Gediminas Berzanskis on Jul 2, 2008 3:44 PM

  • VF03 Profitability Analysis - Cost not capture in profitability

    HI SAPFans,
    I'm facing difficulty on profitability analysis on VF03.
    The problem is, my cost of sales is not capture on Value fields tab (refer attachment).
    [vf03|[IMG]http://i303.photobucket.com/albums/nn133/kerisnagasostro/vf03.jpg[/IMG]]
    is there any maintenance that i need to check ? in order to flow cost amount into cost field on value fields tab ?

    Dear
           GOTO CONTROLLING Profitibility Analysis ---Flow of Acual Value --Transfer of Billing document --Assign value field --Maintain assignment of SD Condition to COPA -- OPERATING CONCERN(TYPE OF PROFITB ANALYSIS--SELECT COSTING BASED) AND CLICK. issue may arise to do this activity as that is FI Consultant job so u might not having require Authorization so need to take help of ur FI Consultant or asked ur Basis Consultant to give authoriztion.
    Regards
    AJIT K SINGH

  • Class ALV in Edit mode and F4 Value help

    I am displaying Customer Information in ALV Grid with class method. Customer Number is editable mode and having search help. When user F4 on Customer Number and select any value from search help. This selected new value is not passing to ALV grid in Customer number column. I tried with on_f4 method, but it is not working or something i doing incorrect.
    Can any one help to solve this problem ?
    Many thanks

    Hi.
    try with method check_changed_data in after event.
    CALL METHOD go_grid->check_changed_data
          IMPORTING
    or implement a local_event_class to handle F4 event and Change event.
    The demo program "BCALV_TEST_GRID_F4_HELP" can help you tu find the correct code.

  • New entries in table TSTC not capturing in scu3 change logs

    Hi ,
    We have TSTC table log enabled.
    New Entries which comes through transport in the table TSTC are not capturing in change logs.
    We have created a new Z T-code and transported it to Quality and then to Production.
    But in the change logs of the tbale TSTC it is not captured both in quality and Production.
    In the table TSTC t-code is present.
    But the change log for the table doesnot show any new entry created.
    In development change log of TSTC, the change is present but in Quality and Production it is not present.
    Development client : 400
    Quality Client         : 600
    Production Client    : 600
    Can any one spill some beans on it...
    Thanks & Regards
    Kiran

    You need to add "recclient = ALL" (or same client value as "rec/client" profile parameter in RZ10) to the transport profile as well in the STMS.
    Search SAP notes and the forum here for "recclient" (without "/")
    Cheers,
    Julius

  • In ALV- Save layout is not holding sorting values..

    hello expert.
    in ALV-> Change Layout -> filter Material -> 89* and save as default.
    but not working when i execute the 2nd time from starting onwards..!
    my alv is able to save screen but not filtering values .
    my alv unable to hold filter value as default setting.
    could you please help me out.
    thank you,
    with best regards
    srinivas rathod

    Hi
    Save personalization is for saving variables not for saving layout. If you are doing any changes to layout you can directly save by clicking save button.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/45/6f6b52f5981c91e10000000a11466f/frameset.htm
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/01/42c73c13b0ce5be10000000a114084/frameset.htm
    Regards
    Ravi
    Edited by: Ravi Naalla on Apr 3, 2009 3:47 AM
    Edited by: Ravi Naalla on Apr 3, 2009 3:49 AM

  • Does creation of new xml file captures latest value?

    HI All,
    say for instance, if web port has been changed from 8000 to 80 and after this change xml file gets corrupted in apps tier...
    Does creation of new xml file in apps tier captures latest value of web port 80 and all other latest changes made so far?
    Thanks for your time...

    HI All,
    say for instance, if web port has been changed from
    8000 to 80 and after this change xml file gets
    corrupted in apps tier...
    Does creation of new xml file in apps tier captures
    latest value of web port 80 and all other latest
    changes made so far?
    Thanks for your time...If autoconfig is not run after the changes are made to the context file, and the file is lost then the changes are lost.

  • In dealer Invoice , Excise duty values not captured from MIGO

    In dealer invoice , I have changed excise duty values in MIGO . This is not captured in MIRO. But the system took excise value from default values ( from FV11 condition record ) . This is happening for New plants.  Old plants works good.
    Regards.,
    Lakshmanan.S

    hi,
    create a PO with zero tax code. such that base amount is equal to the inclusive of all excise duties.
    IN migo select the capture and post excise option, in the excise tab, activate the mrp indicator .
    change the base value in the migo and manually enter the excise duties in migo, capture it and then post
    create MIRO with reference to the PO and give the taxcode as V1(ED-8%CESS-2%HECESS-1%)instead of VO(ZERO TAX CODE)
    Regards,
    velu

  • System should not creates new version when value of PO increased..

    Hi Experts,
    Need your help to solve this problem. When i increase value of PO it should retrigger Release strategy but it creates version first, then i have to tick completion indicator and check then only release strategy retriggers..
    It should not create new version when change po
    Please check below screenshot
    Please help

    Hi
    Please reveiw the following points in note
       - 493900 FAQ: Release Strategy
          4.  Why is the release strategy not determined?
         "If you use version management, the determination of the release
          strategy starts when the version is completed.
          You complete a version by setting the "version completed"
          indicator in the version tab."
       - 662993 Resetting an already occurred release
         You edit a purchasing document with release strategy.
         You change the quantity or the price. In spite of that, the
         already set release is not reset.
    The release strategy works the same with or without version management
    active - the only difference in case - version management is active -
    is that if release is to be reset, it will be reset only on version
    I hope this helsp to clarify this issue
    Kind regards,
    Lorraine

Maybe you are looking for