‎2009 Jul 01 3:02 AM
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
‎2009 Jul 01 7:40 AM
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
‎2009 Jul 01 7:40 AM
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
‎2009 Jul 01 7:59 AM
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.
‎2009 Jul 01 9:10 AM
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