Method check_changed_data

Hi All,
I am changing a qty value say from 1 to 2.
When it passes the method check_changed_data the value gets changed to 0,2 from 2.
I do not know how this error happens.
Please advise.
Regards,
K.S.

... Or, in other words: Quantity fields must reference to a unit field, currency amounts must have reference to curremcy key fields.
Check online documentation on field catalog or define a dictionary structure that will force you to dive the reference fields.
Then it will work as desired. Now it works as designed.
But this is not about ABAP OBJECTS...
Regards,
Clemens

Similar Messages

  • Need help using method check_changed_data correctly

    I'm using method check_changed_data in my ALV program to update the grid with changes the user makes. The method works fine for this purpose. But I also want to know if any data actually changed. Can anyone give me an example?
    FORM update_vendor .
    do I need to call a different method before check_changed_data ?
      call method gridhead->check_changed_data.
    is there a parameter available here to see if anything actually
             changed?
      loop at gt_head into wa_head.
        clear wa_head-lifnam.
        select single name1 into wa_head-lifnam
          from LFA1 where lifnr eq wa_head-lifnr.
        if sy-subrc eq 0.
          modify gt_head from wa_head.
        endif.
      endloop.
    ENDFORM.                    " update_vendor

    Hello Beth
    If data have been changed then method <b>go_grid->CHECK_CHANGED_DATA</b> will raise event <b>DATA_CHANGED</b>. If you have an event handler method like HANDLE_DATA_CHANGED then you can, for example, validate the changes.
    If no data were changed event DATA_CHANGED will not be raised and your event handler method will not be called.
    Regards
      Uwe

  • Please explain how the method CHECK_CHANGED_DATA works?

    Hi experts,
       Can any of you experts please explain how the method <b>CHECK_CHANGED_DATA</b>
    of <b>CL_GUI_ALV_GRID</b> class works ?
    Thanks in advance
    regards,
    Ashwin

    DATA: l_valid TYPE c.
    Data grid1 type ref to cl_gui_alv_grid.
    CALL METHOD grid1->check_changed_data IMPORTING e_valid = l_valid.
    This method checks if any data is changed on the grid if there any editable fields .
    And updates the changed values
    Message was edited by:
            Chandrasekhar Jagarlamudi

  • 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.

  • Check_changed_data

    i'm in trouble with method check_changed_data. i though i was to trigger any changes in my editable alv.
    in pbo i've:
    SET HANDLER g_event_receiver->handle_data_changed FOR grid1.
    and in the pai:
    save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'EXIT' OR 'BACK'.
          PERFORM exit_program.
        WHEN '&DATA_SAVE'.
          CALL METHOD grid1->check_changed_data
          IMPORTING
          e_valid = l_valid.
          IF l_valid = 'X'.
            PERFORM call_transaction.
          ENDIF.
        WHEN OTHERS.
    *     do nothing
      ENDCASE.
    i had expected the call_transaction only if some changes are made in the alv, but i allways have l_valid = 'X'.
    where do i make a mistake?

    Hello
    Assuming that your requirement is that "When the user pushes the DATA_SAVE button AND something has changed on the ALV grid then execute the transaction" the solution is quite simple:
    "(1) Call method CHECK_CHANGED_DATA at the beginning of PAI
    save_ok = ok_code.
      CLEAR ok_code.
    CALL METHOD grid1->check_changed_data( ). " triggers DATA_CHANGED
      CASE save_ok.
        WHEN 'EXIT' OR 'BACK'.
          PERFORM exit_program.
        WHEN '&DATA_SAVE'.
    "      CALL METHOD grid1->check_changed_data
    "      IMPORTING
    "      e_valid = l_valid.
          IF l_valid = 'X'.
            PERFORM call_transaction.
          ENDIF.
        WHEN OTHERS.
    *     do nothing
      ENDCASE.
    Define an event handler method (e.g. HANDLE_DATA_CHANGED) which just stores a CHANGE flag:
    METHOD handle_data_changed.
    " E.g. define static attribute in your event handler class
      lcl_eventhandler=>md_data_changed = 'X'.
    " That's all if you do not need any further validations.
    ENDMETHOD.
    Now change your USER_COMMAND module as following:
    save_ok = ok_code.
      CLEAR ok_code.
    CALL METHOD grid1->check_changed_data( ). " triggers DATA_CHANGED
      CASE save_ok.
        WHEN 'EXIT' OR 'BACK'.
          PERFORM exit_program.
        WHEN '&DATA_SAVE'.
    "      CALL METHOD grid1->check_changed_data
    "      IMPORTING
    "      e_valid = l_valid.
    "      IF l_valid = 'X'.
          IF ( lcl_eventhandler=>md_data_changed = 'X' ).
            lcl_eventhandler=>md_data_changed = ' '.  " reset change flag
            PERFORM call_transaction.
          ENDIF.
        WHEN OTHERS.
    *     do nothing
      ENDCASE.
    Regards
      Uwe

  • CHECK_CHANGED_DATA not populating entire data

    Hi All,
    I'm having problem in using the method CHECK_CHANGED_DATA of the class CL_GUI_ALV_GRID. I have 6 columns/fields in the grid, and when using this method, it is not returning the content of all the 6 fields. It's able to recognize the changed or added row but the value for one particular field is not being populated. Any inputs on this ?
    Just as an information, I'm using OO techniques and registered events for this.
    Thanks,
    DK

    Hi
    No particular setting has to be done for the fields, that event should be triggered as soon as a value is changed.
    Try to check if there's something strange in catalog table
    Max

  • Pls help: check_changed_data not updating the Itab from non-OO ALV GRID

    Hi experts,
    Please help this newbie here. I have problem with updating my internal table with multiple cells changes in my ALV. I've used the FM 'GET_GLOBALS_FROM_SLVC_FULLSCR' and the method 'CHECK_CHANGED_DATA'. When I debugged, I could see the changes being captured in ref1.
    How can I make sure that the changes were already updated into the itab new_antrag after I presses the button command 'EX_SEND'? The original program is leave program RPTARQUIATEST.
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                                                      RS_SELFIELD LIKE SLIS_SELFIELD
    Data: ref1 type ref to cl_gui_alv_grid.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          E_GRID = ref1.
    call method ref1->check_changed_data.
    read table new_antrag index rs_selfield-index into wa_new_antrag.
    case r_ucomm.
      when 'EX_SEND'.
          perform before_prepare using rs_selfield
                                                new_antrag
                                       changing
                                                wa_new_antrag.
          perform request_check using req
                                                pernr
                                                modus
                                                check_command
                                                g_check_mode
                                        changing
                                                checked_req
                                                messages.
          perform request_exec using wa_new_antrag-request_id
                                                pernr
                                                modus
                                                c_cmd_exec_cmd
                                        changing
                                                exec_req
                                                messages.
          perform after_exec using exec_req.
      endcase.
    ENDFORM.
    Please help. Points will be awarded for constructive solutions which help in the problem solving. Thank you.
    Cheers,
    Damien

    Sorry, please ignore this thead because I had unmarked it as a question by accident.

  • "CHECK_CHANGED_DATA"  of the ALV Grid class

    Hi Friends
    I have an application in which I have created an editable ALV grid using CL_GUI_ALV_GRID.I have also registered the "ENTER" event of the class so that the method "CHECK_CHANGED_DATA" gets fired which in turn raises event DATA_CHANGED and looks then for any entries
    in the error protocol.
    The problem is in case of some values entered by the user the method "CHECK_CHANGED_DATA" is throwing a "Conversion Exit"(field too short) short dump.
    To handle this error I need a method which fires before the "CHECK_CHANGED_DATA" and gives me all the values entered by the user on the screen.This way I will be able to trap the error.
    Any suggestions are welcomed.

    FORM DATA_CHANGED  USING P_ER_DATA_CHANGED TYPE REF TO
    CL_ALV_CHANGED_DATA_PROTOCOL P_ONF4 type C E_UCOMM TYPE SY-UCOMM.
      DATA: L_VALUE TYPE LVC_VALUE,
        ls_mod_cell type lvc_s_modi.
       LOOP AT P_ER_DATA_CHANGED->MT_MOD_CELLS INTO LS_MOD_CELL.
        CALL METHOD P_ER_DATA_CHANGED->GET_CELL_VALUE
          EXPORTING
            I_ROW_ID    = LS_MOD_CELL-row_id
            I_FIELDNAME = LS_MOD_CELL-fieldname
          IMPORTING
            E_VALUE     = L_VALUE.
      ********at this position call a conversion exit function module which takes l_value and returns a value in the required format*********
      ENDLOOP.
    ENDFORM.                    " DATA_CHANGED
    FORM SAVE_DATA .
      DATA FLAGG.
      DATA ER_DATA_CHANGED TYPE REF TO CL_ALV_CHANGED_DATA_PROTOCOL.
      CALL METHOD GO_GRID->CHECK_CHANGED_DATA
        IMPORTING
          E_VALID = FLAGG.
      IF FLAGG = 'X'.
        PERFORM UPDATE_DBTAB.
        MESSAGE 'DATA UPDATED IN TABLES' TYPE 'I'.
        LEAVE TO SCREEN 0.
      ELSE.
        MESSAGE 'DATA NOT CHANGED' TYPE 'S'.
      ENDIF.
    ENDFORM.                    " SAVE_D

  • Event not triggering in ALV

    Hi All,
    I am using ALV GRID in object oriented with editing option.If user made any changes in the Grid ,then i will captured the changes by the event DATA_CHANGED and i will display the error message inside the DATA_CHANGED event method using Method ADD_PROTOCOL_ENTRY and DISPLAY_PROTOCOL(which displayed a message in popup window with the field name ,row etc.).
    The Method CHECK_CHANGED_DATA in PAI will trigger DATA_CHANGE event.It is some time triggering DATA_CHANGED and some time it is not triggering DATA_CHANGED event..Why it is not triggering DATA_CHANGED event?
    Can any one give me solution for this.....
    Thanks in Advance..

    Hi,
    i have to register an ENTER  event:
    that is
    CALL METHOD alv->register_edit_event
    EXPORTING
    i_event_id = cl_gui_alv_grid=>mc_evt_enter.
    For this also it is not triggering...

  • Display error protocol in an alv list

    Hi!
    I have in my program an alv list.Two of its fields are editable. For one of this field I want to control the value key by the user. So , i used ADD_PROTOCOL_ENTRY from class CL_ALV_CHANGED_DATA_PROTOCOL like in report BCALV_EDIT_04. The control works very well when the user key a wrong value.
    But, here is my problem. I add a button to allow user to change value for several line with one click (mass change) and i would like to control entry too. 
    Since when i call method CHECK_CHANGED_DATA after my mass changes nothing appends, in PAI module i add this code.
    DATA WT_CHANGED TYPE REF TO CL_ALV_CHANGED_DATA_PROTOCOL.    CREATE OBJECT WT_CHANGED EXPORTING I_CALLING_ALV = GRID1.
    PERFORM MASS_CHANGE.
    CALL METHOD G_VERIFIER->HANDLE_DATA_CHANGED( WT_CHANGED ).
    In perform mass_change i had this code :
    WT_CELLS-ROW_ID = WT_INDEX2-ROW_ID.
    WT_CELLS-FIELDNAME = '/BIC/ZC_SIPROD'.
    WT_CELLS-VALUE = P_SIPROD.
    WT_CELLS-TABIX = W_TABIX.
    APPEND WT_CELLS.
    APPEND WT_CELLS TO WT_CHANGED->MT_GOOD_CELLS.
    The protocol windows appears. When i click on an error message the cell witch contains the error is selected but the fiels <i>name of the columns</i> is empty in the protocol windows and the incorrect value is not deleted.
    NB : when i do manual change (i.e line by line) this columns isn't empty and the incorrect value is deleted.
    can you help me in order to solve my problem?
    Thanks by advance,
    LB.
    Message was edited by:
            Laurent BOUDART

    Hi,
    you can have a look in BCALV_GRID_EDIT.
    Look in the perform data_changed.
    Edited by: Mario Schmidt on Jun 21, 2010 5:05 AM

  • Editing a field in ALV and validating the newly entered Value

    Hi Experts,
       I have an ALV report in grid display (not object oriented). My requirement is to edit a field on the output and write the validations to validate the value that was edited on the ALV output.
    This can be done using object oriented coding by using the method check_changed_data. For this to happen, i need to change the entire scope of my report into object oriented, which is like reinventing the wheel.
    Since my report was developed using classical ABAP, what needs to be done to get this functionality. Any suggestions are welcome.
    Thanks.

    in the FM 'REUSE_ALV_GRID_DISPLAY'  import parameter IS_LAYOUT check out the columsn EDIT and EDIT_COLUMN. Also Use FM 'REUSE_ALV_EVENTS_GET' to get list possible event and pass a subroutine name which will be called when ever event is fired.
    example:
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = l_events.
      READ TABLE l_events WITH KEY name = slis_ev_top_of_page
                                   INTO g_event.
      IF sy-subrc = 0.
        MOVE top_of_page TO g_event-form.
        APPEND g_event TO t_events.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_buffer_active    = 'X'
          i_callback_program = t_repid
          is_layout          = t_layout
          it_fieldcat        = t_fieldcat[]
          i_save             = t_save
          it_events          = t_events[]
        TABLES
          t_outtab           = g_editpos1[].

  • How to validate data in editable ALV report after making changes

    Hi Folks,
    My requirement is to display data in ALV format with quantity field is editable. Once we get the data in display mode only quantity field is enabled right. I am going to make changes to that quantity field and updating that modifed value to the database table. Before updating databse table i want to validate the data for perticluar field which I edidted(Quantity).
    Can you guide me on this.
    Currently I am using FM: GET_GLOBALS_FROM_SLVC_FULLSCR and calling the method CHECK_CHANGED_DATA.
    I want to validate the quantity data.
    If I entered negative value like -100 instead of 100. It should validate and show some popup screen or message.
    Pls guide me on this or give some code to do that.
    Thanks&Regards,
    Surendra

    Hey Surendra,
    Check if this helps: Link:[Click here|Edit Field in Oops Alv;
    There are many posts available for this requirement. Please look SDN/web for same.
    Regards,
    Santosh

  • How to get changed value in oo alv

    hi experts,
    i insert a check box in alv,i wanna transfer the choosed  rows to my transparent table,but i find that the check box  won't  changed to 'X' in itab but i double click the row,could i get the alv rows into my itab reversed
    best regards
    zlf

    Hi,
      You can get the changes by calling the method check_changed_data in the class CL_GUI_ALV_GRID.
    Example: if o_alv is the object ref to CL_GUI_ALV_GRID.
    then
    CALL METHOD o_alv->check_changed_data.
    Regards,
    Karthick.

  • Problem in saving the data from alv to DB

    Hi,
    I have three records in the alv, there is a flag called ADV , now i am clicking the flag and trying to save... it throws an error bcoz one of the record got some error.
    Now the flag for the record which has thrown error is cleared and the remaining remain checked.
    My prob is when am trying to change the remaining records, its is saying no change in the record.
    Please try to analyse it and help me.

    If you are using the OO method for alv try calling the method Check_changed_data in the PAI.....which will update the internal table with the changes made on screen...
    Try checking the internal table in debugging mode if all the changes made on screen is being reflected....
    Regards,
    Kunjal

  • Cell data not getting refreshed in which user enters data OO ALV(editable)

    Hi Friends,
    I am using OO ALV for editable grid display.
    I am unable to change grid data in the cell in which user enters something, using OO ALV. Did through debugging of my own program and found that some problem with system program. Then I did all system debugging. Could not find out why is the grid not getting refreshed with the new data in the cell in which user had entered some value. Rest of the cell's data are getting refreshed with the values which i am updating in the final internal table. I can see that the data in the final internal table is changed for the cell in which user enters data. But even after the call of
          CALL METHOD obj_alvgrid1->refresh_table_display
    does not refreshes the data in the cell in which user had entered data. Rest of the cells data are getting refreshed.
    Piece of code:
      SET HANDLER obj_event_receiver->handle_data_changed
                                         FOR obj_alvgrid1.
        METHODS: handle_data_changed
                       FOR EVENT data_changed OF cl_gui_alv_grid
                           IMPORTING er_data_changed
                                     e_onf4
                                     e_onf4_before
                                     e_onf4_after.
    METHOD handle_data_changed.
      DATA : v_valid    TYPE char1,
             v_refresh  TYPE char1.
    *--check mt_good_cells semantically
      CALL METHOD perform_semantic_checks( er_data_changed ).
    *--If PBO is again visited, just refresh the ALV grid.
      CALL METHOD obj_alvgrid1->refresh_table_display
        EXCEPTIONS
          finished = 1
          OTHERS   = 2.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
    ENDMETHOD.
    METHOD perform_semantic_checks.
        LOOP AT er_data_changed->mt_good_cells INTO w_good.
          v_index = sy-tabix.
          CASE w_good-fieldname.
            WHEN 'ZASCAS'.
    *Now here based on some conditions I am changing my final internal table i_zamtsmatnp
                              MODIFY i_zamtsmatnp FROM w_zamtsmatnp INDEX
                                               w_good-row_id TRANSPORTING
                                                 zascas modif.
    User enters data in zascas field. Based on the data entered, I am changing other fields which is getting refreshed. I am also changing zascas in the program even after user had already entered the value which was bit wrong and i am correcting it in the program on the even "data_changed" even.
    Please help me friends as i m strugling past hours wondering why the data is not getting refreshed for the cell in which user enter data.
    Regards,
    Surya

    Hi Surya,
       The approach you are following is correct. You need to use the comibnation of all these things:
    Event - DATA_CHANGED
    Methods - CHECK_CHANGED_DATA
                 -  GET_CHANGED_DATA.
    However, here are few standard programs which are having similar functionality.
    BCALV_EDIT_03
    BCALV_EDIT_07
    Check out these once.
    Note: If anything is helpful, dont forget to reward points
    Thanks,
    Adithya K
    SAP Practise
    [email protected]

Maybe you are looking for

  • Error while deploying the JDI SCA file on the server

    Hi, I am not able to deploy the 3 SCA files JDIdevinf, JDI buildt and JDIdeinff. When deploying the following error occured. ABorted deployment component 'tc CBB Appl/'sap.com'/SAP AG'6.4009.00.0000.200411042045 Caught exception during application de

  • Issue: Comments not showing correctly on iPhone

    Hi, Please fix the below issue on iPhone App. Summary: If there is a long comment it only shows some of it on the iPhone. Viewing the comment on the iPad allows you to see the whole comment. Details: If the comment is medium length, you can tilt the

  • Since upgrade iOS 8.1 massage stop working in yosemite

    i upgrade iOS 8.1 and imassege un macbook qir 2013 stpo working osx yosemite

  • WS-Addressing in OSB 10gR3

    Has anyone used WS-Addressing as the Operation Selection Algorithm while configuring Proxy Services in OSB 10gR3? I have a simple use-case - Proxy Service (WSDL Based) ---> Business Service (WSDL Based) During Operation Selection Configuring for the

  • 3DES Ecnryption

    Hi, We are using Seeburger AS2 adapter to send messages to our trading partner. The sender AS2 adapter has the capability of encrypting the AS2 message, and it supports only 3DES ,AES encryption, and few more alogrithms, but not RSA. The J2EE Key Sto