cancel
Showing results for 
Search instead for 
Did you mean: 

HRESS_W4_

0 Kudos

WEBDYNPRO OBJECT: HRESS_C_W4

Requirement is to validate Number of Allowances (PA0210-NBREX) .

If NBREX is greater than 10, then a custom message should trigger.

I have written logic in CL_HRESS_PER_OVERVIEW (Method: IF_FPM_GUIBB_LIST~GET_DATA)

LOGIC:
IF iv_eventid->mv_event_id = cl_fpm_event=>gc_event_save OR iv_eventid->mv_event_id = cl_fpm_event=>gc_event_goto_error_display.
      ASSIGN COMPONENT 'NBREX' OF STRUCTURE <lt_ct_data1> to <nbrex>.
IF <nbrex> GT '10'.
lv_text
= 'A maximum of ten (10) exemptions are allowed to be entered. To enter eleven (11) or more exemptions please contact SSC at 717-396-5300'.

APPEND plaintext_to_message( iv_text = lv_text iv_severity = if_fpm_guibb_constants=>gc_severity-error ) TO et_messages.

Even though I am passing an error, data is getting saved.

Kindly suggest some solution.

Accepted Solutions (0)

Answers (2)

Answers (2)

KK07
Contributor
0 Kudos

Hi,

Infotype business logic validations should be done by implementing Badi HRPAD00INFTYBL, Feeder class will automatically calls this logic and therefore can prevent from saving the data to d/b.

Please check the below link to understand the new ESS framework..

0 Kudos

Hi Krishna,

I have implemented the logic in the BADI 'HRPAD00INFTYBL' but its not getting triggered atleast in Debug mode

Former Member
0 Kudos

Hi,

Is there any code after below statement to save the data?



APPEND plaintext_to_message( iv_text = lv_text iv_severity = if_fpm_guibb_constants=>gc_severity-error ) TO et_messages.

<Is there any code here to save the data> ?

Thanks

KH

0 Kudos

This is my code after the above lines.


DELETE et_messages WHERE severity = if_genil_message_container=>mt_warning OR severity = if_genil_message_container=>mt_info OR severity = if_genil_message_container=>mt_success.

IF et_messages IS NOT INITIAL.

     cl_hress_fpm_msg_services=>set_message_context( CHANGING ct_message = et_messages ).

event = cl_fpm_event=>create_by_id( cl_fpm_event=>gc_event_goto_error_display ).

ev_data_changed = abap_false.

   ENDIF.



After this code , the debugger is going to the CL_FPM class and checking the events, in the method RAISE_FPM_EVENT.



Should I modify the error message!


Please suggest.