2008 May 23 2:34 PM
hi ,
what is the diff between conv outine input and output .
in my program where should i use which one .
which are the mostly used fields on which conv routine is req.
hi ,
what is the diff between conv outine input and output .
in my program where should i use which one .
which are the mostly used fields on which conv routine is req.
2008 May 23 2:36 PM
hi,
Input and Output Conversions
Depending on the data type of the field, there is a conversion when the contents of a screen field are converted from display format to SAP-internal format and vice versa. If this standard conversion is not suitable, it can be overridden by defining a conversion routine in the underlying domain.
Conversion routines are identified by a five-place name and are stored as a group of two function modules. The function modules have a fixed naming convention. The following function modules are assigned to conversion routine xxxxx:
CONVERSION_EXIT_xxxxx_INPUT
CONVERSION_EXIT_xxxxx_OUTPUT
The INPUT module converts from display format to internal format, and the OUTPUT module converts from internal format to display format.
When is a Conversion Routine Executed?
If a screen field refers to a domain with a conversion routine, this conversion routine is executed automatically when entries are saved in this screen field or when values are displayed in this screen field. The conversion routine of the domain is also triggered when the field contents are output with the WRITE statement.
Table SPFLI in the flight model contains information about the flights offered by the carriers. The time for each flight is recorded in field FLTIME. Enter and display the time of the flight in input templates in the form HHH:MM (hours:minutes). Store the flight time entered in the database as an integer number (number of minutes of the flight). An entry 3:27 is therefore stored in the database as 207 (3 hours, 27 minutes = 207 minutes).
Field FLTIME refers to domain S_DURA, to which conversion routine SDURA is assigned. The value is thus converted by the two function modules CONVERSION_EXIT_SDURA_INPUT and CONVERSION_EXIT_SDURA_OUTPUT.
A conversion routine can also be triggered by specifying its five-place name in the attributes of a field in the Screen Painter or with the addition USING EDIT MASK <Name of conversion routine> in the WRITE command in the program. With the USING NO EDIT MASK addition in the WRITE statement, you can skip a conversion routine defined for a domain when outputting.
Parameters
The two function modules of a conversion routine must have precisely two parameters with the names INPUT and OUTPUT for the value to be converted and the converted value.
The INPUT parameter in the INPUT conversion and the OUTPUT parameter in the OUTPUT conversion should not have any reference fields because the value passed in the call could have a different length than that expected.
Programming Conversion Routines
ABAP statements that result in an interruption of processing (such as CALL SCREEN, CALL DIALOG, CALL TRANSACTION, SUBMIT, COMMIT WORK, ROLLBACK WORK, MESSAGE I, MESSAGE W) are not allowed in conversion routines.
Only A messages are meaningful in output conversion, but A, E and S messages can be triggered in input conversion (although S messages are not very meaningful here). E messages result in an error dialog. Exceptions are not intercepted in the call.
The output conversion is also triggered with WRITE and WRITE TO. The conversion routine may therefore occur very frequently with lists. The output conversion should therefore be programmed as efficiently as possible.
No external performs should be used in conversion routines. Programs that are called externally use the table work areas of the first calling main program. In conversion routines this can result in errors that cannot be easily analyzed since they are sometimes called at unpredictable times in the program flow.
http://help.sap.com/saphelp_nw70/helpdata/en/cf/21ee19446011d189700000e8322d00/content.htm
reward if helpful
prasanth
2008 May 23 2:56 PM
Hi,
What is Conversion Routine?
A conversion routine CONV (also known as conversion exit) is represented by two function modules that adhere to the naming convention
CONVERSION_EXIT_CONV_INPUT|OUTPUT. In these function modules, no statements can be executed that interrupt the program flow or end a SAP LUW. A conversion routine can be assigned to a domain in the ABAP Dictionary. If a screen field refers to a domain with a conversion routine, or is directly assigned a conversion routine in its attributes, the system automatically executes the function module ..._INPUT for every input in the relevant screen field and the function module ..._OUTPUT when values are displayed in this screen field and uses the converted content in each case. If a data object refers to such a domain, the function module ..._OUTPUT is executed for the output of the data object using WRITE or WRITE TO and the converted content is displayed.
Use
conversion routines are used to convert the fields either
from display format to SAP internal format or from SAP
internal format to display format.
For this the following routines are used.
Conversion_exit_xxxxx_input - display format to SAP
internal format.
Conversion_exit_xxxxx_output - SAP internal format to
display format.
we have to create the conversion routines while creating
domains.
In General in your program For Example when you want to print any material number, Actually the length is 18. If your output of mat number consists of 10. Then you will get zero's followed by 10 upto the length 18. (0000.............10)
So, Inorder to avoid this we use this routines.
It is also used for date format also.
Reward points if useful.
Cheers,
Swamy Kunche
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |