11-29-2021 1:45 PM
Hi All,
Note : We are working in 1809 system with SAP BASIS release of 753 0007.
We have a requirement of finding out the totals for the numbers stored in the table field of type SSTRING.
i have come to know that, in casting expression for source type SSTRING, no other target types is supported, for the same the casting matrix can be seen below:
So now, since aggregate function SUM cannot work with string type, and also casting is not supported in the system, is there any way where we can achieve summation of number value stored in SSTRING type in select query?, something like below:
*****
Select SUM( CAST( sstring_value as number_type ) )
from DB_Table
*****
Thanks in Advance,
Avinash
11-30-2021 12:47 PM
Hi Avinash
am not sure about casting but you can try to convert all of your sstrings values into numbers then apply your summation or whatever, you can simply archive that by assigning the strings values to variable type p or i.
DATA v_num_value type P.
v_num_value = v_sstring_value .
The system will automatically convert types for you.
Please reward the answer if was helpful to you.
Thanks