2007 Feb 20 2:29 PM
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?
2007 Feb 20 2:35 PM
----
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.
2007 Feb 20 3:39 PM
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.
2007 Feb 20 3:45 PM
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.
2007 Feb 21 7:35 AM
If I have done BDC for a T.Code by using Recording, Is it capture Warning messages too?
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |