Skip to Content
author's profile photo Former Member
Former Member

To Generate msg if mandatory field is not filled

Hi Experts,

I want to display msg if mandatory field is not filled , for that i called

CALL METHOD L_MESSAGE_MANAGER->REPORT_ATTRIBUTE_ERROR_MESSAGE

EXPORTING

MESSAGE_TEXT = ' PLEASE FILL ALL MANDATORY FIELD '

ELEMENT = ELEM_GENRAL

ATTRIBUTE_NAME = F_NAME

But i am getting error that F_NAME is not an attribute name but it is attribute name only

What i should do , Please Help

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Posted on Jul 13, 2011 at 06:57 AM

    Hi..

    You can just validate like normal field.

    If attribute value is initial,

    then raise an error message ( report_error_message) , it stops processing the further statements.

    I dnt have knowledge on report_Attribute_error_message, but just analyze like

    ELEMENT = ELEM_GENRAL

    ATTRIBUTE_NAME = 'F_NAME'

    here elem_general is element of "n_name"? (n_name is node name under which F_NAME attribute is there)

    Regards

    Srinivas

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 13, 2011 at 07:46 AM

    Hi Neeraj,

    Remove Required property of that inputfield make it NORMAL.

    For example your input field is INPUT...

    if input is initial.
    
    * report message
              CALL METHOD lo_message_manager->REPORT_ATTRIBUTE_ERROR_MESSAGE
                EXPORTING
                  MESSAGE_TEXT   = 'Pick Quantity Should not be 0... '
                  ELEMENT        =  wa_temp // element
                  ATTRIBUTE_NAME = 'PICK_QTY'.   // Attribute name( name used in context )
    
    endif.

    If you not fill input it will raise error message by hilighting the input field.

    Cheers,

    Kris.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 14, 2011 at 05:42 AM

    Hi

    I think you are talking about attribute in the context not attribute of a class. If this is the case, You can not pass it directly to a method. Use code wizard to generate the code automatically for this attribute(with READ option). Then use the data object declared by this code as ur F_NAME. Leme know if u have any concerns in this.

    Cheers

    Gaurav

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 14, 2011 at 06:02 PM

    Hi Neeraj,

    Meera is correct but means the quote marks are missing on your attribute name.

    You have:

    CALL METHOD L_MESSAGE_MANAGER->REPORT_ATTRIBUTE_ERROR_MESSAGE

    EXPORTING

    MESSAGE_TEXT = ' PLEASE FILL ALL MANDATORY FIELD '

    ELEMENT = ELEM_GENRAL

    ATTRIBUTE_NAME = F_NAME

    Should be:

    CALL METHOD L_MESSAGE_MANAGER->REPORT_ATTRIBUTE_ERROR_MESSAGE 
             EXPORTING
                  MESSAGE_TEXT = ' PLEASE FILL ALL MANDATORY FIELD '
                  ELEMENT = ELEM_GENRAL
                  ATTRIBUTE_NAME =  'F_NAME'.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.