cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying variable in message

Former Member
0 Kudos

Hi Experts,

I have a button in my layout. When i click the button, I have to display a success message along with a number which is generated. The number is present in a variable. So I should display the success message along with this number.

How to achieve this? Thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

solved

shaik_sajid
Active Contributor
0 Kudos

Hi Mohamed Aslam

In the following code u can pass upto 4 variables.

DATA: l_current_controller TYPE REF TO if_wd_controller,
        l_message_manager    TYPE REF TO if_wd_message_manager.
  l_current_controller ?= wd_this->wd_get_api( ).
  l_message_manager = l_current_controller->get_message_manager( ).

 DATA: it_symsg TYPE symsg.
    it_symsg-msgty  = 'E'.
    it_symsg-msgid  = 'ZTEST'.
    it_symsg-msgno  = '001'.
    it_symsg-msgv1  = 'weeeeeee1'.
    it_symsg-msgv2  = 'weeeeeee2'.

    l_message_manager->report_attribute_t100_message( msg = it_symsg element = lo_el_context
    attribute_name = 'CAR' CANCEL_NAVIGATION = abap_true ).

Hope u r clear.

Regards

Sajid

Edited by: shaik sajid on Jul 8, 2009 10:53 AM

Edited by: shaik sajid on Jul 8, 2009 10:54 AM

former_member40425
Contributor
0 Kudos

Hi,

You can use concatenate.

first convert your number to string using following code.

data num type i.
data num_string type string.

num_string =num.

data l_message type string.
l_message = 'Your message'.

concatenate num_string l_message into l_message.

And finally pass your l_message variable in your success message.

I hope it helps.

Regards,

Rohit