on 03-02-2010 7:06 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.