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

Former Member
0 Kudos

I am using call transaction in back ground how do i check errors

1 ACCEPTED SOLUTION

amit_khare
Active Contributor
0 Kudos

If you are using in Background then just create a report with the return table of CALL Transaction. That will be saved as log and can be viewed from SM37.

Regards,

Amit

Reward all helpful replies.

3 REPLIES 3

amit_khare
Active Contributor
0 Kudos

If you are using in Background then just create a report with the return table of CALL Transaction. That will be saved as log and can be viewed from SM37.

Regards,

Amit

Reward all helpful replies.

Former Member
0 Kudos

hi soumya,

In call transaction ,we can use an internal table with structure BDCMSGCALL for viewing the error records.It s/b given explicitly.

Reward me if it is usful.

Thanks,

Srikanth.A

Former Member
0 Kudos

Hi,

You can chek the errors by creating the session method. Try this code.

CALL TRANSACTION 'XK01' USING IT_BDCDATA
                   MODE P_MODE
                   UPDATE P_UPDATE
                   MESSAGES INTO IT_MESS.
  IF SY-SUBRC = 0.
    READ TABLE IT_MESS WITH KEY MSGTYP = 'S'.
    IF SY-SUBRC = 0.
      IT_SUCESS-LIFNR = IT_MESS-MSGV1.
      IT_SUCESS-NAME1 = IT_VENDOR-NAME1.
      APPEND IT_SUCESS.
      ADD 1 TO V_SUCESS.
    ENDIF.
  ELSE.
    READ TABLE IT_MESS WITH KEY MSGTYP = 'E'.
    IF SY-SUBRC = 0.
      CALL FUNCTION 'FORMAT_MESSAGE'
        EXPORTING
          ID        = SY-MSGID
          NO        = SY-MSGNO
          V1        = SY-MSGV1
          V2        = SY-MSGV2
          V3        = SY-MSGV3
          V4        = SY-MSGV4
        IMPORTING
          MSG       = IT_ERROR-MESSAGE
        EXCEPTIONS
          NOT_FOUND = 1
          OTHERS    = 2.
      IT_ERROR-LINENO = V_INDEX.
      APPEND IT_ERROR.
      ADD 1 TO V_ERROR.
    ENDIF.
    IF V_ERR_1 EQ SPACE.
      CALL FUNCTION 'BDC_OPEN_GROUP'
        EXPORTING
          CLIENT   = SY-MANDT
          GROUP    = P_EGROUP
          USER     = P_EUSER
          KEEP     = P_EKEEP
          HOLDDATE = P_EHDATE.

      V_ERR_1 = 'X'.
    ENDIF.

Regards

Srinu