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

How to write message.

Hello Experts,

I have a done report where I have made a bapi.

In this BAPI when Order number is passed I get the message. like order no 501 is saved

But when my order no is not relevant I need to get a meesage like:

Order No 50000 is not relevant.

Order no= itab-aufnr.

I am only writing message as:

MESSAGE 'ORDER NO NOT RELEVANT FOR BAPI' TYPE 'I'.

Over here how can I pass itab-aufnr is message?

Thanks and Regrds,

Nikhil.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 06:56 AM

    Hi,

    MESSAGE 'ORDER NO' itab-aufnr 'NOT RELEVANT FOR BAPI' TYPE 'I'.

    -Rajneesh Gupta

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      You can also pass '&' in text element .

      ex: MESSAGE e999 WITH w_error1 w_error2 w_error3.

      w_error1 = ' Order No."

      w_error2 = itab-aufnr.

      w_error3 = 'Not relevant for BAPI'.

      Thanks,

      Aravind

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 06:57 AM

    Hi,

    Go to se91 and create a message in one of the existing message classes or create a new message class create message like below with '&' signs.

    you cna have upto four "&" signs which are actual place holders for messages

    then call message in your prorgam like below:

    
    message i000(zz) with 'ORDER NO NOT RELEVANT FOR BAPI'  itab-aufnr .
    

    Try F1 help on key word message for more info

    Regards,

    Himanshu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 07:22 AM

    Hi

    Please check this.

    DATA: mid TYPE sy-msgid VALUE 'SABAPDOCU',

    mtype TYPE sy-msgty VALUE 'I',

    num TYPE sy-msgno VALUE '014'.

    MESSAGE ID mid itab-value TYPE mtype NUMBER num.

    or

    MESSAGE 'Message in a Method' itab-value TYPE 'I' RAISING exc1.

    please try F1 help on 'Message' , you will surely get better options.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 18, 2009 at 07:28 AM

    Hi

    Which BAPI you are using for?

    If you are using Standard BAPI,then BAPI itself will throw the error message if the BAPI contains the Exceptions section.

    Regards,

    Sreeram

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 07:58 AM

    Hi,

    From abap editor se38->goto->messages.

    create a message in zclass say ' Order No &1 is not relevant'.

    write code as

    here z_tezt- msg class,

    000- msg number

    w_str -order no.

    message id 'Z_TEST' type 'I' number '000' with w_str .
    

    Regards,

    Deeba

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2009 at 08:54 AM

    solved thanks

    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.