Skip to Content
avatar image
Former Member

Displaying variable in message

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jul 08, 2009 at 08:50 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 08, 2009 at 08:53 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 22, 2009 at 11:22 AM

    solved

    Add comment
    10|10000 characters needed characters exceeded