2006 Dec 27 4:58 AM
Hi ABAP Gurus...
i wanted to convert hexadecimal value in to string.
Is there any finction module to convert hexadecimal value to string.
Thanks in advance.
Chintan
Hi ABAP Gurus...
i wanted to convert hexadecimal value in to string.
Is there any finction module to convert hexadecimal value to string.
Thanks in advance.
Chintan
2006 Dec 27 4:59 AM
Try this code.
data: char(3) type c,
hex(4) type x.
field-symbols <fs> type any.
hex = '414243'.
assign hex to <fs> casting type c.
char = <fs>.
write:/ char.
2006 Dec 27 5:02 AM
Hi Chintan
If you are looking for characters like Tab or Linefeed. We can use CL_ABAP_CHAR_UTILITIES.
data: tab(1) type c value cl_abap_char_utilities=>horizontal_tab.
Alternatively,
data: tab(1) type X value '09',
str type string.
move tab to str.
write:/ str.Kind Regards
Eswar
2006 Dec 27 5:02 AM
2006 Dec 27 5:03 AM
make use of Field-symbols.
field-symbols : <n> type x.
field-symbols : <pn> type c.
field-symbols : <dn1> type x.
data : rn type i.
data : rn1(4) type c.
data : n type c.
describe field P_I_UPLOAD type _c.
if _c eq 'u'.
_l = strlen( P_I_UPLOAD ).
_i = _l div 2.
do _l times.
a = sy-index - 1.
a1 = P_I_UPLOAD+a(1).
assign a1 to <n> casting.
move <n> to rn.
if rn = 32.
continue.
endif.
*For Prod rn1 should be 3(1) and for QAS rn1 Shld be 0(1)
*rn = rn - key.
*rn = rn - 12 .
rn = rn - ( P_DATE+4(2) + P_DATE+6(2) ).
assign rn to <pn> casting.
move <pn> to rn1.
*if rn1+0(1) EQ '#'.
n = rn1+3(1).
*a1 = n.
*ELSE.
*N = RN1+0(1).
A1 = n.
*ENDIF."PRABHU ON 4.1.2005
*REPLACE ALL OCCURRENCES OF '#' IN rn1 WITH ' '.
P_I_UPLOAD+a(1) = A1.
enddo.
endif.regards
prabhu
2006 Dec 27 5:07 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |