Application Development 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: 

eCATT MESSAGE ENDMESSAGE

daniel_mccollum
Active Contributor
0 Kudos
494

I've been following the help texts for SECATT to begin automating some tests inside SAP.

I have a current eCATT using a FUN ( BAPI* ) which may or may not result in errors.

according to the documentation, & all the forum answers for similar questions the best handler is the MESSAGE ... ENDMESSAGE commands.

https://help.sap.com/viewer/6d9490f96c4b1014a344ceb228bdc85f/7.01.20/en-US/496f57112c293b5be10000000...

The issue I am encountering is Error messages are being treated as allowed, unless I set the specific MSGID & MSGNO in the command interface with the Mode = F & Exit = X.

Even when I set the MSGTYP = E with the Mode = F & Exit = X, which shouldn't be necessary as that is one of the "Standard rules that require no specification in the command interface"

I'm obviously missing something blindingly obvious. Any insights gratefully received.

Cheers

Daniel

3 REPLIES 3

daniel_mccollum
Active Contributor
0 Kudos
332

From what I can make out in my example above, the MSGTYP = E from the BAPI return is converting to MSGTYP = I when found in the ENDMESSAGE command interface & therefore is not detected as an error & will happily continue.

JanSchlichting
Active Participant
0 Kudos
332

Hello,

It is some time that I used eCatt. In a positive case I used message with "R" = required to check that the whole thing was successful. You can also check the corresponding table / tables. I did both. And you can extract the message variables to use them in other scripts.

When I wanted to test something negative I used inline ABAP to asked if the error message was raised.

So two scripts: One for good and one for bad.

0 Kudos
332

Thanks for the insight Jan, thats certainly the approach I'm following until I understand why the documented features aren't reacting as documented in my eCATT

Blatantly copy'n'pasted snipped from a colleagues workaround for the MESSAGE ENDMESSAGE treatment of Error Types as "I"

*Some logic

IF ( I_VAR1 = ' ' OR I_VAR2 = ' ' ).
	LOGTEXT ( LOGVAR , 'ERR' ).
ELSE.
	FUN ( BAPI_XYZ_1 , BAPI_XYZ_CNTRL_1 ).
	GETLEN ( TT_RETURN , LINES ).
	IF ( LINES > 0 ).
		DO ( LINES ).
			LOGTEXT ( LOGVAR , TT_RETURN[LINES]-MESSAGE ).
		ENDDO.
	ELSE.
		FUN ( BAPI_TRANSACTION_COMMIT , BAPI_TRANSACTION_COMMIT_1 ).
	ENDIF.
ENDIF.