2019 Nov 18 12:20 AM
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.
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
2019 Nov 18 1:42 AM
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.
2019 Nov 18 8:58 AM
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.
2019 Nov 18 7:23 PM
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.