Skip to Content
avatar image
Former Member

Convert Xstring to String

Hi Experts,

I have an Z table consist of some xstring fields. I need to convert the xstring to sting. Is there any function module for that ?.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Aug 25, 2011 at 07:52 AM

    Please search SDN before posting.

    You can use FM ECATT_CONV_XSTRING_TO_STRING. Or you can try the below:

    First convert XSTRING to BINARY using SCMS_XSTRING_TO_BINARY

    And then convert BINARY to STRING using SCMS_BINARY_TO_STRING.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 25, 2011 at 07:55 AM

    Try the FM:

    DP_SPP_XML_XSTRING2STRING

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 25, 2011 at 10:16 AM

    Hi Rahul,

    Use FM HR_KR_XSTRING_TO_STRING .

    For more info click [here|Function 'HR_KR_XSTRING_TO_STRING'; .

    BR

    Dep

    Edited by: DeepakNandikanti on Aug 25, 2011 12:21 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 25, 2011 at 11:21 AM

    FM : HR_KR_XSTRING_TO_STRING

    another solution is :

    DATA: lr_conv TYPE REF TO cl_abap_conv_in_ce,

    lr_xstring TYPE xstring,

    lr_string TYPE string.

    lr_xstring = data.

    CALL METHOD cl_abap_conv_in_ce=>create

    EXPORTING

    input = lr_xstring

    encoding = 'UTF-8'

    replacement = '?'

    ignore_cerr = abap_true

    RECEIVING

    conv = lr_conv.

    CALL METHOD lr_conv->read

    IMPORTING

    data = lr_string.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi ,

      You can try below code also :

      DATA: pdf_form_data TYPE xstring.

      l_pdfobj->get_data( IMPORTING formdata = pdf_form_data ).

      • Call method to convert xstring to string.

      DATA: converter TYPE REF TO cl_abap_conv_in_ce,

      formxml TYPE string.

      converter = cl_abap_conv_in_ce=>create( input = pdf_form_data ).

      converter->read( IMPORTING data = formxml ).