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: 

REGARDING THIS CODE

Former Member
0 Kudos

HI,

THIS IS THE REQUIREMENT

THERE IS A NUMERIC VALUE "1"

SO I NEED TO ADD 17 ZEROS TO THIS VALUE OF "1"

OUT PUT WILL BE LIKE THIS 000000000000000001.

COULD U PLZ TELL ME THE LOGIC OF THIS

7 REPLIES 7

hymavathi_oruganti
Active Contributor
0 Kudos

probably u r talking about conversions of user to sap format.

use this function module

<b>conversion_exit_alpha_input.</b>

example:

REPORT z_test NO STANDARD PAGE HEADING.

data: val(1), val1(18).

val = 1.

val1 = val.

*write val1.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = val

IMPORTING

OUTPUT = val1

.

write val1.

.

Message was edited by:

Hymavathi Oruganti

0 Kudos
data: p2(17)  type n.
 p1 =1.
p2 = p1.

abdulazeez12
Active Contributor
0 Kudos

Hi

use OVERLAY command.

Look at the code below:

CONSTANTS initial_time TYPE t VALUE IS INITIAL.

DATA: time TYPE t,

text TYPE c LENGTH 4.

text = '12'.

time = text.

OVERLAY time WITH initial_time.

After the text field has been assigned to the time field, it contains the invalid tome "12 00" according to the conversion rules. As a result of the overlay with the initial_time constants, the two blank characters are replaced by "00" and the result is the valid time "120000".

Cheers

Shakir

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi Rajesh

Use FM:

<b>conversion_exit_alpha_Input.</b>

Regards,

Sree

former_member404244
Active Contributor
0 Kudos

Hi,

declare the variable of type c

data : v_var(20) type c.

v_num = 1.

move : v_num to v_var.

Now call the FM "coversion_exit_alpha_input".

now pass v_var to it..

it will give u 00000000000000001 as output .

Regards,

Nagaraj

Former Member
0 Kudos

Most likely this is a material number. Be sure to reference your variable or field to MATNR. Then use unpack to add the leading zeroes.

ex.


itab-field = 1.
unpack itab-field to itab-field.

or


lv_matnr = 1.
unpack lv_matnr to lv_matnr.

former_member188827
Active Contributor
0 Kudos

data zch1 type c value '1'.

data i type i value 1.

data zch(18).

WHILE i le 17.

CONCATENATE '0' zch into zch.

i = i + 1.

ENDWHILE.

CONCATENATE zch zch1 into zch.

WRITE / zch.

plz reward if dis helps