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

00 before fields

Former Member
0 Likes
562

Hallow I doing a program that write to file and I wont one field that bring me a 3 numbers like 456 when he less then 3 numbers bring 0 before like 78 bring 078 or 1 bring 001 how can I do that this is my program

SELECT SINGLE name1

FROM hrp1032

INTO wa_itab-num_mmka

WHERE otype = 'D '

AND objid = wa_itab-objid_course_num

AND subty = '9001'

AND istat = '1'.

CONCATENATE wa_itab-objid_oved_num wa_itab-num_mmka

wa_itab-begda wa_itab-endda

INTO v_tab SEPARATED BY ';'.

TRANSFER v_tab TO file_ser.

Name1 is char 12 and num_mmka is same type.

Regards.

Hallow I doing a program that write to file and I wont one field that bring me a 3 numbers like 456 when he less then 3 numbers bring 0 before like 78 bring 078 or 1 bring 001 how can I do that this is my program

SELECT SINGLE name1

FROM hrp1032

INTO wa_itab-num_mmka

WHERE otype = 'D '

AND objid = wa_itab-objid_course_num

AND subty = '9001'

AND istat = '1'.

CONCATENATE wa_itab-objid_oved_num wa_itab-num_mmka

wa_itab-begda wa_itab-endda

INTO v_tab SEPARATED BY ';'.

TRANSFER v_tab TO file_ser.

Name1 is char 12 and num_mmka is same type.

Regards.

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
534

hi,

converts any number into a string fill with zeroes

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = wf_version

IMPORTING

output = wf_version.

Example:

input = 123

output = 0000000000000...000000000000123

Rgds

Anver

5 REPLIES 5
Read only

former_member225631
Active Contributor
0 Likes
534

use the function module conversion_exit_alpha_input

Read only

former_member225631
Active Contributor
0 Likes
534

conversion_exit_alpha_input will add '0' before the values ie input format and conversion_exit_alpha_output will removes the leading zeroes ie output format

Read only

Former Member
0 Likes
534

declare the field as numeric (3).

data : v(3) type n.

or use FM CONVERSION_EXIT_ALPHA_INPUT.

regards

shiba dutta

Read only

amit_khare
Active Contributor
0 Likes
534

Use UNMASK.

UNMASK C2 to C2.

Where C1 is the resultant field.

Regards,

Amit

Read only

anversha_s
Active Contributor
0 Likes
535

hi,

converts any number into a string fill with zeroes

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = wf_version

IMPORTING

output = wf_version.

Example:

input = 123

output = 0000000000000...000000000000123

Rgds

Anver