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: 

dynamic error message

Former Member
0 Kudos

friends,

i have a plain text message text-03 with message the doc number not found.

but i want it to be more dynamic like ' the doc number vbeln not found'.

where the vbeln is the what ever dynamic value in the loop.

i hard that the symbol '&' helps in this case but i dont know how to use that.

thank you.

5 REPLIES 5

Former Member
0 Kudos

try this

message e000(8i) with text-03 vbeln.

or you can create your own msg class ..

message e000(zspd) with text-03 vbeln.

dbl click on zspd and give & & there and save it.

regards

shiba dutta

former_member194669
Active Contributor

Hi,

Go to tran SE91 type your message class and create anew message from the available number like this way for example your message class is YCC and your create message number as 300

Document Number & not found

in your code

for display message as error

message e300(ycc) with vbak-vbeln.

aRs

Former Member
0 Kudos

Create your message in the message class as "the doc number & not found".

And use it in the program like.

message e001(zmsg) with v_vbeln.

zmsg/001: Message Class/Message Number

v_vbeln: Doc Nr

Former Member
0 Kudos

try this logic...

LOOP AT MESSTAB .

if MESSTAB-MSGNR = '311' or MESSTAB-MSGTYP = 'E'.

SELECT SINGLE msgnr text FROM T100

into wa_errmess

WHERE SPRSL = MESSTAB-MSGSPRA

AND ARBGB = MESSTAB-MSGID

AND MSGNR = MESSTAB-MSGNR.

IF SY-SUBRC = 0.

err_message = wa_errmess-TEXT.

IF err_message CS '&1'.

REPLACE '&1' WITH MESSTAB-MSGV1 INTO err_message.

REPLACE '&2' WITH MESSTAB-MSGV2 INTO err_message.

REPLACE '&3' WITH MESSTAB-MSGV3 INTO err_message.

REPLACE '&4' WITH MESSTAB-MSGV4 INTO err_message.

ELSE.

REPLACE '&' WITH MESSTAB-MSGV1 INTO err_message.

REPLACE '&' WITH MESSTAB-MSGV2 INTO err_message.

REPLACE '&' WITH MESSTAB-MSGV3 INTO err_message.

REPLACE '&' WITH MESSTAB-MSGV4 INTO err_message.

ENDIF.

CONDENSE err_message.

WRITE: / MESSTAB-MSGTYP, err_message .

ELSE.

WRITE: / MESSTAB.

ENDIF.

endif.

ENDLOOP.

if useful dont forget to give points...

Former Member
0 Kudos

hi,

goto se91 [creating a message class ] -> click on details [ second tab] -> give message number and message content as & & & & -> give a name for message and use in our program as

message e000(zaluri) with ' the doc number', vbeln 'not found'.

where zaluri is acustom message class created by me.

or u can use in this way also as

message ' the doc number vbeln not found' type 'w0000'.

if helpful reward some points.

with regards,

Suresh Aluri.