Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

A common question asked is : How to display the error log

Error rendering macro 'code': Invalid value specified for parameter 'lang'
DATA:  TMESS_MTAB TYPE TABLE OF BDCMSGCOLL OCCURS 10 WITH HEADER LINE .
*     ****FOR ERROR MESSAGES
TYPES : BEGIN OF TYPE_MTAB,
   MATNR   LIKE MARA-MATNR,
   MSGTYP  LIKE BDCMSGCOLL-MSGTYP,
   MSGID   LIKE BDCMSGCOLL-MSGID,
   MSGNR   LIKE BDCMSGCOLL-MSGNR,
   TEXT(100) TYPE C,
   END OF TYPE_MTAB.
DATA :   T_MTAB TYPE STANDARD TABLE OF TYPE_MTAB,
               WA_MTAB LIKE LINE OF T_MTAB.
LOOP AT TMESS_MTAB .
  L_CNT =  L_CNT + 1.
  READ TABLE T_ITEM INTO WA_ITEM INDEX L_CNT .
  CALL FUNCTION 'MASS_MESSAGE_GET' "To get the Message Text
       EXPORTING
            ARBGB             = TMESS_MTAB-MSGID
            MSGNR             = TMESS_MTAB-MSGNR
            MSGV1             = TMESS_MTAB-MSGV1
            MSGV2             = TMESS_MTAB-MSGV2
            MSGV3             = TMESS_MTAB-MSGV3
            MSGV4           !   = TMESS_MTAB-MSGV4
       IMPORTING
            MSGTEXT           = WA_MTAB-TEXT
       EXCEPTIONS
            MESSAGE_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.
  WA_MTAB-MATNR   = WA_ITEM-MATNR.
  WA_MTAB-MSGTYP  = TMESS_MTAB-MSGTYP.
  WA_MTAB-MSGID   = TMESS_MTAB-MSGID.
  WA_MTAB-MSGNR   = TMESS_MTAB-MSGNR.
  APPEND WA_MTAB TO T_MTAB.
  CLEAR WA_MTAB-TEXT.
  CLEAR WA_ITEM.
ENDLOOP.
LOOP AT T_MTAB INTO WA_MTAB.
  WRITE:/ WA_MTAB-MATNR, WA_MTAB-MSGTYP, WA_MTAB-MSGID, WA_MTAB-MSGNR .
ENDLOOP.

 

      

w to handle error log file in call transaction method after updation of data. (or ) If an error file occurs while using  call transaction method to upload the data from legacy system to SAP system,how to handle the  error file.

In a typical BDC call transaction scenario, You can get the errors which occur in the transaction by doing the following :

After your BDCDATA has been populated :

Error rendering macro 'code': Invalid value specified for parameter 'lang'
CALL TRANSACTION <TCODE> USING BDCDATA OPTIONS FROM  <CTU_PARAMS> MESSAGES INTO MESSTAB.
LOOP AT MESSTAB.
  IF MESSTAB-MSGTYP = 'E'.
*  	Append the current record into error table.
  ENDIF.
ENDLOOP.

The structure of MESSTAB internal table must be of type BDCMSGCOLL.