Show TOC

Function documentationEvent GC_EVENT_NEXT_VALUE and GC_EVENT_PREVIOUS_VALUE for Form GUIBBs

 

This is very similar to the toggling in a List UIBB, but is intended for the value list of a drop down field in a Form UIBB. You should use these standard HR reporting events (see super class attributes in AC_HRGRT_REPORTING_FROM_FEEDER), and call the super class method HANDLE_PREV_NEXT_VALUE_EVENT, each time passing the appropriate event and the value list. This method ensures that the correct entry in your value list is visually ‘selected’ on the UI, based on whether the user has selected previous or next.

Example Example

In this code example for handling previous and next buttons/ events, there is one field in a form GUIBB that contains the year. This allows the user to toggle through year entries in that one field, just using the previous and next buttons:

End of the example.

Syntax Syntax

  1. field-symbols:
  2. 	<ls_report_data> type hrxss_report_data,
  3. 	<ls_field_usage> type fpmgb_s_fieldusage,
  4. 	<lv_year> type any.
    
  5. assign cs_data to <ls_report_data> casting.
    
  6. case io_event->mv_event_id.
    
  7. when gc_event_next_value   "buttons pressed
  8. 	or gc_event_prev_value.
  9. 	read table ct_field_usage assigning <ls_field_usage>
  10. 	with key name = 'YEAR'. "#EC WARNOK
  11. 	if sy-subrc eq 0.
  12. *    get next/previous value relative to actual value
  13. *    before: field <ls_report_data>-year contains actual value
  14. 	 	lv_year = <ls_report_data>-year.
  15. *    after: field <ls_report_data>-year contains prev/next value -> new
  16.                                                  actual value
  17. 		me->handle_prev_next_value_event(
  18. 			exporting
  19. 				iv_eventid    = io_event
  20. 				it_value_list = <ls_field_usage>-fixed_values
  21. 			changing
  22. *        ct_messages   = ct_messages
  23. 				cv_value      = <ls_report_data>-year
  24. 	                          ).
  25. 			if lv_year ne <ls_report_data>-year. "year have been changed!
  26. 				lv_form = abap_true.
  27. 				ev_data_changed = abap_true.
  28. 			endif.
  29. 		endif.
  30. endcase.
End of the code.