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

ABAP Table event on specific column

0 Likes
1,850

Hello ,


I have a custom table and have implemented the Table Maintenance Generator. When the table is maintained I would like to check on the save event (02) if a specific column was maintained/changed or new entry or was added to the column. If it was I'd like to handle it in the fired event (02) - After saving the data in the database.

Right now the event fires (of course as it should) upon clicking the Save button during table maintenance. How do I check in this event that the specific column had changed?

Regards,

D.

Hello ,


I have a custom table and have implemented the Table Maintenance Generator. When the table is maintained I would like to check on the save event (02) if a specific column was maintained/changed or new entry or was added to the column. If it was I'd like to handle it in the fired event (02) - After saving the data in the database.

Right now the event fires (of course as it should) upon clicking the Save button during table maintenance. How do I check in this event that the specific column had changed?

Regards,

D.

4 REPLIES 4
Read only

NooruBohra
Active Participant
0 Likes
1,607

I don't think "ON_DATA_CHANGE" event is applicable here. What you can do is use event 21 or 05 to capture the changed data and validate. Question: Why you need to check in event 02? Are you going to do some post processing?

Read only

hsyngvural
Participant
0 Likes
1,607

Hi,

Have you tried "01 - Change" event?

Best regards.

Read only

former_member660513
Participant
0 Likes
1,607

As a reference you might check the definition of the view cluster EHFNDVC_BO_FC in transaction se54.

Should be available in every S4 system.

Open it in tcode se54, select 'Display'.

Go to 'Events'.

Check the event 04, and the form routine FC_SAVE_TIME_CHECKS.

You should be able to use it as a skeleton.

Read only

1,607

Hello All,
Thank you for your suggestions.

I was wondering, is there a way to pass data between events? For example, if I use event 01 - (Before saving the data to the database) to track any changes happening in the specific column in question, once the user hits save, event 02 - (After saving the data to the database) triggers and the data from event 01 like an internal table or something can be used in event 02 to do all the post processing. Is that possible?

nooruddin.bohra17, yes I need to post process after the user saves the data. I don't want to process anything before the user commits the change.

@huseyin, I need to process only after user saves the data.

georgislavov, The FC_SAVE_TIME_CHECKS implementation:

FORM fc_save_time_checks.
  DATA:
    ls_cust_data  TYPE ehfnds_fc_bo_cust_profile_data,
    lv_has_errors TYPE abap_bool.<br>
* clear the global variables
  CLEAR gt_profiles_changed.
  CLEAR gt_profiles_deleted.<br>
  IF vcl_action = 'U'.
*   check, whether changes have to be saved
    LOOP AT vcl_struc_tab TRANSPORTING NO FIELDS
       WHERE upd_requ NE space.
    ENDLOOP.
    IF sy-subrc = 0.
      PERFORM get_profile_data_from_vc
        USING
          abap_true
        CHANGING
          ls_cust_data
          gt_profiles_changed
          gt_profiles_deleted.
*      CALL METHOD /scmtms/cl_bo_fc_viewmaint_hlp=>check_bo_profile_multi
*        EXPORTING
*          it_profiles         = gt_profiles_changed
*          iv_display_results  = abap_true
*          is_customizing_data = ls_cust_data
*        IMPORTING
*          ev_has_errors       = lv_has_errors.
*         et_error_messages  = gt_messages.
*      IF lv_has_errors = abap_true.
*        vcl_stop = 'X'.
*      ENDIF.
    ENDIF.
  ENDIF.
ENDFORM.                    "fc_save_time_checks

I haven't really figured out how I'd use this yet, but looking into it.
Regards,

D.