cancel
Showing results for 
Search instead for 
Did you mean: 

Mandatory fields message

IanStubbings
Active Participant
0 Kudos

Hi

Is there a way to change the mandatory fields message output from CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW.

I would like a custom message to be displayed and not the standard 'Fill in all required fields'.

Cheers

Ian

Accepted Solutions (1)

Accepted Solutions (1)

former_member515618
Active Participant
0 Kudos

Hi Ian,

Unfortunately, this message canot be changes as it is generated and exported out by the standard SAP.

As an alternative, set the check box for displaying the messages to abap_false and one of the import parameters returns a flag 'X' if error occurs. Based on this flag try displaying the your custom message.

If you want to do it at field level, then you can use CHECK_MANDATORY_ATTRIBUTES method, pass the attribute that is checked in parameter ATTRIBUTE_LIST and raise as mentioned earlier.

Though elementory way, checking the fields for initial value and raising field is also one way to do the same.

Hope this helps.

Regards,

Sravan Varagani

IanStubbings
Active Participant
0 Kudos

Hi Gents

Thanks for the swift responses.

I have tried outputting my own message after passing in abap_false for the display messages parameter, which is fine, but the field containing the error is not highlighted!

Therefore, my question now is whether I have a choice of either the highlighted field and the standard message or a custom message without the highlighted box.

Cheers

Ian

former_member515618
Active Participant
0 Kudos

Hi Ian,

You are right, raising of the message and highlighting of the field as both done togeather inside the method. So if you want to raise a message and highlite the field use our standard way of checking the value of the attribute for initial and use attribute_message to highlite the same.

Regards,

Sravan Varagani

Former Member
0 Kudos

hi ian....

you cannot highlight it...

what you can do is may be you can jsut enable the fields in which no values are entered and disable others dynamically.

---regards,

alex b justin

Answers (2)

Answers (2)

IanStubbings
Active Participant

Many thanks for your help guys.

I can't help thinking that it's a poor solution delivered by SAP. It only seems to go halfway.

Former Member
0 Kudos

hi ian....

what you can do is,

the method returns a message parameter.

check whether it is initial. if it is not....

then use the code wizard and generate your own message.

---regards,

alex b justin