2008 Mar 31 7:20 PM
Hello!
How can I concatenate text with 'enter' in a variable of text.
For example:
IF p_pais IS INITIAL.
CONCATENATE v_msg ' - v_1000' INTO v_msg.
ENDIF.
IF p_est IS INITIAL.
CONCATENATE v_msg ' - b_1000' INTO v_msg.
ENDIF.
MESSAGE i000(su) WITH v_msg.
I try that the result in a message.
- v_1000
- b_1000
not v_1000-b1000
thanks!
Hello!
How can I concatenate text with 'enter' in a variable of text.
For example:
IF p_pais IS INITIAL.
CONCATENATE v_msg ' - v_1000' INTO v_msg.
ENDIF.
IF p_est IS INITIAL.
CONCATENATE v_msg ' - b_1000' INTO v_msg.
ENDIF.
MESSAGE i000(su) WITH v_msg.
I try that the result in a message.
- v_1000
- b_1000
not v_1000-b1000
thanks!
2008 Mar 31 7:24 PM
You could try
concatenate v_msg '-v1000' cl_abap_char_utilities=>cr_lf into v_msg.
But I'm not sure that the message will be displayed as you want it
2008 Mar 31 7:50 PM
Your code seems to work ok on 4.6c.
DATA:
v_msg(132) TYPE c.
PARAMETERS:
p_pais AS CHECKBOX,
p_est AS CHECKBOX.
START-OF-SELECTION.
v_msg = 'Here''s the message '.
IF p_pais IS INITIAL.
CONCATENATE v_msg ' - v_1000' INTO v_msg.
ENDIF.
IF p_est IS INITIAL.
CONCATENATE v_msg ' - b_1000' INTO v_msg.
ENDIF.
WRITE:/ v_msg.
And the output is
Here's the message - v_1000 - b_1000
2008 Mar 31 8:23 PM
Hai
Raphel barbros,
it is better to display messages in two different messges.because , u are checking two conditions. u are not assure that two conditions always true.
Solution:
IF p_pais IS INITIAL.
CONCATENATE v_msg ' - v_1000' INTO v_msg1.
ENDIF.
MESSAGE i000(su) WITH v_msg1.
IF p_est IS INITIAL.
CONCATENATE v_msg ' - b_1000' INTO v_msg2.
ENDIF.
new-line.
MESSAGE i000(su) WITH v_msg2.
U got the output like
- v_1000
- b_1000
if useful reward points.
thank you
G.V.K.Prasad
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |