Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

XSTRING

Former Member
0 Likes
562

How can we pass the value to the data object given type as XSTRING?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
516

You can pass the values normally - as the rest of the data types.

The data just needs to be in the right format - XSTRING.

If they are not You can use for conversion FM's f.e.:


CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
  EXPORTING
    TEXT           =
*   MIMETYPE       = ' '
*   ENCODING       =
* IMPORTING
*   BUFFER         =
* EXCEPTIONS
*   FAILED         = 1
*   OTHERS         = 2
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.



CALL FUNCTION 'HR_KR_STRING_TO_XSTRING'
  EXPORTING
*   CODEPAGE_TO            = '8500'
    UNICODE_STRING         =
*   OUT_LEN                =
* IMPORTING
*   XSTRING_STREAM         =
* EXCEPTIONS
*   INVALID_CODEPAGE       = 1
*   INVALID_STRING         = 2
*   OTHERS                 = 3
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

1 REPLY 1
Read only

Former Member
0 Likes
517

You can pass the values normally - as the rest of the data types.

The data just needs to be in the right format - XSTRING.

If they are not You can use for conversion FM's f.e.:


CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
  EXPORTING
    TEXT           =
*   MIMETYPE       = ' '
*   ENCODING       =
* IMPORTING
*   BUFFER         =
* EXCEPTIONS
*   FAILED         = 1
*   OTHERS         = 2
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.



CALL FUNCTION 'HR_KR_STRING_TO_XSTRING'
  EXPORTING
*   CODEPAGE_TO            = '8500'
    UNICODE_STRING         =
*   OUT_LEN                =
* IMPORTING
*   XSTRING_STREAM         =
* EXCEPTIONS
*   INVALID_CODEPAGE       = 1
*   INVALID_STRING         = 2
*   OTHERS                 = 3
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.