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

Please explain code

Former Member
0 Likes
721

Hi,

Any body explain this code.

IF ti_zfeausp-atwrt IS not INITIAL .

CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'

EXPORTING

input = ti_zfeausp-atwrt

IMPORTING

output = ws_c_temp.

check ti_zfeausp-atwrt = ws_c_temp.

flag = '1'.

ELSEIF ti_zfeausp-atflv is not initial.

MOVE ti_zfeausp-atflv to ws_c_temp1.

CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'

EXPORTING

input = ws_c_temp1

IMPORTING

output = ws_c_temp.

check ws_c_temp1 = ws_c_temp.

flag = '1'.

ENDIF.

Thanks & Regards,

sudhakar

3 REPLIES 3
Read only

former_member194669
Active Contributor
0 Likes
623

Hi,

Generally 'CONVERSION_EXIT_ATINN_INPUT' used for padding of zero.

aRs

Read only

Former Member
0 Likes
623

Hi Sudhakar,

Many fields in SAP are stored differently and shown differently on the output.

For eg. Material number 1000, while storing in MARA will be stored as 0000001000 but when you look on the selection screen or any other screen you will only see 1000.

This kind of conversion is carried out by the Conversion Routines which are defined at domain level of the field.

Here this code is converting field ATINN to its internal storing format.

Reward points if useful.

Regards,

Atish

Read only

Former Member
0 Likes
623

Sudhakar,

As the others have explained, the CONVERSION_EXIT function modules are typically used to convert values between internal (what's stored in SAP) and external (what's shown by SAP when values are displayed on screen). You will know if a field has a conversion exit attached through its domain.

As for the specific code that you have, the ATINN conversion exit is used to convert characteristics between their internal storage (usually numeric) and their external display (usually descripitve alpha numeric, up to 30 chars if I remember right).

Maybe you can let us know what you are trying to achieve, then we may be able to provide more assistance.

However, the actual input fields you are passing are actual characteristic values, not the characteristic names. That is, ATWRT is typically the field used to store character type values of specific characteristics, while ATFLV is usually the field used to store numeric type values.

The if statement suggests that you are checking one or the other (which is correct, as this should be an either or, but I would probably check ATFLV first rather than ATWRT). However, your use of the ATINN conversion exit does not make much sense to me: you are using the conversion exit for a <i>characteristic name</i> against fields that store <i>characteristic values</i>.