Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Event check_data_changed

Former Member
0 Likes
741

Hi all,

I have a requirement where i need to change the the records and create a new records in GRId.

I am referrering the standard programs BCALV_GRID_03 & BCALV_GRID_04.

But there the event check_data_changed is triggering only at the time SAVE button.

So where iam creating 3 records and changing the two records, if there are 3 errorneous records it showing only at the time of saving SAVE.

Is it possible to restrict the following error when we are entering to the next record.

All the errors are able to see at the last.

Please let me know is there is any option to check at the time of entry itself.

Regards,

Madhavi

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
543

Hello Madhavi

You can call method go_grid->REGISTER_EDIT_EVENT. The effect is that when the user pushes the ENTER button event DATA_CHANGED is triggered.

There is no possibility to check the data when they are being entered.


...
  CALL METHOD go_grid->register_edit_event
    EXPORTING
      i_event_id = cl_gui_alv_grid=>mc_evt_enter
    EXCEPTIONS
      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.
...

Regards

Uwe

3 REPLIES 3
Read only

uwe_schieferstein
Active Contributor
0 Likes
544

Hello Madhavi

You can call method go_grid->REGISTER_EDIT_EVENT. The effect is that when the user pushes the ENTER button event DATA_CHANGED is triggered.

There is no possibility to check the data when they are being entered.


...
  CALL METHOD go_grid->register_edit_event
    EXPORTING
      i_event_id = cl_gui_alv_grid=>mc_evt_enter
    EXCEPTIONS
      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.
...

Regards

Uwe

Read only

0 Likes
543

Hi Uwe,

You mean to say that to check a record at entry level

is only option to ENTER button after entering every record.

what you suggest to change and create records at GRID level or

change/create the records in other screen.

Regards,

Madhavi

Read only

0 Likes
543

Hello Madhavi

In Visual Basic forms you have the possibility to check then entered data because there are events available like KeyPress. Thus, you can validate immediately.

In the grid control we do not have this option (at least I am not aware of it). Therefore the user has to trigger the DATA_CHANGED event by pushing ENTER or a function button like SAVE.

This is the same behaviour like we have in maintenance views. You can always enter wrong data (e.g. if you have foreign key relationships). As long as you do not push ENTER (i.e. trigger PAI -> validations) the SAP system does not even "know" that you entered wrong data.

Regards

Uwe