cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass a variable value in message area

Former Member
0 Kudos
50

hi

i have a requirement in which i need to display a table with records and below it in a message area i need to display the total no. of records found ( eg : 2 records found )

am using message manager for the display and calculating the total no of rows by lv_index = LINES( li_table ) .

  • get message manager

DATA lo_api_controller TYPE REF TO if_wd_controller.

DATA lo_message_manager TYPE REF TO if_wd_message_manager.

lv_index = LINES( li_table ).

lo_api_controller ?= wd_this->wd_get_api( ).

CALL METHOD lo_api_controller->get_message_manager

RECEIVING

message_manager = lo_message_manager

.

  • report message

CALL METHOD lo_message_manager->report_warning

EXPORTING

message_text = '& records found' WITH lv_index

.

BUT this throws an error. ... can anyone please provide the correct coding for this.

Thanks

Anurupa.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Anurupa,

If u want just a message to come in the message area without warning or error . U can use method 'report_success'.

  • get message manager

DATA lo_api_controller TYPE REF TO if_wd_controller.

DATA lo_message_manager TYPE REF TO if_wd_message_manager.

lv_index = LINES( li_table ).

lo_api_controller ?= wd_this->wd_get_api( ).

CALL METHOD lo_api_controller->get_message_manager

RECEIVING

message_manager = lo_message_manager

.

  • report message

CALL METHOD lo_message_manager->report_success

EXPORTING

message_text = '& records found' WITH lv_index

Former Member
0 Kudos

Hi

You can write like this



data: str type string.
concatenate lv_index 'records found' into str.
CALL METHOD lo_message_manager->report_warning
EXPORTING
message_text =  str