Convert Char to Numc or Date
I need to knw how to convert a char var to integer or numerical variable. If possible ,dats format.
Reply imm
hi
if you take a numc data type then you can move the char value to the numc stright.
if it is dats u can do a move char_variable to dats_variable.
regards.
Lakshmikanth.
Similar Messages
-
Converting CHAR type to other data types
Dear SDN users,
would any of you know how to convert a CHAR data type to other data types for example hexadecimal etc., and convert them back? I suspect there must be some standard FMs available.
Thankyou for your responses.
Regards,
SmithaHello smitha ,
I suppose you are assigning some variable of char type to a variable of integer type it will automaticaly (implicitly ) convert the type .
in some case we need to change the type explicitly like the above mentiioned .
Thanks and regards ..
Priyank -
Convert Char to Date format - Evaluate
Hi,
Could anyone provide us the Evaluate formula to convert Char to Date format
2009-06-20 should be converted to 06/20/2009
Regards,
VinayHi,
Refer the below threads...
Re: How to convert string to date format?
how to convert character string into date format????
Regards,
Chithra Saravanan -
Convert Char to Date in SQL Server
Hello Experts,
I am trying to convert Char to Date but getting error in Universe designer. Can anybody advise please?
Thanks,
RaviHi,
Try with CAST() and CONVERT() functions. For more information refer use this url : http://msdn.microsoft.com/en-us/library/ms187928.aspx.
It is more easy to get solution if you can post your query.
Cheers,
Suresh Babu Aluri. -
Hi all,
i searched alot but couldn't find solution.
i have l_value char(45) field value has 4560
I need to convert this into vbak-netwr field in sales order user exit MV45AFZZ
when i assign vbak-netwr = l_value.
I am getting 45.60 in vbak-netwr field.
when i try same login in report progam it is working fine but not in user exit.
any suggestions?
GiriSample program to convert Char to Curr.
data: curr type kna1-umsa1,
char(254) type c.
data: temp type p length 15 decimals 2.
char = '1,405.25'.
REPLACE ALL OCCURRENCES OF '.' IN char WITH space.
REPLACE ALL OCCURRENCES OF ',' IN char WITH space.
CONDENSE char NO-GAPS.
temp = char.
curr = temp / 100.
write: 'CHAR = '.
write :/ char.
write:/ 'CURR = '.
write: curr.
<< Removed by moderator >>
Regards,
Uttam Agrawal
<< Removed by moderator >>
Edited by: uttamagrawal on Feb 22, 2011 9:21 AM
Edited by: Neil Gardiner on Feb 22, 2011 9:01 PM -
Convert char to ascii code and vice versa
HI
Is there any function module to convert char to ascii code and vice versa.
Thanks in advanceHi,
be careful if you have unicode running in your system. URL_ASCII_CODE_GET is platform-dependent so it will return the internal HERX representation of the character in your system - which is hopefully and in most cases ASCII.
Under unicode, we use double-byte characters here. I tried this function and the result CHAR_CODE is '00' regardless what character I specify for TRANS_CHAR. But the coding is so simple I corrected resultig in this sample code:
[P]
convert p_form to ASCII (internal) representation
DATA:
l_ofs TYPE syfdpos,
l_len TYPE sy-linsz,
l_ascii TYPE i.
FIELD-SYMBOLS:
<x> TYPE x.
l_len = STRLEN( p_ascii ).
DO l_len TIMES.
l_ofs = sy-index - 1.
ASSIGN p_ascii+l_ofs(1) TO <x> CASTING.
l_ascii = <x>.
WRITE: l_ascii.
ENDDO.
[/P]
Here, for each character of string p_ascii, the internal (ASCII) representation is determined and written to the output list.
Regards,
Clemens -
Dear all ,
I have to convert char to dec , my requirement is to covert 12344434 to 123444.34 .
note i don't want 12344434 to 12344434.00 .
Thanks in advance
DebeshYou can try like this.
DATA : v_tot_len TYPE i,
v_off_len TYPE i.
DATA : v_off_text(50) TYPE c,
v_dec_text(2) TYPE c,
v_fin_text(50) TYPE c.
PARAMETERS : p_input TYPE text20 OBLIGATORY.
START-OF-SELECTION.
v_tot_len = STRLEN( p_input ).
v_off_len = v_tot_len - 2.
v_off_text = p_input+0(v_off_len).
v_dec_text = p_input+v_off_len(2).
CONCATENATE v_off_text v_dec_text INTO v_fin_text SEPARATED BY '.'.
Here I am inputting the text to be converted. -
How to convert char to curr ?
Hi gurus.
Forgive me for the silly question.
I have a problem with data conversion from char to curr with 2 decimal places.
This is the scenario, I have a Z transaction which receives an excel file containing data from invoices and when the field contains a value such as 35,0 the program records the value 3.50 in the destination variable. But when the value is 35,45, it works.
Here is the piece of code:
WHEN '0007 '.
TRANSLATE USING ITAB-VALUE. " '.
ITAB-VALUE USING TRANSLATE',.'.
CONDENSE ITAB-VALUE NO-GAPS.
WA_OPER_MENORES-VL_BRUTO = ITAB-VALUE.
If I format the column in the excel file for numeric value with 2 decimal places also works, because when the value is formatted 35,0 change to 35,00. But I can not tell all the users hey formatt your files before upload to SAP.
To test I generate a simple report that reads the excel file and makes the conversion of the columns, like the code above, so I had no problems. I think there should be some configuration that has been changed in the transaction, but I'm new in ABAP, I come from "Java World" and I have no idea that could be.
I could just use a quick and dirty solution, adding a zero at the end of the column, when there is the 2 decimal places, but I prefer a clean solution.
Guys, is there any function module or class that does that kind of data conversion? If not, you could tell me what is the best practice to solve this problem?
thank you very much,
Ronaldo S. VieiraFollow this example to convert Char to Curr and Vice-Versa
DATA iamnt(17) TYPE c VALUE '243567.00'.
DATA eamnt TYPE p DECIMALS 2.
DATA oamnt(17) TYPE c.
MOVE iamnt TO eamnt.
WRITE eamnt TO oamnt.
WRITE oamnt. -
How to convert char(1) to int32 datatype in pl/sql
Hello,
I am trying to convert char(1) to an integer data type to be put into an int32 variable in C#. I tried several options such as TO_NUMBER ,CAST(.. AS INTEGER), and CAST(.. AS SMALLINT) but they all return int64.
Is there a way to ensure the casting into a datatype that is compatible with int32 ?
ThanksOracle's SQL Datatypes are limited to NUMBER, BINARY_FLOAT and BINARY_DOUBLE.
There's a few others through PL/SQL including BINARY_INTEGER.
If you look in USER_ARGUMENTS you can see it is defined slightly differently.
Don't know whether / how .Net infers datatypes, but it is worth a shot.
create or replace function v (p number) return binary_integer is
begin
return p;
end;
/ -
Any way to Convert CHAR(8) field to QUAN(8)?
Any way to Convert CHAR(8) field to QUAN(8)?
Thank-You.Hi
The MOVE statament automatically converts the data format
DATA: VAR_IN(8) TYPE C,
VAR_OUT TYPE P.
MOVE VAR_IN TO VAR_OUT.
It's important your char has only number and the point as separator of decimal part.
Max -
Infoobj is changed frm Char to NUMC
Hi Gurus,
I have an infoobject which is giving data to another infoobject.
We had a requirement to change the former info object from CHAR to NUMC and removing the ALPHA conversion routine.
Everything went on well in DEV system, I transported it to Q system.
There I faced a problem. The info object is not being activated in Q system. When i saw the problem the SID table CHAR and the info object was NUMC.
I tried to delete the master data which is already there in the info object it was not being deleted. I thought that if i delete the entries of this info object in the infoobject which is getting data from this infoobject, then i tried to delete the entries in the Info object again it is not getting deleted.
Can anyone please help in this situation what I need to do???
Thanks in advance,
Regards,
RajniCheck if the IO is used in some other areas using 'Where Used List' button..
Delete Data from other location if already loaded..and remove the IO.
delete data from IO.. -
Converting char type to numeric
hi,
is there any Function Module that converts char type to numeric.
thanks.hi,
data : w_num type i,
w_char type char10.
Use can asign character to numeric in PGM by using the statement try endtry.
try .
w_num = w_char.
endtry.
Regards,
Prabhudas -
Is there any FM convert char to number ?
Hi guys,
Is there any FM convert char to number ?
what are they? and how can I find them ?
thx in advance.Hi
data: wl_char(3) type c value '123',
wl_num type n .
CALL FUNCTION 'MOVE_CHAR_TO_NUM'
EXPORTING
CHR = wl_char
IMPORTING
NUM = wl_num
EXCEPTIONS
CONVT_NO_NUMBER = 1
CONVT_OVERFLOW = 2
OTHERS = 3. -
how can i convert char to binary
Can you provide a bit more context?
Are you trying to change the definition of a column in a table? Or are you trying to cast a particular value from a table into a binary value in PL/SQL?
How much data are we talking about?
Have you looked at the UTL_RAW.CAST_FROM_<<data type>> functions? Is that what you're looking for?
Justin -
Converting Char type structure to Hex type structure
Hello ,
In unicode system how to convert char type structure to hex type structure . I am having structures as follows :
DATA: BEGIN OF HEXBYTE,
X TYPE X,
END OF HEXBYTE.
DATA: BEGIN OF CHARBYTE,
C TYPE C,
END OF CHARBYTE.
HEXBYTE-X = CHARFIELD.
CHARBYTE = HEXBYTE.
But error coming is Charbyte and HexByte are not compatible . Plz suggest!!
Thanks ,
KeithHi,
These function modules are:
NLS_STRING_CONVERT_TO_SYS (hex to char)
NLS_SRING_CONVERT_FROM_SYS (char to hex)
Regards,
Nikhil
Maybe you are looking for
-
F150-dunning letter printing conditions
Hi All, dunning smart form(custom)was getting called from SAPF150D2 program ,but the problem is i need to restrict the smart form call based on some particular custom conditions like level1 should trigger after 15 days level 2 letter with 9 days like
-
Trying to install software!!!!
As soon as I put the disk in the slot drive it pops right back out!!! Can anyone help?! Why is it doing this and how can I make it stop and begin the install???!!!!!
-
Problem in update database record with torque
Can anybody correct my mistake. please........ Torque.init("E:/Upendra_working_directory/msh2.0/Torque.properties"); System.out.println("State: " + Torque.isInit()); System.out.println("Connection Sucessfully........"); Criteria crit = new Criter
-
How to ActiveSync in Java ??
How to write ActiveSync in Java for iPAQ WinCE ?
-
Firefox opens new window when link is clicked but the bookmarks toolbar is missing
When I start up firefox, the original window displays my bookmark toolbar. But when I click a link where firefox opens a new window, not a new tab, the new window doesn't display my bookmark toolbar. I made sure that it was toggled to be on, and the