FORM call_transaction .
  CALL TRANSACTION '<XXX......>' USING it_bdcdata
                             MESSAGES INTO messtab
                             MODE 'N'
                             UPDATE 'S'.

  


LOOP AT messtab.
    CALL FUNCTION 'FORMAT_MESSAGE'
      EXPORTING
        id        = messtab-msgid
        lang      = sy-langu
        no        = messtab-msgnr
        v1        = messtab-msgv1
        v2        = messtab-msgv2
        v3        = messtab-msgv3
        v4        = messtab-msgv4
      IMPORTING
        msg       = msg_txt
      EXCEPTIONS
        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.

    IF messtab-msgtyp EQ 'E'.
      WRITE:/ icon_checked AS ICON, 10 msg_txt.
      WRITE: 5 i_tab-wb_book COLOR 6.
*    ELSEIF messtab-msgtyp EQ 'S'.
*      WRITE:/10 msg_txt COLOR 6.
*    ELSEIF messtab-msgtyp EQ 'W'.
*      WRITE:/10 msg_txt COLOR 3.
*    ELSE.
*      WRITE:/10 msg_txt COLOR 4.
    ENDIF.
    CLEAR msg_txt.
  ENDLOOP.
  REFRESH:it_bdcdata,messtab.

ENDFORM.                    " CALL_TRANSACTION



Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP MM SD Consultant
Contact : serkurumsal@yandex.com