cancel
Showing results for 
Search instead for 
Did you mean: 

errors in BDC

Former Member
0 Kudos

Hi,

what are the errors we get normally while working with BDC. how do we handle them.

regards,

vijay.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi vijay,

The errors you get depends upon the transaction you are

running.

<b> This is how you handle:</b>

Let's consider you are recording for the transction CJ40

(Messages table declaration )

DATA :BEGIN of t_msg occurs 0.

include structure BDCMSGCOLL.

DATA END of t_msg.

<b>Handling it :</b>

<b>CALL TRANSACTION 'CJ40' using T_BDCDATA MODE 'N' UPDATE 'S' MESSAGES INTO t_msg</b>.

commit work.

If you want to display the errors in the screen you can use a function module named <b>'RPY_MESSAGE_COMPOSE'</b>

This gives you the corresponding message for the message number that you input.

Below is the <b>sample code</b>

Loop at t_msg. " Messages internal table

w_msgid = t_msg-msgid.

w_msgno = t_msg-msgnr.

w_msgv1 = t_msg-msgv1.

w_msgv2 = t_msg-msgv2.

w_msgv3 = t_msg-msgv3.

w_msgv4 = t_msg-msgv4.

CALL FUNCTION 'RPY_MESSAGE_COMPOSE'

EXPORTING

LANGUAGE = SY-LANGU

MESSAGE_ID = w_msgid

MESSAGE_NUMBER = w_msgno

MESSAGE_VAR1 = w_msgv1

MESSAGE_VAR2 = w_msgv2

MESSAGE_VAR3 = w_msgv3

MESSAGE_VAR4 = w_msgv4

IMPORTING

MESSAGE_TEXT = t_text-text.

  • TABLES

  • LONGTEXT =

  • EXCEPTIONS

  • MESSAGE_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.

<b>MESSAGE_TEXT</b> contains the message.

Please reward points if this explanation useful.

Regards,

Siva

Former Member
0 Kudos

BDC errors are similar to what you get in online transaction. Suppose you enter an invalid material number in online ME21N ( create Po ) system will throw an error and you have to correct it by chnaging a valid material number . Same error you can get in BDC as well. It is very difficult to generalize types of error as errors will depend on the transacation you are doing.

However some of the common BDC errors are ( Data for Screen Not Found, Field Not available in Screen ). These again are transaction specific and you have to analyze it by calling the transacion in display ALL mode.

Cheers.

Former Member
0 Kudos

Hi naren,

thank's for your reply. what you said i know already. what i want is what error messages we get and how solve those errors.

regards,

vijay.

Former Member
0 Kudos

Hi

How can you know the problem before bdc is run?

You can run bdc by transaction and, if it fails, create a session.

So see the BDC by SM35 and solve the errors.

Max

Former Member
0 Kudos

Vijay,

If you are using call transaction method, you generally catch errors in BDCMSGCOLL structure.

In session method an error log will be created.

Thanks,