Application Development 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: 

Call Transaction Errors

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can create a batch input session for failed CALL TRANSACTION records. I think this is what SAP recommends.

Rob

7 REPLIES 7

Former Member
0 Kudos

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.

Former Member
0 Kudos

You can create a batch input session for failed CALL TRANSACTION records. I think this is what SAP recommends.

Rob

0 Kudos

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

0 Kudos

So is your question answered?

Rob

0 Kudos

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

0 Kudos

Hi All,

Naimesh solution looks good , i will try that and update you guys.

Thanks,

Rao

0 Kudos

Thank you all.

Solution works and awared the points.