Application Development and Automation 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: 
Read only

BDC Warning Messages

Former Member
0 Likes
601

If we run a BDC for Standard T.Code (For Ex: VA01). In error log can we find warning messages. Or Can we capture warning messages in error log?

If we run a BDC for Standard T.Code (For Ex: VA01). In error log can we find warning messages. Or Can we capture warning messages in error log?

4 REPLIES 4
Read only

Former Member
0 Likes
569

----


  • Form READ_ERROR_MESSAGE *

----


  • -->GT_BDC_MSG text *

  • -->LT_MSGS text *

----


FORM read_error_message USING lt_bdc_msg TYPE ty_t_bdcmsg

CHANGING lt_msgs TYPE ty_t_msgs.

DATA: lv_msg(500).

DATA: ls_bdcmsg TYPE ty_s_bdcmsg.

DATA: ls_errormsg TYPE ty_s_msgs.

*data: lt_bdc_msg type standard table of bdcmsgcoll.

LOOP AT lt_bdc_msg INTO ls_bdcmsg.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

id = ls_bdcmsg-msgid

lang = 'E'

no = ls_bdcmsg-msgnr

v1 = ls_bdcmsg-msgv1

v2 = ls_bdcmsg-msgv2

v3 = ls_bdcmsg-msgv3

v4 = ls_bdcmsg-msgv4

IMPORTING

msg = lv_msg

EXCEPTIONS

not_found = 0

OTHERS = 0.

ls_errormsg-msg = lv_msg.

APPEND ls_errormsg TO lt_msgs.

CLEAR ls_errormsg-msg.

ENDLOOP.

ENDFORM. "READ_ERROR_MESSAGE

**********************************

LOOP AT gt_msgs INTO ls_msgs.

gs_error-matnr = p_ls_plant-matnr.

gs_error-werks = p_ls_plant-werks.

gs_error-msg = ls_msgs-msg.

APPEND gs_error TO gt_error.

CLEAR gs_error.

ENDLOOP.

Read only

Former Member
0 Likes
569

IF u r using Call Transaction then use the BDCMSGCOLL.

Declare one intarnal table with BDCMSGCOLL..

And then Write the folle ing code.

Call Transaction 'TCODE'

MODE 'N'

UPDATE 'A'

MESSAGES INTO it_messtab.

IF sy-subrc = 0 .

loop at it_messtab into is_messtab.

if is_messtab-msgtype = 'W'.

Write:is_messtab.

endif.

endloop.

endif.

Read only

Former Member
0 Likes
569

hi,

call transaction 'VA01' using it_bdcdata mode 'A'

messages into it_messages.

write:/ sy-subrc.

perform format_messages.

endloop.

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.

hope this helps,

do reward if it helps,

priya.

Read only

0 Likes
569

If I have done BDC for a T.Code by using Recording, Is it capture Warning messages too?