cancel
Showing results for 
Search instead for 
Did you mean: 

Plausibility Check for Fields in FPM

Former Member
0 Kudos

Hi Experts,

When I add a fixed value list to a field, there is an automatic plausibility check, if the entered value is in the fixed value list. If the value is not in the list, an error message appears and the the field is highlighted red. You have to enter a valid value or delete the value before the message dissapears and the field color returns to white.

Now my question. Is there a possibility to implement such a check manually? I know the Methods in the Feeder-Class and I know how to implement an error message. But can I highlight the checked field (I know I can use collors for every field, but i don't want to implement a "collor handling" for every single field in my application) and can I check in Flush method or an other method if there are highlighted fields that have to be checked?

Thanks and regards,

Sebastian 

Accepted Solutions (1)

Accepted Solutions (1)

Aliaksandr
Active Participant
0 Kudos

Hi Sebastian,

IF_FPM_GUIBB_LIST~PROCESS_EVENT method is more appropriate place where you can do such check. You wrote you know 'how to implement an error message', just fill in REF_NAME (column name) and REF_INDEX (row index) fields in ET_MESSAGES parameter.

Kind regards, Aliaksandr.

Former Member
0 Kudos

Thanks allot. You made my day

Correct answer

Former Member
0 Kudos

HI Aliasksandr

I have requirement to set the radio button to yes position in Person injured tab it another input field has a specific value & I am writing the logic in get_data method and updating the node (personal involved) but this is not working for me i have to press save again to save the data ,in first save it juts changed the value at screen but not at database level .

Uli_42
Participant
0 Kudos

Unfortunately that does not workt everytime.

even if i  do pass Ref_INDEx and REF_NAME (or ref_names as table ), neither the row nor the column is highlighted if the field with name ref_name is not editable.

(That might be quite reasonable on the fist view, but i think it is  not necessary.  In my case, i have the information about the reference coming fom the outsie and want to link ot this field, even it is not editable. But that will only be possible by writing more own code. Not good. )

Regards,

Uli

Answers (3)

Answers (3)

Former Member
0 Kudos

HI Sebastian

I have requirement to set the radio button to yes position in Person injured tab it another input field has a specific value & I am writing the logic in get_data method and updating the node (personal involved) but this is not working for me i have to press save again to save the data ,in first save it juts changed the value at screen but not at database level .

Former Member
0 Kudos

Two more questions. Is there a posibility to see in the nex round trip, which field was highlighted, so that I can check the value again and delete the message. And how can I delete the message?

simon_hoeg
Advisor
Advisor
0 Kudos

Hi Sebastian,

messages (by default) have a lifetime of one roundtrip. So, if the error is not added any more during the next roundtrip, it will not rendered on the UI.

Best regads,

Simon

Former Member
0 Kudos

Thanks for that info. My problem is, I want to check changed fields. This is only possible in the flush method, but the flush has no et_message parameter (I don't get, what the flush method is for). As long as a user changes a field I can check it, but what happens if a user doesn't change a field again after the plausibility check failed and presses the save button? How can I check the field again or even know which field I have to check?

Ok, I could check all fields before saving. Problem is, there are many fields and only a few are changed, and the customer has maintained some old and wrong values which shouldn't be checked again, because some datasets in the table must not changed anymore.

As you can see, the Field Check and message handling is my biggest problem at implementing

Thanks and regards,

Sebastian

simon_hoeg
Advisor
Advisor
0 Kudos

Hi Sebastian,

method FLUSH is mainly used to pass data to other data containers.

Plausability checks should be done in method PROCESS_EVENT for event SAVE. If the data are not correct you have to cancel the FPM Event Loop via EV_RESULT = 'FAILED' (resp. if_fpm_constants=>gc_event_result-failed), in addition to the messages in ET_MESSAGE.

Best regards,

Simon

Former Member
0 Kudos

Thanks again for your quick response. So, it's not possible to check only changed fields?

Another question: If I use fixed values for a field in UIBB embeded in a Page, there is an automatic check if the entered value is in the list of fixed values. If I use fixed values in a Dialogbox, there is no check. Do I have to activate the check somewhere? 

simon_hoeg
Advisor
Advisor
0 Kudos

Hi Sebastian,

if you collect the information from method FLUSH and persist it in a private attribute of the feeder class, you may then react accordingly in method PROCESS_EVENT.

For the dialog I recommend to enable the type for action CLOSE to "Standard" and not "Validation Independent". This can be done in FLUID, i.e. when configuring the dialog.

Best regards,

Simon

Former Member
0 Kudos

Thanks. Maybe thats what I want to do.

The Type for event Close is already "Standard". But anyway, my fixed values are not checked? Do you know why?

And I have another Problem with my Form_window. At one page i have a list window and on another page I have a form window. On the form Window no roundtrip is triggered after pressing the enter button. Do you know why?

Thanks and regards,

Sebastian

simon_hoeg
Advisor
Advisor
0 Kudos

Hi Sebastian,

hmm ... could be that the FPM_CLOSE_EVENT is stronger, the colleagues from WDA should answer this, Nevertheless you can still cancel (->EV_RESULT='FAILED') the close event at PROCESS_EVENT, if the values are not correct.


Regarding the input field on the form, please check if there is any action (i.e. FPM event) assigned in the configuration environment (-> FLUID). Mind that normally you do not need an action just for saving the data, as long as you fill your data container (-> e.g. a private attribute) at FLUSH.


Regards,

Simon

Former Member
0 Kudos

I have already a workaround for the problem. In method flush I check if the entered value is in the fixed value list, but thats just a workaround and doesn't fit to the standard action in my other Compoments.

simon_hoeg
Advisor
Advisor
0 Kudos

Hi Seastian,

the above check that you mentioned regarding domain fixed values is done automatically by the WDA framwork.

For manual checks e.g. in feeder method GET_DATA or PROCESS_EVENT you have to use exportig parameter ET_MESSAGE and provide for each message at least the REF_NAME, i.e. the corresponding field name, to enable the field reference (red for error, yellow for warning).

The outcoming messages will pass the FPM Message Manager (->delete of duplicates, message mapping) and will finally reach WDA message manager.

Regards,

Simon

Former Member
0 Kudos

also correct anser!

Thanks you.