‎2007 Jul 07 9:33 AM
‎2007 Jul 07 9:40 AM
Hi,
Populate error messages using a table with structure BDCMSGCOLL.
DATA : <BDCMSGCOLL Int.Table> type table of bdcmsgcoll.
.....
.....
CALL TRANSACTION <T.Code>
USING <BDCTAB>
MODE <A/N/E>
UPDATE <S/A>
MESSAGES INTO <BDCMSGCOLL Int.Table>The structure has:
- Message type
- Message id
- Message Number
- Variable1
- Variable2
- Variable3
By using FORMAT_MESSAGES function module we can process the error records.
Refer to the following links for more informaion and code:
Regards,
Srilatha.
‎2007 Jul 07 9:42 AM
Hi Priya,
With CALL TRANSACTION there is an addition in its syntax, MESSAGES INTO itab,
The internal table itab must have the structure BDCMSGCOLL.
check the sample code below
DATA: BDCDATA TYPE TABLE OF BDCDATA.
DATA: ITAB TYPE TABLE OF BDCMSGCOLL.
DATA: PROGRAM LIKE SY-REPID,
WA_BDCDATA TYPE BDCDATA.
WA_BDCDATA-PROGRAM = 'SAPMS38M'.
WA_BDCDATA-DYNPRO = '0100'.
WA_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_BDCDATA TO BDCDATA.
CLEAR WA_BDCDATA.
WA_BDCDATA-FNAM = 'RS38M-PROGRAMM'.
WA_BDCDATA-FVAL = PROGRAM.
APPEND WA_BDCDATA TO BDCDATA.
...
CALL TRANSACTION 'SE38' USING BDCDATA MODE 'N'
MESSAGES INTO ITAB.
regards,
Antony Thomas
REward points only if find useful
‎2007 Jul 07 9:51 AM
Hi
u can use funtion module WRITE_MESSAGES and FORMAT_MESSAGES to read the messeges in stead of BDCMSGCOLL.
WE CAN USE SESSION METHOD LOGFILE IN CALL TRANSACTION.
1. WE HAVE TO SEND ERROR RECORDS IN TO ONE INTERNAL TABLE .
2. NEXT FOR THAT ITAB U CAN USE SESSION METHOD .
3 WITH THIS U WILL GET SESSION METHOD LOG FILE IN CALL TRAN.
in call transaction we can explicitly provide the logic for handling error records, for that one we create internal table of type BDCMSGCOLL.
syntax:
DATA: IT_ERROR LIKE BDCMSGCOLL WITH HEADER LINE.
CALL TRANSACTION <transaction-name> using BDCDATA
mode <A/N/E>
update <A/S/L>
MESSAGES INTO IT_ERROR.
We can create a internal table like 'bsgmcgcoll'. All themessages will go to ternal table. We can get errors inthis internal table.
Below messages are go to internal table. when you run the
call transaction.
- Message type
- Message id
- Message Number
- Variable1
- Variable2
- Variable3
by using FORMAT_MESSAGES function module we can process the error records.
or
by using session method also we can handle error records in
CALL TRANSACTION method.
CALL TRANSACTION <transaction-name> using BDCDATA
mode <A/N/E>
update <A/S/L>.
IF SY-SUBRC <> 0.
here call BDC_OPEN_GROUP for creating session.
here call BDC_INSERT for adding trassaction and table BDCDATA to handling error records.
here call BDC_CLOSE_GROUP for closing the session.
now all the error records available in logfile, for handling error records follow these steps.
1) goto SM35.
2) here select your SESSION name.
3) and choose LOG tab
4) press the selected LOG tab, then it will display error records
check these threads
Plz go through the below mention link .there is an example for call transaction method error handling.
http://www.sap-img.com/abap/question-about-bdc-program.htm
http://www.sap-img.com/abap/answers-to-some-abap-interview-questions.htm
Reward all helpfull answers
Regards
Pavan