Application Development and Automation 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: 
Read only

Doubt on Data type

harri_kishan
Participant
0 Likes
1,053

hi,

I have a customer number which is 10 digit which accepts both numbers and alphabets as the customer number so wht is the data type i should be declaring so tht both numbers and alphabets can be used ?

9 REPLIES 9
Read only

Former Member
0 Likes
1,026

use charcter data type and it allows both number and letters.

Read only

Former Member
0 Likes
1,026

You can declare it as CHAR or NUMC.

If you are declaring it in the program then say:

Data: custno(10) type c.

If it is a field in the table, then declare it as any data element which has the type CHAR 10 or NUMC.

Thanks,

SKJ

Read only

0 Likes
1,026

in your program you can also declare NUMC as

data w_numc(10) type n.

~Suresh

Read only

Former Member
0 Likes
1,026

Hi harri kishan,

You should declare with data type "N" (Numeric text) or "C" (Character) or refer to structure, table field of customer number.

For example

DATA kunnr(10) TYPE n.

DATA kunnr(10) TYPE C.

DATA kunnr LIKE RF02D-KUNNR.

Hope this help.

Regards,

Tiwa.

Message was edited by:

Tiwa Noitawee

Read only

harri_kishan
Participant
0 Likes
1,026

thank you solved

Read only

0 Likes
1,026

hi

just a query...i don't think a variable declared with data type of numc will accept characters (NUMC - Character string with only digits)....in your case, you have to use only characters...curious to know how come your problem solved

Regards

Sathish. R

Read only

harri_kishan
Participant
0 Likes
1,026

i am sry not yet solved i mistakenly closed the thread

Read only

0 Likes
1,026

Hi

You can declare it as CHARACTER or NUMC As per the above suggetions..If you are getting any error in this reply with the correct error message.....

Read only

0 Likes
1,026

For Eg:

DATA MATNR(10) type n.

DATA kunnr(10) ." Of it is type C no need to spefy that..Abap default is Type C only

DATA matnr type mara-matnr.

Reward all helpfull answers........