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

Converting rawstring to Xstring

Former Member
0 Likes
17,517

Hi All,

I have a requirement, where i have to display an image on my form. That image is coming from a UI in a rawstring format. I have to pick it up and convert it to xtrsing and send that xstring to my form, where i will display it as an image.

Now i tried searching a lot for a function module which does so but couldn't find any. If any body has any idea or have come across similar situation then please reply.

Any help would be appreciated.

Regards,

Nitin.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
8,230

hello

did you try FM "SX_OBJECT_CONVERT" ? This has a option of source and destination formats.

best regards,

swanand

3 REPLIES 3
Read only

Former Member
0 Likes
8,231

hello

did you try FM "SX_OBJECT_CONVERT" ? This has a option of source and destination formats.

best regards,

swanand

Read only

Ryan-Crosby
Active Contributor
8,230

Hi Nitin,

You could try the static method cl_bcs_conver=>raw_to_xstring.  The only thing to note there is the rawstring would have to be chopped up into table entries with a max length of 255 per line because it takes a table type of soli_tab is an importing parameter.

Regards,

Ryan Crosby

Read only

alejandro_bindi
Active Contributor
8,230

RAWSTRING and XSTRING are equivalent types. No conversion necessary, just direct assignment:

Data type RAWSTRING correspopnds to an uninterpreted byte string of variable length. The corresponding ABAP type is XSTRING and is implemented as a reference to a storage area of variable size.

http://help.sap.com/saphelp_46c/helpdata/en/d7/11322bc925d311b60f0060b03c2bff/content.htm

Regards