‎2006 Feb 16 8:44 AM
Hi all,
I want to get the message type after calling the transaction method. I've simulated an input for error, and I expect that the returned message type should be 'E' or 'W'. But it (SY-MSGTY and msgtab-MSGTYP) still returns 'S' even there is error. What's wrong ?
Call transaction 'VL02N' USING BTAB MODE 'N' UPDATE 'S'.
messages into msgtab.
‎2006 Feb 16 8:46 AM
‎2006 Feb 16 8:49 AM
Hi Macy,
S stands for 'Status' and not 'Success' message. These messages indicate errors on occasion. You will need to check the message id and number on receipt of such message to know whats going on.
Regards,
Anand.
‎2006 Feb 16 8:50 AM
CALL TRANSACTION tcode USING bdcdata
MODE ctumode
UPDATE cupdate
MESSAGES INTO messtab. LOOP AT messtab.
msgtype = messtab-msgtyp.Check what the actual tranaction is giving as message for eg. mm01 does give u a sucess message saying data for the matnr is already maintained.
‎2006 Feb 16 8:50 AM
Processing without display of screens. If a breakpoint is reached in one of the called transactions, processing is terminated with sy-subrc same as 1001. The field sy-msgty contains "S", sy-msgid contains "00", sy-msgno contains "344", sy-msgv1 contains "SAPMSSY3", and sy-msgv2 contains "0131".
‎2006 Feb 16 8:53 AM
Hi Macy,
Since the msgtab contains multiple entries, you need to loop the internal table to check for E or W messages.
Loop at msgtab and then check for msgty = 'E' or 'W'.
Hope this helps.
Thanks
Lakshman
‎2006 Feb 16 8:57 AM
if a error message is of type success then it will return only 'S'. for ex: in mm01 if the matnr already exists it will show a 'S' type message not 'E' or 'W' in that case u have to manually write the code to verify the values that you pass in.
‎2006 Feb 16 9:00 AM
Hi Macy,
try with mode E and see any errors are there..
Call transaction 'VL02N' USING BTAB MODE <b>'E'</b> UPDATE 'S'.
messages into msgtab.
LOOP at msgtab where msgtyp = 'E'.
"capture error message here
ENDLOOP.Regards
vijay