cancel
Showing results for 
Search instead for 
Did you mean: 

EhP5 WDA ESS: Not able to marke fields as mandatory

former_member557553
Participant
0 Kudos

Hello Community,

currently I am customizing WDA ESS Scenarios on EhP5. I added some new fields in the method IF_FPM_GUIBB_FORM~GET_DEFINITION of the feeder class for the scenario.

The method has also an EXPORTING Parameter for the field descriptions (ET_FIELD_DESCRIPTION).

The table line is structure of FPMGB_T_FORMFIELD_DESCR and I did the following to mark some fields as 'mandatory':

READ TABLE et_field_description WITH KEY name = 'STRAS' ASSIGNING <fs_wa_mand_field>.
  <fs_wa_mand_field>-MANDATORY = abap_true.

  READ TABLE et_field_description WITH KEY name = 'PSTLZ' ASSIGNING <fs_wa_mand_field>.
  <fs_wa_mand_field>-MANDATORY = abap_true.

  READ TABLE et_field_description WITH KEY name = 'ORT01' ASSIGNING <fs_wa_mand_field>.
  <fs_wa_mand_field>-MANDATORY = abap_true.

  READ TABLE et_field_description WITH KEY name = 'ZZ_CITY_CODE' ASSIGNING <fs_wa_mand_field>.
  <fs_wa_mand_field>-MANDATORY = abap_true.

  READ TABLE et_field_description WITH KEY name = 'MELDEZETTEL' ASSIGNING <fs_wa_mand_field>.
  <fs_wa_mand_field>-MANDATORY = abap_true.

Now I expect, that the fields on the ESS scenario would have a red asterisk. But I am also able to save the data with not entering all neccessary data.

What I have to do, to mark the fields as mandatory?

Thank you and best regards, Christian

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member557553
Participant
0 Kudos

Hello community,

I've found the problem.

So in method IF_FPM_GUIBB_FORM~GET_DATA the table CT_FIELD_USAGE was overwritten. At the top of the method this table had the information about all mandatory field. But during the processing the table was overwritten and the information which fields are mandatory, as well.

So if you define the mandatoy fields at the bottom of the method you will get the red asterisk.

Here the code snippet:

FIELD-SYMBOLS <fs_wa_mand_field> TYPE FPMGB_S_FIELDUSAGE.

*** Define maddatory fields
  READ TABLE CT_FIELD_USAGE WITH KEY name = 'STRAS' ASSIGNING <fs_wa_mand_field>.
  <fs_wa_mand_field>-MANDATORY = abap_true.

  READ TABLE CT_FIELD_USAGE WITH KEY name = 'PSTLZ' ASSIGNING <fs_wa_mand_field>.
  <fs_wa_mand_field>-MANDATORY = abap_true.

  READ TABLE CT_FIELD_USAGE WITH KEY name = 'ORT01' ASSIGNING <fs_wa_mand_field>.
  <fs_wa_mand_field>-MANDATORY = abap_true.

  READ TABLE CT_FIELD_USAGE WITH KEY name = 'ZZ_CITY_CODE' ASSIGNING <fs_wa_mand_field>.
  <fs_wa_mand_field>-MANDATORY = abap_true.

  READ TABLE CT_FIELD_USAGE WITH KEY name = 'MELDEZETTEL' ASSIGNING <fs_wa_mand_field>.
  <fs_wa_mand_field>-MANDATORY = abap_true.

Thank you and best regards, Christian

Former Member
0 Kudos

Making a UI element mandatory is not going to execute validations, it just makes the red star indication after the label to visualize that it is mandatory.

This has been widely discussed in WebDynpro threads, see note 948753 for detailed solution.

former_member557553
Participant
0 Kudos

Hello Baskaran,

thank you for your reply.

I am with you, that I have to implement the logic to validate the fields. But there should be red asterisks with the logic i described above but they aren't there.

With best regards, Christian

Former Member
0 Kudos

You have to debug and see if the et_fields returned has the Mandatory property true and see if this really binded in the UI property state in the feeder class.