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

call transaction error message capturing failed

Former Member
0 Likes
1,637

Hello,

I am using call transaction method for ME21N tcode for uploading data.Here in messtab i am not getting any error message of type E.i tried using 'N' and 'E' but still i am not able to capture message of type 'E' .i debug and checked in messtab table but there too there is no message of type 'E'.but i have faulty data in transaction.Suggest me.

regards

Soniya s.

9 REPLIES 9
Read only

Former Member
0 Likes
1,360

Hi,

ME21N makes use of OOPs functionality and the error messages in the transaction are shown as a pop up and not as messages in normal transactions.

So it would be difficult to obtain the same in the messages table when you do CALL TRANSACTION.

Why not use a BAPI instead?

regards,

Ankur Parab

Read only

0 Likes
1,360

hi ankur,

no in me21n error messages are not shown in box its normal as its in other transactions.

Read only

0 Likes
1,360

Hi,

Error handling is always not good in Call Transaction.Use Session Methods for Upload as Error handling is much more better than Call Transaction.

use:BAPI_PO_CREATE or BAPI_PO_CREATE1 for creation because data validation is much better here.

Regards,

Gurpreet

Read only

Former Member
0 Likes
1,360

Does Faulty data means error?

While Directly passing such data in ME21N ,giving error??

If not than Call Transaction Message will also not give..please check once.

Regards,

Mayank

Read only

0 Likes
1,360

hello,

Even if i directly enter data in me21n then also i get an error there if data is wrong.but while debuging my bdc program in messtab i dont get that error message.suggest me how to solve this issue.

regards

soniya s.

Read only

0 Likes
1,360

Hi,

Did u check if the transaction is stopping with the faulty data when the BDC is run in the mode 'A'?

Regards,

Vik

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,360

Avoid BDC with Enjoy transactons and go for BAPI as Ankur said ...

or do it with ME21.

Read only

0 Likes
1,360

Hello Soniya,

I agree with Ankur & Keshu, it is not advisable to do BDC with e N joy trxns. I will prefer use of BAPIs instead.

BR,

Suhas

Read only

Former Member
0 Likes
1,360

Hi Soniya

here is the piece of code for capturing the error messages... i hope u will get some help..

*Calling Transaction FB50 .

call transaction 'FB50' using BDCDATA mode 'N' messages into MESSTAB.

*Reading Internal Table MESSTAB.

read table MESSTAB.

if SY-SUBRC = 0.

*Selecting TEXT From Table T100 Into Variable V_TEXT.

select single TEXT into V_TEXT from T100 where SPRSL = MESSTAB-MSGSPRA

and ARBGB = MESSTAB-MSGID

and MSGNR = MESSTAB-MSGNR.

if SY-SUBRC = 0.

V_LMSTRING = V_TEXT.

if V_LMSTRING cs '&1'.

replace '&1' with MESSTAB-MSGV1 into V_LMSTRING.

replace '&2' with MESSTAB-MSGV2 into V_LMSTRING.

replace '&3' with MESSTAB-MSGV3 into V_LMSTRING.

replace '&4' with MESSTAB-MSGV4 into V_LMSTRING.

else.

replace '&' with MESSTAB-MSGV1 into V_LMSTRING.

replace '&' with MESSTAB-MSGV2 into V_LMSTRING.

replace '&' with MESSTAB-MSGV3 into V_LMSTRING.

replace '&' with MESSTAB-MSGV4 into V_LMSTRING.

endif.

condense V_LMSTRING.

*Checking The Message Type and Display The Message Accordingly.

if MESSTAB-MSGTYP = 'E'.

V_ERROR = V_ERROR + C_INCREMENT.

IT_RESULT-MEGTYPE = 'Error'.

IT_RESULT-MESSAGE = V_LMSTRING.

endif.

if MESSTAB-MSGTYP = 'S'.

V_SUCCESS = V_SUCCESS + C_INCREMENT.

IT_RESULT-MEGTYPE = 'Successful'.

IT_RESULT-MESSAGE = V_LMSTRING.

endif.

else.

  • write: / MESSTAB.

endif.

endif.

*Appending Table IT_RESULT.

append IT_RESULT.

*Delete Rows of Internal Table MESSTAB.

refresh MESSTAB.

*Clear Header of MESSTAB.

clear MESSTAB.

endloop.

Regards

Ashu Singh