‎2007 Nov 24 2:56 PM
explain me about bdcmsgcoll structure and messtab in call transaction method
‎2007 Nov 24 5:04 PM
bdc data is a strecture to make validations before passing data from internal table to
application server in sap.
In call transaction method there is no defalut log file for data transfer.
so we do use bdcmsgcoll for messages in this method.
check this link for some useful information.
http://www.abapprogramming.blogspot.com
u can also try this specific links.
http://abapprogramming.blogspot.com/search/label/BDC%201
http://abapprogramming.blogspot.com/search/label/BDC%202
http://abapprogramming.blogspot.com/search/label/BDC%203
http://abapprogramming.blogspot.com/search/label/BDC%204
http://abapprogramming.blogspot.com/search/label/BDC%205
http://abapprogramming.blogspot.com/search/label/BDC%206
http://abapprogramming.blogspot.com/search/label/BDC%207
http://abapprogramming.blogspot.com/search/label/BDC%208
http://abapprogramming.blogspot.com/search/label/BDC%209
http://abapprogramming.blogspot.com/search/label/BDC%2010
thank you.
‎2007 Nov 24 6:02 PM
You can get all the messages back form the CALL TRANSACTION in to the table whit the structure BDCMSGCOLL.
data begin of ctumsg occurs 10. "messages call trans.using "yht09
include structure bdcmsgcoll. "yht09
data end of ctumsg. "yht09
if not ctumsg[] is initial.
* Handle your error messages
endif.Regards,
Naimesh Patel
‎2007 Nov 25 5:52 AM
HI
Structure of BDCMSGCOLL
MSGID Message ID
MSGTYP MessageType
MSGNR Message Number
MSGV1 1st placeholder
MSGV2 2nd Place Holder
NSGV3 3rd Placce Holder
MSGV4 4th Place Holder
To see all the messages stored by the system in the BDCMSGCOLS table we can use LOOP AT .ENDLOOP command.
‎2007 Nov 27 5:16 AM
Hi Shankar,
Call transaction method doesn't handle error, So we should handle the error explicitly using BDCMSGCOLL structure .
Structure Contains following fields,
TCODE -> BDC Transaction code
DYNAME -> Batch input module name
DYNUMB -> Batch input screen number
MSGTYP ->Batch input message type
MSGSPRA -> Language ID of a message
MSGID -> Batch input message ID
MSGNR -> Batch input message number
MSGV1 -> Variable part of a message
MSGV2 -> Variable part of a message
MSGV3 -> Variable part of a message
MSGV4 -> Variable part of a message
FLDNAME -> Field name
Ex :
DATA : BDCMSGCOLL TYPE TABLE OF BDCMSGCOLL WITH HEADER LINE,
BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE.
CALL TRANSACTION 'MM01' USING BDCDATA MODE N UPDATE S MESSAGES INTO BDCMSGCOLL.
IF SY-SUBRC <> 0.
PERFORM ERR.
CLEAR I_MSG.
REFRESH I_MSG.
ENDIF.
&----
*& Form ERR
&----
text
----
--> p1 text
<-- p2 text
----
form ERR .
DATA V_MSG(255) TYPE C.
READ TABLE I_MSG WITH KEY MSGTYP = 'E'.
IF SY-SUBRC = 0.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = I_MSG-MSGID
LANG = 'E'
NO = I_MSG-MSGNR
V1 = I_MSG-MSGV1
V2 = I_MSG-MSGV2
V3 = I_MSG-MSGV3
V4 = I_MSG-MSGV4
IMPORTING
MSG = V_MSG
EXCEPTIONS
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.
WRITE V_MSG. " Error Message Displayed Here.
CLEAR V_MSG.
ENDIF.
endform. " ERR
Regards,
Vijay