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: 

Catch Errors in Call Transaction, no way

Former Member
0 Kudos
113

Hello Friends, I need a way to catch Errors in a Call Transaction to F871. This Standard Transaction don't show many errors when the Call Transactions call it. Erros are showed in a internal pop up, and my custom program

can't catch them, and i don't know what can i do with this ...

Could you help me please??

Thank you very Much.

Javi

1 ACCEPTED SOLUTION

Former Member
0 Kudos
71

Hi,

Welcome To SDN !!

Refer the below theard

https://forums.sdn.sap.com/click.jspa?searchID=10545494&messageID=3637866

Regards

Kiran

6 REPLIES 6

Former Member
0 Kudos
71

In that case better try finding a BAPI for the same instead of BDC.

I hope BAPI catches those errors.

Thanks,

Arun

Former Member
0 Kudos
71

Hi.

I think we can acheive this withthe help of Function module.

Format_message.

example code:

DATA : BEGIN OF I_GLAC_BDC OCCURS 0.

INCLUDE STRUCTURE BDCDATA.

DATA : END OF I_GLAC_BDC.

DATA : BEGIN OF I_GLAC_MSG OCCURS 0.

INCLUDE STRUCTURE BDCMSGCOLL.

DATA : END OF I_GLAC_MSG.

CALL TRANSACTION 'FB01'

USING I_GLAC_BDC

MODE 'N'

UPDATE 'A'

MESSAGES INTO I_GLAC_MSG.

PERFORM FORMAT_MESSAGES.

FORM FORMAT_MESSAGES .

SORT I_GLAC_MSG BY MSGV1 DESCENDING.

READ TABLE I_GLAC_MSG WITH KEY MSGTYP = 'E'.

IF SY-SUBRC EQ 0.

  • FORMATING MESSAGES

CALL FUNCTION 'FORMAT_MESSAGE'

exporting

ID = I_GLAC_MSG-MSGID

LANG = '-D'

NO = I_GLAC_MSG-MSGNR

V1 = I_GLAC_MSG-MSGV1

V2 = I_GLAC_MSG-MSGV2

V3 = I_GLAC_MSG-MSGV3

V4 = I_GLAC_MSG-MSGV4

IMPORTING

MSG = V_MSG

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

I_ERROR-ID = I_GLAC_MSG-MSGID.

I_ERROR-FLAG = 'E'.

I_ERROR-TEXT = V_MSG.

APPEND I_ERROR.

CLEAR I_ERROR.

*WRITE : / V_MSG.

ENDIF.

READ TABLE I_GLAC_MSG WITH KEY MSGTYP = 'S'.

IF SY-SUBRC EQ 0.

  • FORMATING MESSAGES

CALL FUNCTION 'FORMAT_MESSAGE'

exporting

ID = I_GLAC_MSG-MSGID

LANG = '-D'

NO = I_GLAC_MSG-MSGNR

V1 = I_GLAC_MSG-MSGV1

V2 = I_GLAC_MSG-MSGV2

V3 = I_GLAC_MSG-MSGV3

V4 = I_GLAC_MSG-MSGV4

IMPORTING

MSG = V_MSG

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

I_SUCCESS-ID = I_GLAC_MSG-MSGID.

I_SUCCESS-FLAG = 'S'.

I_SUCCESS-TEXT = V_MSG.

APPEND I_SUCCESS.

CLEAR I_SUCCESS.

*WRITE : / V_MSG.

ENDIF.

REFRESH I_GLAC_MSG.

CLEAR I_GLAC_MSG.

ENDFORM. " FORMAT_MESSAGES

&----


Former Member
0 Kudos
72

Hi,

Welcome To SDN !!

Refer the below theard

https://forums.sdn.sap.com/click.jspa?searchID=10545494&messageID=3637866

Regards

Kiran

0 Kudos
71

Thank you very much my friends...

These answers are right and useful but not solve my problem .... really the transaction F871 that i call give the errors in a internal popup and when i use debbuging when i look at the table type BDCMSGCOLL is empty of Error messages but the transaction returns error messages internally ...

my question is focused to catch errors in this case ...

Thank You Very Much

Regards.

Javi

0 Kudos
71

I'm thinking about my problem and perhaps i'm about a clue...

Someone knows if messages of F871 or other standard transaction could be set in status bar when they are showed in the standard program? Do you know how can i do it?

Thank you very much...

Former Member
0 Kudos
71

Hello Javier,

How do you solve this problem?? We have the same problem and we are very lost...

Thanks!

Lluís y Montse