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

Understanding Message EndMessage ecatt command.

Former Member
0 Likes
1,557

Hello Gurus,

Could someone please explain how we can use Message EndMessage command. I have gone through the ecatt command reference on help.sap but I am unable to follow it.

I am using a TCD command which runs a program and within that program it calls and executes different methods and function modules. If the program executes sucessfully then it updates some tables and if does not run sucessfully then it shows corresponding message. So all that I want to do is check for those messages based on return type and display the same message in ecatt log when program does not run sucessfully and the next steps should not be run.

Your help in this regard is highly appreciated.

Regards,

GS.

8 REPLIES 8
Read only

Former Member
0 Likes
1,137

Hello,

In the pattern you have the function called MESSAGE ... ENDMESSAGE , call that and include your TCD or SAPGUI command in between the MESSAGE .... ENDMESSAGE block, so once the TCD is executed all the messages appeared during the execution will be captured in the ENDMESSAGE and you can include the expected message in the MESSAGE block , click on the MESSAGE command and then in the command interface include the mode as 'E' (expected) and the message id and the message number retrieved during the manual operation.

If this expected msg doesnt appear during the the execution thn script fails saying expected msg dint appear.

Thanks & Best regards,

Ajay

Read only

0 Likes
1,137

Hello Ajay,

I have tried using this command however I am not getting the desired output. I dont know whether I am doing it correctly or not. So I will explain it to you and please let me know if I am doing it the right way:

MESSAGE ( MSG_1 ).

TCD ( SE38 , SE38_3 ).

ENDMESSAGE ( E_MSG_1 )

Within the program I have different methods and function modules. for all of them return_type, return_id and return_no are the same only msgv1 to msgv4 are different. I am hoping return_type, return_id and return_no are same as msg_type, msg_id and msg_no. So in Message command Interface i am passing return_type, return_id and return_no into msg_type, msg_id and msg_no and setting mode as E.

When i run the script i get error "specify a program name". So i am not sure I am doing the right way.

Also i would like to know how to get the message that is there in msgv1 to msgv4 in log. That is I am looking to print the message in log for the message I get during pgm execution.

Thanks for your attention.

Regards,

GS

Read only

0 Likes
1,137

Hello Ajay,

I have tried using this command however I am not getting the desired output. I dont know whether I am doing it correctly or not. So I will explain it to you and please let me know if I am doing it the right way:

MESSAGE ( MSG_1 ).

TCD ( SE38 , SE38_3 ).

ENDMESSAGE ( E_MSG_1 )

Within the program I have different methods and function modules. for all of them return_type, return_id and return_no are the same only msgv1 to msgv4 are different. I am hoping return_type, return_id and return_no are same as msg_type, msg_id and msg_no. So in Message command Interface i am passing return_type, return_id and return_no into msg_type, msg_id and msg_no and setting mode as E.

When i run the script i get error "specify a program name". So i am not sure I am doing the right way.

Also i would like to know how to get the message that is there in msgv1 to msgv4 in log. That is I am looking to print the message in log for the message I get during pgm execution.

Thanks for your attention.

Regards,

GS

Hi GS,

According to me the problem doesn't lie in MSG and END MSG block rather the problem should be in your recording ( SE38 --> ABAP Editor) itself. The program name to the initial screen to be passed(along with other parameters) while playback or during execution of eCATT so i think that the program name isn't passed or this field is either not parameterized or not handled in a right way. Please check whether you have parameterized the right field or check your Dynpros(or check TCD interface again)

If you still get problem after you have checked the interface then please let us know.

Thanks and Kind Regards

-


Mohan Kumar K

Read only

0 Likes
1,137

Hi Mohan,

When i execute just the TCD command i dont get any error message. The program gets executed. However when I have the TCD command withing Message and Endmessage i get the error message. 'Specify program name'.

Regards,

GS

Read only

0 Likes
1,137

Hello Gurus,

I am now not getting Specify program name error. However the desired output is not achieved. As informed earlier my TCD command within message and endmessage calls different methods and function modules. For different exceptions ret_id, ret_type, ret_number are same. Only msgv1 to msgv4 are diff. When I run the program manually for a negative scenario i get the message stored in v1 to v4 based on the rety_type, ret_id and ret_number on the screen.

The same program when i run it through TCD command for a negative test scenario i get no batch input data for screen that means the program is throwing error, however nothing gets captured in endmessage and &TFILL = 0.

Could you please let me know why the message is not getting captured in endmessage. All the parameters are assigned properly.

Regards,

GS.

Note: One quick question. Does EndMessage command interface capture message only if the program in TCD gets executed sucessfully. If that is the case I dont think i will be able to capture message because my program in TCD gets terminated for a negative scenario and it gives the message on screen when run manually. So please confirm?

Edited by: Get Started on Mar 25, 2009 12:12 AM

Read only

0 Likes
1,137

Hello Mohan,

I see that that the issue you have mentioned will not be solved using messages.

You get the error while running the eCatt because, while recrding the ecatt in transaction SE38, the report program name auto populated and hence while running the ecatt again, if the auto population does not happen, it fails with the error message you have mentioned.

So to correct this, go the the step in the recording and change the mode from I to S . the error will be resolved.

I checked this post today but still replying for the benefit of any one else facing the error in future.

--Karthi

Read only

Former Member
0 Likes
1,137

Hi GS,

We will use the command MESSAGEu2014ENDMESSAGE to capture the messages occurred during the execution.

For example: I have writtn this code for capturing the Sales order number created while doing the recording .That will be recorded in script as message, like below

MESSAGE ( MSG_1 ).

SAPGUI ( VA01_4001_STEP_3 ).

ENDMESSAGE ( E_MSG_1 ) .

E_VBELN = E_MSG_1[1]-MSGV2.

E_VBELN Is a parameter of type E.

Hopes this is helpful to u ..

Regards ,

Gowri

Read only

dirk_wittenberg
Contributor
0 Likes
1,137

Hello GS,

how did you fill the interface of the MESSAGE-command?

Using the EXIT- and MODE-fields in the command-interface you can determine the behaviour after a message occured.

EXIT: If the EXIT field is initial, execution continues with the next eCATT command. If the EXIT field has the value X, execution skips to the ENDMESSAGE command when the current command finishes.

Mode

F: Failure. The relevant command is marked as having an error.

A: Allowed. The relevant command is marked as not having an error.

E: Expected. By ENDMESSAGE, at least one expected message must have been collected by at least one rule. If not, ENDMESSAGE is marked as having an error.

R: Required. By ENDMESSAGE, every rule with this mode must have registered at least one message. If not, ENDMESSAGE is marked as having an error.

Regards

Dirk