‎2008 Mar 28 4:18 AM
Hi,
Is there a function module which can convert data in character type to any other required data type?
Like i have a date 12.2.2008 and it is stored as character now i want to convert it into type d.
so that when i use
Describe field <field_name> type <type>.
statement afterwards then it gives me D not C as its data type.
The requirement does'nt stick to conversion of just one data type.I need an FM which can convert data in character type to any data type.
Hope you understood the problem.
Thanks for your time.
‎2008 Mar 28 4:24 AM
ucan use this to convert char into any data type.
CONVERT_FROM_CHAR_SORT_RFW.
CWM/CONVERT_CHAR_TO_PACK
Reward points..
‎2008 Mar 28 4:23 AM
hi,
do this way ...
data : v_date1(10) value '12.02.2008',
v_date2(10),
v_date3 like sy-datum.
concatenate v_date1+ 5(4) v_date1+ 3(2) v_date1+ 0(2) into v_date2.
v_date3 = v_date2.
write : v_date3.
‎2008 Mar 28 4:25 AM
The data should remain as it is.Don't need to manipulate the data.
I only have to change its data type.
‎2008 Mar 28 4:24 AM
Hi,
Use the code.
data : date like sy-datum.
call function 'CONVERT_DATE_TO_INTERNAL'
exporting
date_external = '01.01.2008'
IMPORTING
DATE_INTERNAL = date
EXCEPTIONS
DATE_EXTERNAL_IS_INVALID = 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.Regards,
Morris Bond.
Reward Points if Helpful.
‎2008 Mar 28 4:24 AM
ucan use this to convert char into any data type.
CONVERT_FROM_CHAR_SORT_RFW.
CWM/CONVERT_CHAR_TO_PACK
Reward points..
‎2008 Mar 28 7:22 AM
‎2008 Mar 28 4:24 AM
Hi,
check this Function module in SE37
CONVERSION_EXIT_ALPHA_OUTPUTit will return the value in ur required format
reward if useful
‎2008 Mar 28 4:24 AM
‎2008 Mar 28 5:27 AM
Hi Kamini Rawat,
Have you tried FIELD-SYMBOLES for this ???
FIELD-SYMBOLS : <FS> TYPE ANY.
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/frameset.htm
Hope it will solve your problem...
Thanks & Regards
ilesh 24x7
Edited by: ilesh 24x7 on Mar 28, 2008 10:57 AM
‎2008 Mar 28 6:30 AM
The requirement is to find whether the data is compatible with the required type or not.
When i upload data from excel file using FM alsm_excel_to_internal_table type for all the values is C.
And the column and row number of the excel file where the data format is wrong is to be captured.
We can get the correct types for these fields from dd03m.
I don't understand how field symbols can help in this?
‎2008 May 20 1:24 PM
Hi,
Is there any Function module to convert character type to Raw data type or vice versa of a field.