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

general

Former Member
0 Likes
603

what is conversion exit

5 REPLIES 5
Read only

Former Member
0 Likes
570

Hi Mrudula,

A conversion exit is a called routine that formats the output. An edit mask that begins with == followed by a four-character ID calls a function module that formats the output. That four-character ID is known as a conversion exit, or conversion routine. (Function modules are covered in a subsequent chapter, but, for now, think of a function module as a subroutine within another program.) The name of the function module will be CONVERSION_EXIT_XXXX_OUTPUT, where XXXX is the four-character id that follows ==. For example, write '00001000' using edit mask '==ALPHA' calls the function module CONVERSION_EXIT_ALPHA_OUTPUT. The write statement passes the value first to the function module, which changes it in any desired way and then returns the changed value, and that value is written out. This particular exit (ALPHA) examines the value to determine whether it consists entirely of numbers. If it does, leading zeros are stripped and the number is left-justified. Values containing non-numerics are not changed by ALPHA. SAP supplies about 60 conversion exits for various formatting tasks.

Conversion exits are particularly useful for complex formatting tasks that are needed in more than one program. To illustrate, the conversion exit CUNIT automatically converts the code representing a unit of measure into a description meaningful in the current logon language. For example, within R/3, the code for a crate of materials is KI. (KI is an abbreviation of kiste, the German word for "box.") However, CUNIT converts KI to the English mnemonic CR. Therefore, when logged on in English, write: '1', 'KI' using edit mask '==CUNIT'. writes 1 CR. For a user signed on in German, the output would be 1 KI. Using such a conversion exit enables a standard set of codes stored in the database to be automatically converted to be meaningful to the current logon language whenever output to a report.

Conversion Routines within a Domain

A conversion exit can also be placed into the Convers. Routine field in a domain. The exit is inherited by all fields that use that domain, and will be automatically applied when the value is written out.

Check these abour conversion exits from SAP help.

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee19446011d189700000e8322d00/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/33/206bc8012e11d3b495006094192fe3/frameset.htm

http://www.sapfans.com/sapfans/forum/devel/messages/31053.html

Regards,

Priyanka.

Read only

Former Member
0 Likes
570

Hi naga,

1. It is nothing but a simple Function Module

attached to a domain/data element/field.

2. Simple example if of MATNR.

3. SCREEEN<----


>Database

On screen we just enter 1

But in database it is stored as 0000000000000000000001

4. So this CONVERSION

from Screen<----


>database

and Vice-Versa,

is done by this FM (conversion exit),

automatically,

behind the scenes.

regards,

amit m.

Read only

Former Member
0 Likes
570

Hi naga,

You can understand Conversion exit by see this example .....IN SPFL table the field FLTIME is using a Conversion exit.This is navigation ....

1. GOTO se11

2. Open SPFLI table

3.GOTO the Domain of field FLTIME.

4.You can see the Conversion exit SDURA

5.Double click on it, yop can see two function modules

a. CONVERSION_EXIT_SDURA_INPUT

b. CONVERSION_EXIT_SDURA_INPUT

6.Now GOTO se37 and see the code of these two FMs

7.See the selection screen of the table SPFLI, you can see format of time

in 03:30.

But it actually stores the Mins in memory as 90 mins.

Now start writing your own Conversion exit.

This is all for <b>user Friendlyness.</b>

<b>Hope this is very helpful for you.

Reward all helpful answers.</b>

Regards,

V.Raghavender.

Read only

Former Member
0 Likes
570

Hi,

In some cases like when Passing the data to function modules or to some programs or from Screen to Program or Program to screen or from Program to script we have to pass the exact values without conversion.

for example Material No is 18 Char field. it its value is 456578, then to some fun modules it has to be passed like 000000000000456578 instead of 456578.

similary fields like KUNNR, LIFNR etc has to be passed with complete 10 digit values.

this will be achieved using the fun modules

CONVERSION_EXIT_ALPHA_OUTPUT

CONVERSION_EXIT_ALPHA_INPUT

reward if useful

regards,

Anji

Read only

Former Member
0 Likes
570

CONVERSION from Screen value to value stored in database

and Vice-Versa, is done by this FM (conversion exit),

automatically,

On screen we just enter 1234

But in database it is stored as 0000000000000001234

not only numeric.

On screen we just enter OR for standard orders

But in database it is stored as TA.

This is maintained in the domain level.

Rusidar