Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Customize message for obligatory fields

Former Member
0 Likes
3,111

Hi All,

I made one of selection-screen field as obligatory ...But, my requirement is like I want to display my own custom error message when it doesn't have any value other than giving default error message "fill in all the require fields"...

Also, this fileds need to be obligatory where it needs that obligatory symbol for that sel.screen field.

Please help me in this regard..

Regards,

Sundeep.

9 REPLIES 9
Read only

Former Member
0 Likes
1,811

Hi Sundeep

In that case remove obligatory from the selection field and

check the screen field in At Selection-Screen on <Field>.

If <Field> is intial.

*give your error message

Endif.

Regards

Neha

Read only

Former Member
0 Likes
1,811

But, I need the symbol which appears on sel screen, only with the case of obligatory field

Read only

0 Likes
1,811

Hi there check this..

MESSAGE i009 DISPLAY LIKE 'E' WITH 'Customer Hierarchy & Sold to Customer'  ' cannot be entered together'.

information message

MESSAGE E009 DISPLAY LIKE 'E' WITH 'Customer Hierarchy & Sold to Customer'  ' cannot be entered together'.

error message ( red line on SS)

MESSAGE S009 DISPLAY LIKE 'E' WITH 'Customer Hierarchy & Sold to Customer'  ' cannot be entered together'.

success message ( green line on SS)

Read only

Former Member
0 Likes
1,811

Can anyone help me in this regard....

Thanks,

Sundeep

Read only

0 Likes
1,811

Hi sandeep,

if it obligatory and you dont enter before you press ENTER the system message has the TOP priority THIS IS sap standard NO ONE CAN CHANGE THIS.

once entered you can implement your own messages.

Regards

Ramchander Rao.K

Read only

Former Member
0 Likes
1,811

Hi,

But i don't think there is a way to show the Obligatory sign without makin it Obligatory but you can suppress the system message by using

CALL FUNCTION 'MESSAGE_TEXT_BUILD'

EXPORTING

msgid = p_g_msgid

msgnr = p_g_msgno

msgv1 = p_g_msgv1

IMPORTING

message_text_output = p_g_message.

using this you can generate your own message saying to "fill in all the require fields"... and user will be able to edit it but if you simply raise message by MESSAGE E.... you will not be able to enter values.

Read only

Former Member
0 Likes
1,811

Hello Sundeep,

If you have made that field as objigatory it will always display the standard message 'Please fill in all fields". Remove the obligatory addition the selection screen and try to validate the same and if it is initial throw your custom message.

if p_selectionscreen is initial.

message 'You forgot to fill the selection screen field Selections" type 'E'.

endif.

Hope it helps.

Thanks,

Jayant

Read only

Former Member
0 Likes
1,811

Hi Neha,

Could you please elaborate the solution suggested by you..The FM given by you

will create a message string..But Iam not getting how it will suppress the System message.

Thanking in advance..

Regards,

Sundeep.

Read only

0 Likes
1,811

Hi

I suppose you've inserted the option OBLIGATORY, u need to delete it and manage your message in the event AT SELECTION-SCREEN just as the guys have said you:

SELECT-OPTIONS: S_BUKRS FOR T001-BUKRS OBLIGATORY.

You need to suppress the OBLIGATORY

SELECT-OPTIONS: S_BUKRS FOR T001-BUKRS.

AT SELECTION-SCREEN.
  IF S_BUKRS[] IS INITIAL.
     MESSAGE .............................
  ENDIF.

Max