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: 

I want to capture system message during data upload.

Former Member
0 Kudos

Hello,

I want to capture system message during data upload.

How should I do this?

suppose during call transaction system shows message:-

" Info record for vendor 102925 and material DYND80000 does not exist"

then How can I get that message?

2 REPLIES 2

Former Member
0 Kudos

Hi Megha,

CALL TRANSACTION tcode USING i_bdcdata

MODE lws_mode

UPDATE lws_update

MESSAGES INTO <b>i_messages.</b>

CLEAR wa_error.

IF sy-subrc NE 0.

cnt_failed = cnt_failed + 1.

wa_error-status = c_fail.

LOOP AT i_messages . "WHERE msgtyp EQ 'E' OR msgtyp = 'A'.

flg_fail = c_x.

*---Calling FM to get for Error Message Text

<b>CALL FUNCTION 'MESSAGE_PREPARE' </b> "#EC *

EXPORTING

language = 'E'

msg_id = i_messages-msgid

msg_no = i_messages-msgnr

IMPORTING

msg_text = lws_text

EXCEPTIONS

function_not_completed = 1 " Invalid Date Error Description

message_not_found = 2

OTHERS = 3.

<b>Reward points if this helps.

Manish</b>

Former Member
0 Kudos

Hi,

If you are using CALL TRANSACTION command for data upload, you can get all messages in MESSTAB internal table. The content of this internal table contain messages for each transaction BDC processing. These messages you can format using FORMAT_MESSAGE function module. Get all formatted messages for each pass in an internal table and display the content of this internal table as log in the report output.

Hope this helps.

ashish