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

REGARDING THIS CODE

Former Member
0 Likes
882

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
Read only

hymavathi_oruganti
Active Contributor
0 Likes
844

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

Read only

0 Likes
844
data: p2(17)  type n.
 p1 =1.
p2 = p1.
Read only

abdulazeez12
Active Contributor
0 Likes
844

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

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
844

Hi Rajesh

Use FM:

<b>conversion_exit_alpha_Input.</b>

Regards,

Sree

Read only

former_member404244
Active Contributor
0 Likes
844

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

Read only

Former Member
0 Likes
844

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.

Read only

former_member188827
Active Contributor
0 Likes
844

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