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

data conversion questions

Former Member
0 Likes
905

Hi Everyone,

I'm confused by the data conversion rule and how to do it in abap, could you help me about some of my questions?

1. How many ways to do data conversion ( like assignment .....)?

2. When using field symbol, we know we can assign reference to field symbol , and at mean time , we can casting type.

Is this kind of casting also a way to do data conversion?

3. In my real case, I have unknown type data to convert to xstring. the type could be any ( I, D, T, STRING......). Is there an easy way to implement that when I get the data reference, I only need to import it to a method and then the method return an xstring to me?

4. question 3 is about data->xstring, and how can I convert xstring back to the original data( should be the same type )?

Thanks and Regards,

Aaron

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
759

Hi Aaron,

concerning question 3./4. you could have a look at Function Group SCMS_CONV, where you find Function Modules like

SCMS_STRING_TO_XSTRING

SCMS_XSTRING_TO_BINARY

Perhaps that helps,

BR,

Sebastian

3 REPLIES 3
Read only

Former Member
0 Likes
760

Hi Aaron,

concerning question 3./4. you could have a look at Function Group SCMS_CONV, where you find Function Modules like

SCMS_STRING_TO_XSTRING

SCMS_XSTRING_TO_BINARY

Perhaps that helps,

BR,

Sebastian

Read only

Former Member
0 Likes
759

Hi,

check this link.

[https://www.sdn.sap.com/irj/scn/advancedsearch?query=xstring]

link:[https://www.sdn.sap.com/irj/scn/advancedsearch?query=data+conversion]

hope u'll get some idea.

Regards,

Sneha.

Read only

former_member998879
Participant
0 Likes
759

Hi Aaron,

try this FM: CONVERSION_EXIT_ALPHA_INPUT

is useful for convert different data type, here an example:

call function 'CONVERSION_EXIT_ALPHA_INPUT'

exporting

input = A ( type unknown )

importing

output = B ( type xstring ).

Perhaps that helps,

Regards,

Davide