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

Formatting KUNNR

Former Member
0 Likes
1,992

I need to set my Client Customer Number to VBAK-KUNNR but it needs to be length 15, left justified, keep leading zeroes, right fill with spaces. How do I do this

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,664

KUNNR is only 10 character and you should definintly NOT try to change the domain so that it reflects 15 characters. This is used in too many places in the system, you should still with the standard 10 character field.

Regards,

Rich Heilman

7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,665

KUNNR is only 10 character and you should definintly NOT try to change the domain so that it reflects 15 characters. This is used in too many places in the system, you should still with the standard 10 character field.

Regards,

Rich Heilman

Read only

0 Likes
1,664

If you simply want to move this value to another field, you can do this in your program.

data: new_kunnr(15) type c.

new_kunnr = vbak-kunnr.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,664

hi,

can u be more clear?

regards,

sowjanya

Read only

Former Member
0 Likes
1,664

I need to send KUNNR in a file and need to format it according to third party specs. In the file they have 15 characters for customer number, I can fill the extra digits on the right with spaces

Read only

Former Member
0 Likes
1,664

Hello,

Try like this


data: custom(15).

custom = vbak-kunnr.
shift custom 5 places right.

REgards,

Vasanth

Read only

Former Member
0 Likes
1,664

Hi,

You should not change standard SAP VBAK-KUNNR which 10 characters long.

This field is used all over the place in SAP application areas.

Please consult with your SD functional consultant for impact analysis and perhaps you may want to do append structure for table VBAK in order to capture the client customer with 15 characters long.

Also try this to send VBAK-KUNNR.

DATA: WA_KUNNR(15) TYPE C.

WRITE VBAK-KUNNR TO WA_KUNNR RIGHT-JUSTIFIED.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,664

I didnt want to change the domain of KUNNR but use it in a custom data type of 15 characters and then I can use my data type in my file

Thanks Rich