Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

data type

Former Member
0 Kudos

what is diff betn char type & numeric text type(type c & n)

5 REPLIES 5

Former Member
0 Kudos

Hi Shital,

CHAR C array of c_ubyte left-aligned string filled with spaces string

NUMC N array of c_ubyte right-aligned zero-filled string containg digits only integer

INT4 I c_int integer integer

C Character 1 Space

N Numeric text 1 '00...0'

D Date YYYYMMDD 8 '00000000'

T Time HHMMSS 6 '000000'

X Byte (heXadecimal) 1 X'00'

I Integer 4 0

P Packed number 8 0

F Floating point number 8 '0.0'

Sample Code:

DATA: ws_data TYPE char10.

ws_data = 'SAMPLE'.

WRITE:/ ws_data.

DATA: ws_data1 TYPE i.

ws_data1 = 10.

WRITE:/ ws_data1.

DATA: ws_data2 TYPE n LENGTH 2.

ws_data2 = 31.

WRITE:/ ws_data2.

<b>Regards,

Azhar</b>

Former Member
0 Kudos

hi ,

char type is to store character strings. And

Numeric is to store for numbers.

In SAP Default is CHARACTER.

Cheers,

Rohith.

Former Member
0 Kudos

Hi,

If a variable is declared of type C(char) it can have all numbers, characters and special characters also.

If it is of type Numc (N) it can take only numbers no alphabet and special chars, but u can't perform any calculations on it.

Reward if useful

Thanks,

Neeraja

Former Member
0 Kudos

hi

'C' type is used for storing a string of characters.

'n' is used for storing a string of Numbers

Regards

Preeti

Former Member
0 Kudos

Hi Shital,

CHAR Character String

NUMC Character string with only digits

CHAR

Character string. Fields of type CHAR may only have a maximum length

of 255 in tables. If longer character strings are used in tables,

use data type LCHR. There are no restrictions for the length of such

fields in structures.

NUMC

Character string that may only contain digits. The length of a field

of this type is limited to a maximum of 255 places.

<b>Reward if Helpful,</b>

Regards,

Adithya M