cancel
Showing results for 
Search instead for 
Did you mean: 

problem in displaying message in screen

Former Member
0 Kudos

Hi All,

I am trying to put a comma between each variable that is getting displayed in screen.

I am displaying a sucess message in my screen as follows.

DATA: lv_message type symsgv.

concatenate var_one ',' var_two ',' var_three ',' var_four ',' var_five ',' var_six ','

var_seven ',' var_eight ','

var_nine ',' var_ten into lv_message.

CALL METHOD lo_message_manager->report_t100_message

EXPORTING

msgid = 'zmessage'

msgno = '1' " This is a message. We are displaying it on screen.

msgty = 'S'

view = 'view1'

p1 = lv_message.

Now what happens is, some of the variables may be blank in database table. for example assume var_three, var_four and var_six are blank.

So the final message in screen is getting displayed as follows:

This is a message. We are displaying it on screen. 1,2,5,7,8,9,10,,,,

How to avoid the commas which are coming at the end.

Please provide your suggestion.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Instead of the pattern given you can also get something like this 1,,2,3,,5,,,

So you have to take care of extra commas in between as well,

You can write extra logic if-else statements to first check if the variable is initial or not, if not then only concatenate.

Regards

Manas Dua