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

Conversion of String

Former Member
0 Likes
633

Hi,

I want to convert data like '1212' (It can be anythng upto 18 char) into '000000000000001212' (18 char).

Can anyone pls suggest which FM shld be used for the same.

Rgds,

rag

Edited by: raghav on Jun 24, 2009 12:50 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
607

Hello

CONVERSION_EXIT_MATN1_INPUT

4 REPLIES 4
Read only

Former Member
0 Likes
608

Hello

CONVERSION_EXIT_MATN1_INPUT

Read only

Former Member
0 Likes
607

Hi,

Check this




data: input(10) TYPE c VALUE '1212',
      output(18) TYPE c.


CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT         = input
 IMPORTING
   OUTPUT        = output
          .

write:/ input, output.

Read only

former_member229729
Active Participant
0 Likes
607

Hi,

Here is a sample code:

Data: v_data(18)  TYPE N.
Data: v_out(18)    TYPE C.

v_data = 1212.
Move:  v_data to v_out.

Write: v_out.

OUTPUT would be: 000000000000001212

Rgds,

Ramani N

Read only

0 Likes
607

Hi

In addition to above code you have to use OVERLAY command.

eg. OVERLAY variable WITH '000000000000000000'.

or better use CONVERSION_EXIT_ALPHA_INPUT Function Module.

Regards

Vijai