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: 

Formatting KUNNR

Former Member
0 Kudos

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

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

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

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

hi,

can u be more clear?

regards,

sowjanya

Former Member
0 Kudos

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

Former Member
0 Kudos

Hello,

Try like this


data: custom(15).

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

REgards,

Vasanth

ferry_lianto
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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