2011 Apr 14 3:45 PM
All,
I need to concatenate 2 string that needs to be separated by hex value 1D
For example
string1 = 'Test'
String2 = 'Test2'
data: x_1D type x value '1D'.
concatenate string1 x_1d string2 into lv_text.
But this giving error
I need to concatenate string1 string2 with Hex value of 1D ( Group Separator)
How we can do this using CL_ABAP_CHAR_UTILITIES to group separator
a®
2011 Apr 14 4:16 PM
You can try something like this:
DATA: string1 TYPE string,
string2 TYPE string,
lv_text TYPE string.
string1 = 'Test'.
string2 = 'Test2'.
DATA: x_1d TYPE x VALUE '1D'.
DATA: lo_conv TYPE REF TO cl_abap_conv_in_ce.
lo_conv = cl_abap_conv_in_ce=>create( ).
DATA: string_1d TYPE string.
CALL METHOD lo_conv->convert
EXPORTING
input = x_1d
IMPORTING
data = string_1d.
CONCATENATE string1 string_1d string2 INTO lv_text.
WRITE: lv_text.
Regards,
Naimesh Patel
All,
I need to concatenate 2 string that needs to be separated by hex value 1D
For example
string1 = 'Test'
String2 = 'Test2'
data: x_1D type x value '1D'.
concatenate string1 x_1d string2 into lv_text.
But this giving error
I need to concatenate string1 string2 with Hex value of 1D ( Group Separator)
How we can do this using CL_ABAP_CHAR_UTILITIES to group separator
a®
2011 Apr 14 4:03 PM
What error do you get?
I get no error when I execute your code.
Rob
2011 Apr 14 4:07 PM
This my code
report ZaRs.
data: lv_text(100) type c.
data: string1(10) type c value 'Test'.
data: string2(10) type c value 'Test2'.
data: x_1D type x value '1D'.
concatenate string1 x_1d string2 into lv_text.
Error will be while activating the program
X_1d must be character-like data object ( data C, N, D, T or STRING )
a®
2011 Apr 14 4:25 PM
I still have no problem running your code. Are you in a Unicode environment?
Rob
2011 Apr 14 4:30 PM
2011 Apr 14 8:33 PM
Hello all,
I know it's answered, but usually the solution is :
DATA c1.
c1 = CL_ABAP_CONV_IN_CE=>UCCP( '001D' ).
(as given in consulting note 540583 "How do I include country-specific characters in a program?)
BR
Sandra
2011 Apr 14 4:16 PM
You can try something like this:
DATA: string1 TYPE string,
string2 TYPE string,
lv_text TYPE string.
string1 = 'Test'.
string2 = 'Test2'.
DATA: x_1d TYPE x VALUE '1D'.
DATA: lo_conv TYPE REF TO cl_abap_conv_in_ce.
lo_conv = cl_abap_conv_in_ce=>create( ).
DATA: string_1d TYPE string.
CALL METHOD lo_conv->convert
EXPORTING
input = x_1d
IMPORTING
data = string_1d.
CONCATENATE string1 string_1d string2 INTO lv_text.
WRITE: lv_text.
Regards,
Naimesh Patel
2011 Apr 14 4:24 PM
Naimesh,
This is the answer i am expected..
Thankyou very much.
Solved.
a®
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |