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: 

BDC - How we can identify errors in Transaction method?.

Former Member
0 Kudos
108

Hi ,

How we can identify errors in Transaction method?.

Regards

Nikhil V Kumar

1 ACCEPTED SOLUTION

abdul_hakim
Active Contributor
0 Kudos
66

hi

check the return code after the CALL TRANSACTION statemnt.

for eg.

CALL TRANSACTION 'ME21' USING itab MODE 'A' UPDATE 'S'.

IF sy-subrc NE 0.

<Error Handling>.

ENDIF.

4 REPLIES 4

abdul_hakim
Active Contributor
0 Kudos
67

hi

check the return code after the CALL TRANSACTION statemnt.

for eg.

CALL TRANSACTION 'ME21' USING itab MODE 'A' UPDATE 'S'.

IF sy-subrc NE 0.

<Error Handling>.

ENDIF.

former_member181962
Active Contributor
0 Kudos
66

Use the following syntax:

call transaction <TCODE> using it_bdcdata options from x_ctuparams messages into i_RETURN.

loop at i_return.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

ID = i_return-id

LANG = sy-langu

NO = i_return-number

V1 = i_return-MESSAGE_V1

V2 = i_return-MESSAGE_V2

V3 = i_return-MESSAGE_V3

V4 = i_return-MESSAGE_V4

IMPORTING

MSG = l_message

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

check sy-subrc = 0.

write: / l_message.

endloop.rEGARDS,

rAVI

former_member188685
Active Contributor
0 Kudos
66

Hi,

check this thread..

Regards

vijay

Former Member
0 Kudos
66

HI

CALL TRANSACTION 'FK01' USING IT_BDCDATA MODE 'A'

UPDATE 'S'

MESSAGES INTO IT_MESSAGES.

IF SY-SUBRC <> 0.

PERFORM FORMAT_MESSAGES.

form FORMAT_MESSAGES .

DATA: L_MSG(100).

LOOP AT IT_MESSAGES.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

ID = IT_MESSAGES-MSGID

LANG = SY-LANGU

NO = IT_MESSAGES-MSGNR

V1 = IT_MESSAGES-MSGV1

V2 = IT_MESSAGES-MSGV2

V3 = IT_MESSAGES-MSGV3

V4 = IT_MESSAGES-MSGV4

IMPORTING

MSG = L_MSG

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

write:/ l_msg.

endloop.

endform. " FORMAT_MESSAGES

HOPE THIS HELPS,

PRIYA.