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: 

FM CONVERSION_EXIT_ALPHA_INPUT

Former Member
0 Kudos

HAI EXPERTS,

my requirement is to use this FM CONVERSION_EXIT_ALPHA_INPUT for conversion of input fields.

i have around 6 fields to convert each with different length , i want to use this FM only once to convert all the 6 fields.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = tablename-fieldname "this part alone i need to input all the fields dynamically

IMPORTING

output = tablename-fieldname. "this part alone i need to input all the fields dynamically

i have to change the input and output names in the fm dynamically.

i need to call this fm in a perform and then change....

can anyone help me on this......

9 REPLIES 9

Former Member
0 Kudos

Hi,

Call this FM within a Subroutine.

PERFORM subname changing fieldname.

FORM subname CHANGING fieldname

CALL FUNCTION.

ENDFORM.

using this u can just cal the MF multiple times just replacing the field name in the PERFORM statement.

REWARDS IF HELPFUL!!

0 Kudos

hi Basvaraj

what to give for fieldname...

what to give in the input and output in the FM.

thanks

regds

0 Kudos

hii

call the perform inside a loop and

pass the value to a temp variable.

pass that temp variable to fm,

clear the variable.

do the same thing again in next loop pass

reward if helpful

vivekanand

0 Kudos

hai,

but the field length changes what to do?

thaks

0 Kudos

OK.. for the fieldname... give the names of the 6 fields u want to change.. like:

PERFORM subname CHANGING field1.

PERFORM subname CHANGING field2.

PERFORM subname CHANGING field3. and so on.

Again give the name that u use within FORM

if you have used

FORM subname CHANGING field.

CALL FUNCTION

IMPORTING

input = field

EXPORTING

output = field.

ENDFORM.

this should work.

REWARDS IF HELPFUL!!

0 Kudos

Don't worry about the field length. This is totally based on the declaration of the field. The FM checks for the field type and based on that type it works on the field. So you don't have to worry about the field length.

REWARDS IF HELPFUL!!

0 Kudos

u can use a fieldsymbol and try assigning it the required fiedl when needed.

do 6 times.

case sy-index.

when 1.

assign field1 to <fs>.

when 2.

assign field2 to <fs>.

when 3.

assign field3 to <fs>.

when 4.

assign field4 to <fs>.

when 5.

assign field5 to <fs>.

when 6.

assign field6 to <fs>.

endcase.

CALL FUNCTION

IMPORTING

input = <fs>.

EXPORTING

output = field.

endo.

Former Member
0 Kudos

HI,

Perform input_change changing Input1 .

perform input_change changing input2 .

.

.

.

The form statement will be

form input_change changing val1.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = VAl1

IMPORTING

output = VAl2.

clear val1.

move val2 to val1.

endform.

Thanks,CS Reddy.

**Please Reward if helpful.

former_member404244
Active Contributor
0 Kudos

Hi,

declare the fileds as character fields and u can pass like this

perform sub_conversion using field

form sub_conversion field type c

call function 'CONVERSION_EXIT_ALPHA_INPUT'.

IMPORTING

INPUT = field

EXPORTING

OUTPUT = field

endform.

Regards,

Nagaraj