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: 

How to get error message from STD screen

Former Member
0 Kudos

Hi Guru's,

I am using call transaction method to upload data into SAP system i want to capture the error, which may be present in screen is there is any way to do it

please give some idea as early as possible

Ravi Kumar

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ravi,

Use this function Module FORMAT_MESSAGE to get the error message

Before using this function module you just creat one internal table refering the structure bdcmsgcoll.

Example

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

id = message-msgid

lang = 'E'

no = message-msgnr

v1 = message-msgv1

v2 = message-msgv2

v3 = message-msgv3

v4 = message-msgv4

IMPORTING

msg = l_errmsg

EXCEPTIONS

not_found = 1

OTHERS = 2.

  • lang is "E' = Error S = success and I information.

I hope it will be usefull for u

Regards,

John Victor

3 REPLIES 3

naimesh_patel
Active Contributor
0 Kudos

Check the MESSAGES into MESS_TAB addition of the CALL TRANSACTION.

Regards,

Naimesh Patel

Former Member
0 Kudos

Hi Ravi,

Use this function Module FORMAT_MESSAGE to get the error message

Before using this function module you just creat one internal table refering the structure bdcmsgcoll.

Example

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

id = message-msgid

lang = 'E'

no = message-msgnr

v1 = message-msgv1

v2 = message-msgv2

v3 = message-msgv3

v4 = message-msgv4

IMPORTING

msg = l_errmsg

EXCEPTIONS

not_found = 1

OTHERS = 2.

  • lang is "E' = Error S = success and I information.

I hope it will be usefull for u

Regards,

John Victor

Former Member
0 Kudos

All errrors occured during CALL Transaction will be placed into IT_MESSAGES. you can loop thru this internal table & find for message type E to see the error messages.

Sample Code:

CALL TRANSACTION <Tcode> using IT_BDCDATA ....

MESSAGES INTO IT_MESSAGES.

IF SY-SUBRC <> 0 .

LOOP AT IT_MESSAGES WHERE MSG_TYPE = 'E'.

*--here you will be having all ERROR messages

ENDLOOP

ENDIF.

hope this gives some idea.

Regards,

Srikanth