0

I need to check a field in my ALV, set as editable, when it is changed.

This is my fieldcat with the concerned field set as editable:

  CLEAR wfieldcat.
  wfieldcat-fieldname     = 'PERDEVA'.
  wfieldcat-ref_fieldname = 'PERDEVA'.
  wfieldcat-ref_tabname   = 'IT_DEVALUATS'.
  wfieldcat-seltext_s     = 'Devaluat'.
  wfieldcat-seltext_m     = 'Devaluat'.
  wfieldcat-seltext_l     = 'Devaluat'.
  wfieldcat-ddictxt       = 'M'.
  wfieldcat-edit          = 'X'.            "<==========
  APPEND wfieldcat TO p_fieldcat.

Once the field is changed by user, I need to check some conditions for value, and if they are not accomplished, just call my own refresh form.

Probably there are some Function Modules or Methods to do that, but every documentation that I found refers to S/4HANA and I'm using R/3.

Edit: As I said in comments "CHECK_CHANGED_DATA" is the Function Module that i was looking for, and @Suncatcher provides the threat with a properly usage example.

marcdecline
  • 186
  • 4
  • 22
  • Ok, i found [CHECK_CHANGED_DATA](https://www.se80.co.uk/oo-abap/i/if_g/if_glmwb_bp_model-check_changed_data.htm)'s method as a possible solution. I'm going to try to implement it – marcdecline Dec 03 '20 at 16:30
  • Perhaps this may help you [ALV grid edit events](https://stackoverflow.com/questions/46405640/mark-checkboxes-in-alv-output-grid-as-selected/46405902#46405902) – futu Dec 05 '20 at 02:37
  • @Suncatcher thanks! There are the example that I need :) – marcdecline Dec 07 '20 at 16:14

1 Answers1

2

You should see the demo programs, Go to SE38 tcode and you can write BALV* or BCALV* press f4. You can see check_changed_data implement examples.

  • To be exact: `BCALV_EDIT_03` - Verification of modified cells. But anyway this example collection is really good starting point with explanations in code. – astentx Dec 05 '20 at 22:55
  • 2
    Please [provide context for links](https://stackoverflow.com/help/how-to-answer), i.e. a brief explanation about how these demo programs solve the OP question. – Sandra Rossi Dec 06 '20 at 14:14
  • 1
    Note that this question is a duplicated question (as already noticed by Suncatcher) and I have just added a minimal reproducible example to this other question/answer to demonstrate how this method can work (not optimal but at least minimal). – Sandra Rossi Dec 07 '20 at 14:31
  • @SandraRossi yes, that thread is what I was looking for :) – marcdecline Dec 07 '20 at 16:16