Question:
In BSP, is there any Function/Code that CONVERTS Hexadecimal ( or RAW) to a STRING format??!!
In a BSP Application: The Contents of a field which is of Datatype "RAW" ( Uninterpreted sequence of bytes ) are not displayed onto a Web-Page.
This is a Part of the code :
Layout :
<htmlb:form>
<htmlb:tableView id = "t1" table = "<%= ztest %>" >
</htmlb:tableView>
</htmlb:form>
Event OnInitialization :
SELECT * FROM zsource INTO CORRESPONDING FIELDS OF TABLE
ztest WHERE fieldname = variable.
Page Attributes:
ztest
Variable
Table Type of ztest.
But when the Result page is displayed the Column with RAW Datatype is Empty.
I would like to know the Solution for this.
Thanks in Advance.
Answer:
Hi,
you can try this one:
* Convert XString to String
data: loc_conv type ref to CL_ABAP_CONV_IN_CE,
loc_xstring type xstring,
loc_string type string.
CALL METHOD CL_ABAP_CONV_IN_CE=>CREATE
EXPORTING
INPUT = loc_xstring
ENCODING = 'UTF-8'
REPLACEMENT = '?'
IGNORE_CERR = ABAP_TRUE
RECEIVING
CONV = loc_CONV.
TRY.
CALL METHOD loc_CONV->READ
IMPORTING
DATA = loc_string.
CATCH CX_SY_CONVERSION_CODEPAGE.
*-- Should ignore errors in code conversions
CATCH CX_SY_CODEPAGE_CONVERTER_INIT.
*-- Should ignore errors in code conversions
CATCH CX_PARAMETER_INVALID_TYPE.
CATCH CX_PARAMETER_INVALID_RANGE.
ENDTRY.
Regards,
Kai