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 Pass Variable to an error message Long Text (Message Class)

Former Member
0 Kudos

Hi,

I have to pass a variable to an error message long text (i.e. in the message class, procedure) how to do that.

Thanks in Advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

In the long text choose Edit -> Command -> Insert command on the menu. In the pop-up enter &V1& in the Symbols field.

&V2& is variable &2 etc...

Regards,

Nick

4 REPLIES 4

Former Member
0 Kudos

Hi,

In the long text choose Edit -> Command -> Insert command on the menu. In the pop-up enter &V1& in the Symbols field.

&V2& is variable &2 etc...

Regards,

Nick

0 Kudos

Thank you. it worked.

Former Member
0 Kudos

Hi,

try this way..


creating message class or add message to message class..
go to t-code -->se91 --> ZZZ(message class)->add 001 -- material & plant & combination does not exit.


call message in Program ...
select * marc where matnr = p_matnr and werks = p_werks.
if sy-subrc ne 0.
    MESSAGE e001(ZZZ)  WITH p_matnr p_plant.
endif.

the & represents Variable...

Prabhudas

Former Member
0 Kudos

hi saba,

& are the place holders of variables in the message classes.

so lets say you have a message class zsap. if not then create in SE91.

select a message number. give number like 000, 001, 999 etc.

in the message text

write like

company code & has & sales orders. ==>lets say you give message number 000 to this.

now these two & are the place where you will/can pass your values as variables.

when you need to call this message, use this:

message I000(ZSAP) gv_bukrs gv_lines.

now gv_bukrs and gv_lines will be replaced in the message number 000 at the & position respectively.

that means, the message now becomes :

company code <value of gv_bukrs> has <value of gv_lines> sales orders.

        ^                      ^ 
        |                      |
     first &                 second &