‎2008 Aug 14 4:50 PM
Hi,
I want to capture all the errors occured into a session after i do a call transaction with tcode F-30.
This would be easy for the user to reprocess the session instead of looking at the error log generated by call transaction.
Appreciate if someone provides me the approach or logic.
‎2008 Aug 14 4:59 PM
You can create a batch input session for failed CALL TRANSACTION records. I think this is what SAP recommends.
Rob
‎2008 Aug 14 4:55 PM
Rao,
I am not sure about what session you are talking about... When you are processing with call transaction u never get a session rite.
There is a possibility that if you get any errors with the records you can append all those records into separate internal table and finally write to a file... and capture the error messages into another internal table and along with the error field write to a file.
So that User can process the error file what ever your program generate once they verify and corrects the data based on the error messages file.
‎2008 Aug 14 4:59 PM
You can create a batch input session for failed CALL TRANSACTION records. I think this is what SAP recommends.
Rob
‎2008 Aug 14 5:10 PM
Hi all,
Yes, call transaction doesn't not generate a session.
For my requirement i want to build a session for all the errors returned by call transaction.
This will make it easier for the users to reprocess the errors without having to worry about the error log.
Thanks,
Rao
‎2008 Aug 14 5:15 PM
‎2008 Aug 14 5:16 PM
For your requirement, you need to check if the required sucess message exists in the message table of the call transaction.
LOO AT IT_DATA.
* fill the bdc data
*
CALL TRANSACTION 'MIRO' USING T_BDCDATA
OPTIONS FROM L_OPT
MESSAGES INTO IT_MESS.
* check success message
READ TABLE IT_MESS WITH KEY MSGID = 'M8'
MSGNR = '060'
MSGTYP = 'S'.
CASE SY-SUBRC.
WHEN others.
W_ERROR = W_ERROR + 1.
IF W_ERROR = 1. "First error record.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = Session
KEEP = 'X'
USER = Username.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = PL_TCODE
TABLES
DYNPROTAB = IT_BDCDATA.
ENDLOOP.
IF ( W_ERROR > 0 ). "For Batch Input
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
ENDIF.
Regards,
Naimesh Patel
‎2008 Aug 14 5:28 PM
Hi All,
Naimesh solution looks good , i will try that and update you guys.
Thanks,
Rao
‎2008 Aug 14 5:49 PM