‎2008 Jan 02 9:20 AM
IN FUNCTION MODULE NUMERIC_CHECK.
WHAT VALUE SHOULD BE GIVEN IN STRING IN AND STRING OUT.
‎2008 Jan 02 9:24 AM
data: st type string value '1234',
h_type type dd03l-datatype.
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
STRING_IN = st
IMPORTING
STRING_OUT = st
HTYPE = H_TYPE.
string_in is the variable you want to check.....
string_out is optional....
‎2008 Jan 02 9:24 AM
data: st type string value '1234',
h_type type dd03l-datatype.
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
STRING_IN = st
IMPORTING
STRING_OUT = st
HTYPE = H_TYPE.
string_in is the variable you want to check.....
string_out is optional....
‎2008 Jan 02 9:24 AM
REPORT ZSDN.
DATA: STRING_IN TYPE STRING,
STRING_OUT TYPE STRING.
DATA: HTYPE LIKE DD01V-DATATYPE.
STRING_IN = 'AA'.
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
STRING_IN = STRING_IN
IMPORTING
STRING_OUT = STRING_OUT
HTYPE = HTYPE.
WRITE: / STRING_OUT,
HTYPE. " It returns the datatype
‎2008 Jan 02 9:24 AM
Hi.
Just pass whatever in string_in when calling the function module and it will return a new string in string_out and its type in HTYPE fields.
Try it in SE37 to see what I mean.
Reward if helpful.
Regards,
George
‎2008 Jan 02 9:25 AM
Hi ramya,
function numeric_check.
*"----
*"Lokale Schnittstelle:
*" IMPORTING
*" STRING_IN -> pass the variable to be checked
*" EXPORTING
*" STRING_OUT -> same variable as STRING_IN
*" HTYPE LIKE DD01V-DATATYPE -> create a variable with reference to this parameter. This field will show the result.
*"----
Reward point(s) if this has helped you.
‎2008 Jan 02 9:25 AM
Hi,
the function module retrns the data type of a given string.
INstring should be the value u enter , string out is output of the string
eg
when u execute this function module
call function 'Numeric_check'
exporting
string_in = '1213232'
importing
string_out = val_string
Htype = vval.
wal will have the data type .
in the above eg val_string will be 123232
and wal will be 'NUMC'.
regards,
Santosh Thorat
‎2008 Jan 02 9:28 AM
apart from above FM you can try this code....
PARAMETERS : p_text TYPE char20.
IF NOT p_text CA sy-abcde.
WRITE 😕 'All numerics'.
ELSE.
WRITE 😕 'Not all numerics'.
ENDIF.
‎2008 Jan 02 9:35 AM
hi ramya,
Go to se37, give ur function module name
and u can get the meaning for that importing and exporting fields not for this FM, for all other FM also.
Here,
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
STRING_IN = ' value to be checked '
IMPORTING
STRING_OUT = ' optional '
HTYPE = 'type of that variable'.
regards,
guna..