SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Функция возвращающая текст сообщения



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
alex_nil
Участник
Участник



Joined: 26 Sep 2007
Posts: 25

PostPosted: Mon Jan 28, 2008 3:51 pm    Post subject: Функция возвращающая текст сообщения Reply with quote

Привет!
Каким ФМ можно достать текст сообщения по class и message id, чтобы напрямую не читать таблицу T100?
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 46
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Mon Jan 28, 2008 4:27 pm    Post subject: Reply with quote

Проще без ФМ, ИМХО.
Code:
DATA: MESSAGE_TEXT TYPE STRING.

MESSAGE ID 'BC' TYPE 'I' NUMBER '016' INTO MESSAGE_TEXT.
WRITE MESSAGE_TEXT.
Back to top
View user's profile Send private message Blog
alex_nil
Участник
Участник



Joined: 26 Sep 2007
Posts: 25

PostPosted: Mon Jan 28, 2008 5:00 pm    Post subject: Reply with quote

Спасибо. Подойдет Smile
Back to top
View user's profile Send private message
Lord
Профессионал
Профессионал



Joined: 10 Sep 2007
Posts: 168

PostPosted: Mon Jan 28, 2008 6:24 pm    Post subject: Reply with quote

Лично использую, как John Doe предложил.
Для справки, есть несколько ФМ.

Code:
DATA: lt_mess TYPE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA: l_text LIKE t100-text.

*...

LOOP AT lt_mess.
  IF lt_mess-msgtyp = 'E'.

    CALL FUNCTION 'MESSAGE_TEXT_BUILD'
         EXPORTING
              msgid               = lt_mess-msgid
              msgnr               = lt_mess-msgnr
              msgv1               = lt_mess-msgv1
              msgv2               = lt_mess-msgv2
              msgv3               = lt_mess-msgv3
              msgv4               = lt_mess-msgv4
         IMPORTING
              message_text_output = l_text.

    IF sy-subrc IS INITIAL.
      WRITE l_text.
    ENDIF.
  ENDIF.
ENDLOOP.



Code:
call function 'FORMAT_MESSAGE'
     exporting
          id        = lt_mess-msgid
          lang      = 'EN'
          no        = lt_mess-msgnr
          v1        = lt_mess-msgv1
          v2        = lt_mess-msgv2
          v3        = lt_mess-msgv3
          v4        = lt_mess-msgv4
     importing
          msg       = l_text
     exceptions
          not_found = 1
          others    = 2.
IF sy-subrc IS INITIAL.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
WRITE:/ l_text.
Back to top
View user's profile Send private message
Armann
Модератор
Модератор



Joined: 01 Jan 2008
Posts: 422
Location: Moscow

PostPosted: Tue Jan 29, 2008 10:04 am    Post subject: Reply with quote

И еще до кучи - ФМ '/SAPTRX/GET_MESSAGE_TEXT'
Back to top
View user's profile Send private message Blog
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.