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: 

how to craete message class - long text?

Former Member
0 Kudos

hi friends

i creates a message in se91. for that i need long text . in long text how to pass variables ?

for ex i created a message

Please enter &1 in the Notification &2

for this how to use this &1 and &2 in long text?

thanks & regards

deepu

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

If i got you correctly you have message "please enter &1 and &2 " in a message class

then use it like this

Mytext1 type string value " -----------your text1-------------"
Mytext2 type string value " -----------your text2-------------"

<msg type> <msgno> (<mess class>) with Mytext1 Mytext2.

Hope helpful

Rhea.

3 REPLIES 3

Former Member
0 Kudos

Hi,

When you have read the text through fm,

you can replace &1 or &2 via replace statement.

Data: field(20).

field = 'A&1C'

REPLACE '&1' WITH 'string' INTO field.

now field is : AstringC

Hope helps.

deniz.

Former Member
0 Kudos

Hi,

you can read a message class's item through:

Data: tline like T100.

CALL FUNCTION 'T100_READ_SINGLE'
  EXPORTING
*   KZRFB            = ' '
    T100_SPRSL       = 'T'
    T100_ARBGB       = 'ZMAXYZ'
    T100_MSGNR       = '000'
 IMPORTING
   WT100            = tline
* 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 sy-subrc eq 0.

    write: tline-text.

  endif.

now you can use replace as following:

REPLACE '&1' WITH 'Whatever you want, write here' INTO tline-text.

deniz.

Edited by: Deniz Toprak on Oct 8, 2008 4:31 PM

Former Member
0 Kudos

Hi,

If i got you correctly you have message "please enter &1 and &2 " in a message class

then use it like this

Mytext1 type string value " -----------your text1-------------"
Mytext2 type string value " -----------your text2-------------"

<msg type> <msgno> (<mess class>) with Mytext1 Mytext2.

Hope helpful

Rhea.