2010 May 24 8:33 PM
Hi Experts,
I have a text stored in the form of Binary,When i Read the text to display it in the report it displays "##" as a delimter at the end of each line.
Is there any way to convert the Binary data into text in 4.6.
Regards,
2010 May 24 9:17 PM
Hi,
May be also (older releases):
DATA: w_mm TYPE c,
w_xx TYPE x,
w_ss(2) TYPE c,
FIELD-SYMBOLS: <w_kk> TYPE c.
w_ss = '3F'.
w_xx = w_ss.
ASSIGN ('w_xx') TO <w_kk> CASTING TYPE c.
w_mm = <w_kk>.
* agora w_mm tem o caracter binario.
ASSIGN w_mm TO <w_kk> CASTING TYPE x.
WRITE <w_kk> TO w_ss.
Best regards,
Leandro Mengue
2010 May 24 9:08 PM
Hi,
Try:
CALL FUNCTION 'SCMS_TEXT_TO_BIN'
EXPORTING TEXT_LINE = w_mm
IMPORTING BIN_LINE = w_kk.
and
CALL FUNCTION 'SCMS_BIN_TO_TEXT'
EXPORTING BIN_LINE = w_xx
IMPORTING TEXT_LINE = w_mm.
Best regards,
Leandro Mengue
2010 May 24 9:17 PM
Hi,
May be also (older releases):
DATA: w_mm TYPE c,
w_xx TYPE x,
w_ss(2) TYPE c,
FIELD-SYMBOLS: <w_kk> TYPE c.
w_ss = '3F'.
w_xx = w_ss.
ASSIGN ('w_xx') TO <w_kk> CASTING TYPE c.
w_mm = <w_kk>.
* agora w_mm tem o caracter binario.
ASSIGN w_mm TO <w_kk> CASTING TYPE x.
WRITE <w_kk> TO w_ss.
Best regards,
Leandro Mengue
2010 May 24 9:32 PM
Hi
You can use follow forms in the ABAP side
&----
*& FORM HEX_TO_CHAR *
&----
FORM Hex_to_Char CHANGING p_value TYPE string.
DATA:
x_length TYPE i,
x_hexval TYPE REF TO DATA.
x_length = strlen( p_value ) / 2.
CREATE DATA x_hexval TYPE x LENGTH x_length.
ASSIGN x_hexval->* TO <Xvalue> CASTING.
<Xvalue> = p_value.
ASSIGN <Xvalue>(x_length) TO <Cvalue> CASTING.
p_value = <Cvalue>.
ENDFORM.
&----
*& FORM CHAR_TO_HEX *
&----
FORM Char_to_Hex CHANGING p_value TYPE string.
DATA:
x_length TYPE i,
x_chrval TYPE REF TO DATA.
x_length = strlen( p_value ).
CREATE DATA x_chrval TYPE c LENGTH x_length.
ASSIGN x_chrval->* TO <Cvalue> CASTING.
<Cvalue> = p_value.
ASSIGN <Cvalue>(x_length) TO <Xvalue> CASTING.
p_value = <Xvalue>.
ENDFORM.