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

messages

Former Member
0 Likes
594

hi,

can any one please send me the sample code how to use messages in a report.

if in the selection screen we enter invalid details it should display a message as enter valid details.

what is a message class. where do we create. what is its purpose please explain.

if we have bukrs and belnr in selection screen if we enter invalid details it should display as enter valid belnr and enter valid bukrs.

please send me sample report having these functionalities.

thanks in advance.

5 REPLIES 5
Read only

Former Member
0 Likes
568

Hi,

You can attain this functionality using text elements.

e.g.: IF BUKRS NE '1000'.

MESSAGE S(001). "use of text symbol

ENDIF.

This will give a message in the Status bar of your screen.

To write the text of this text symbol, in the window where you write your report program, go to the menu bar and proceed as follows:

Go To -> Text Elements -> Text Symbols

You will find a page you must input a number like '001', etc..

In the example, corresponding text "Company Code is Invalid" according to 001.

Then click 'Save' and Activate.

Run the report program, if the condition arises, message will be displayed in the Status Bar.

Reward if Helpful.

Edited by: prosenjit chaudhuri on Feb 15, 2008 9:01 AM

Read only

0 Likes
568

if i dont know which bukrs the user is entering the how can i say BUKRE NE 1000.

Read only

Former Member
0 Likes
568

hi,

The ABAP statement MESSAGE triggers a standard message dialog.

Message classes are Repository objects that contain the texts for message dialogs. These texts can be

translated and are displayed in the logon language. Each message text is assigned to a message class

and given a three-digit identifier.

To trigger a message dialog in a program, enter the MESSAGE statement with the following additions:

ID '<message class>' - the message class

NUMBER '<number>' the message number.

To display the message text for a MESSAGE statement in a program's source code, double-click the

message number to navigate the associated message class texts.

A --Termination Processing is terminated; the user must restart the transaction

X --Exit Like a termination message, but with short dump MESSAGE_TYPE_X

E --Error Runtime behavior depends on context

W --Warning Runtime behavior depends on context

I --Information Processing is interrupted, the message is displayed in a dialog box and

the program continues when the message has been confirmed with

ENTER.

S --Set The message appears in the status bar on the next screen.

MESSAGE ID '<message class>' NUMBER <message number>

WITH <var1> <var2> <var3> <var4> .

Hope this is helpful, Do reward.

Read only

Former Member
0 Likes
568

hi,

To create a new message class from the ABAP Editor:

In the initial statement (for example, REPORT) or directly in the statement MESSAGE ID <id> enter a parameter value of up to 20 characters as a message ID, for example:

REPORT <name> MESSAGE-ID <message class>.

Messages are stored system-wide. The chosen message ID (message class) must not already exist in the system.

Double-click the message ID.

If you enter an ID that already exists in the system, the system calls up Message maintenance. In this case, enter a different ID. Once you have done this, the system asks you whether you want to create a new message class.

Choose Yes.

The system calls up Message maintenance.

Enter a brief description of the class in Short text.

Choose Save.

Hope this helps.

Read only

Former Member
0 Likes
568

Hi,

here is the answer for your Q.

SELECT-OPTIONS: so_qmnum FOR qmel-qmnum OBLIGATORY.

  • validation of qmnum

AT SELECTION-SCREEN ON so_qmnum.

SELECT SINGLE * FROM qmel WHERE qmnum IN so_qmnum.

IF sy-subrc NE 0.

MESSAGE e100(ztest) WITH so_qmnum-low.

ENDIF.

==> message class is nothing but where it stores all the messages ranging from 000 to 999. if you want to create message class go to SE91 and enter some message class name then press F5 then proceed.

reward if helpful.

Regards

Venkat

Edited by: venkata prasad on Feb 15, 2008 9:23 AM