cancel
Showing results for 
Search instead for 
Did you mean: 

Message---- End Message in Ecatt - -SAPGUI

Former Member
0 Kudos

Hi Everyone:

Can some one give me a detailed information about Message and End Message commands in Ecatt-SAPGUI.

How can they be used?

What are the main advantages etc.

Thanks,

Rajesh.S

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Rajesh

You can basically use the Message/End Message statement to surround SAPGUI or TCD commands to capture messages from the GUI as raised by the MESSAGE ABAP Statement in your programs. The captured messages can then be analysed using a set of specified rules to determine whether the program is functioning as expected or not.

For example, the following eCATT segment was used to capture a message from the program that certain data was successfully generated and saved.

MESSAGE ( OPTIONAL_COMMANDS ).

SAPGUI ( CONFIRM_SAVE ).

SAPGUI ( CONFIRM_GENERATE_SUCCESS ).

SAPGUI ( SAVE_SUCC_MSG ).

ENDMESSAGE ( E_OPTIONAL_COMMANDS ).

The command interface used with the Message/End Message statement, in this case the command interface is called OPTIONAL_COMMANDS, will determine how the eCATT script will respond to the messages received from the SAPGUI commands.

The command interface has a specific parameter called MODE which will determine whether a specific message is allowed, is expected, is considered an error or is obligatory. You can also specify whether the script should exit if the specified condition is not met using the EXIT flag in the command interface. Also note that the command interface used with the Message/End Message statement can contain a number of these kind of rules as to establish a set of rules used to govern the expected behaviour in terms of the messages being raised by the program.

In your recorded SAPGUI or TCD statements specifically look for the Message variant in the recording to see what messages should be raised by the program in terms of the message classes and message numbers since you are going to need these to fully specify your messages to the Message/End Message statement. The following is an example of the message recorded in the CONFIRM_GENERATE_SUCCESS command interface from the above code except that can be used to determine the exact information to use in drawing up the OPTIONAL_COMMANDS command interface for the Message/End Message statement:

Message

Type I

Text Report /EPIUSE/VM3REP_22000003_NEW was generated successfully.

Id /EPIUSE/VM3MESS

Number 225

Parameter1 /EPIUSE/VM3REP_22000003_NEW

Parameter2

Parameter3

Parameter4

AsPopup X

Here your expected message is an information message (Type I), the message class would be /EPIUSE/VM3MESS as recorded in the Id field and the message number would be 225, do take note of these fields since you are going to need them to draw up the command interface for the Message/End Message statement. The parameters 1-4 might also be used in your Message/End Message statement conditions to really narrow down your expected messages. Well, this is a lot of information for you, I hope it helps...

Stay well

Ettienne Hugo

former_member585451
Active Participant
0 Kudos

Hello Rajesh,

In addition to what Mr. Ettienne Hugo said, I would like to add few more points

Say, when you are working with any customizing views, the general message you would expect is 018 - Data was saved.

So, such messages you Expect in the rule.

Also, for the same situation you can also expect 009 - An entry already exists for the same key.

As your purpose is to create a item in the view with that name, you can expect it as your purpose is solved.

There are some situations, where in you get messages with number 344 - Control data obselete, such messages are error messages but then you would get them after succesful execution of the script. In those situations you Allow those messages.

In other situations, you would want your script to be an error when you get one kind of message, such ones, you can define as Error.

Comin to conditions:

In the MSGV1/MSGV2 of the rules, you would capture the number/name of the item created / its description.. If you parameterize such fields, you could use those values in further processing.

Suppose, you have created a Quotation for a PO. So, after succesfully execution you would get the Quotation number, you can captre it and while creating a PO, you could copy it..

Hope it helps you..

Best regards,

Harsha