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

Adding numc fields ?

Former Member
0 Likes
2,959

Hi,

I have a customer table with a numc(16) field in it. I see that data stored in that field with leading zeroes. For example :

numc table field

-


0000000000000001

0000000000000002

0000000000000320

etc.

The thing is that in a report I have to select some records from the table and have to add a numeric literal to the numc field and store the result in another numc field.

Suppose:

I have a value 0000000000000002 inside lv_maknr which is a numc(16) field. And also suppose I want to add '1' to it and store the result in another lv_maknr2 field.

lv_maknr2 = lv_maknr + '1'.

The problem here is that when I look inside of lv_maknr2, I see there is number 2, left aligned and with leading spaces and many places on the right side of the variable is just empty.

It isn't acceptable for me. I want to have 0000000000000002 inside of lv_maknr2 field. How can I achive that?

regards.

6 REPLIES 6
Read only

Former Member
0 Likes
1,695

Hi

For that use FM 'CONVERSION_EXIT_ALPA_INPUT '.

Regards,

Flavya

Read only

0 Likes
1,695

thank you very much, conversion_exit* worked like a charm.

Read only

Former Member
0 Likes
1,695

hi

declare like this


lv_maknr2(16) type n. 

Regards

Winnie

Read only

Former Member
0 Likes
1,695

Hi,

You can do this way also.

unpack p_w_vbeln to p_w_vbeln1.

Use to fill leading zeros.

Thanks & Regards,

Krishna...

Read only

Former Member
0 Likes
1,695

Use FM 'CONVERSION_EXIT_ALPA_INPUT '

Regards

RH

Read only

Former Member
0 Likes
1,695

Hi,

you can use the Function module 'CONVERSION_EXIT_ALPHA_INPUT'

eg...

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input =lv_maknr2

IMPORTING

output = lv_maknr2.

Regards,

vicky.