Post transferred fromHttp://blog.csdn.net/wren2004/article/details/6175203
How to create your own convers. routine? Generally, we use SAP standard alpha, such:
I have always been curious about what Alpha is, not a function group, not a function module. Until recently I had a requirement to create convers containing some special logic. routine, only to find that this Alpha is only a part of the function module name. Double-click Alpha, for example:
Originally, as long as the FM that complies with the conversion_exit_xxxxx_input/conversion_exit_xxxxx_output naming rule can be used as a conversion routine.
In this way, we only need to create two FM instances, name them according to the above rules, and assign the XXXXX In the middle to domin to implement our own conversion rules.
Of course, this FM is not started with Z. When it is created, SAP will have a warning and ignore it.
PS: You can use the above FM to Add/Remove leading zeros, or use the following methods:
Data gv_str type char10.
Gv_str = '123 '.
Shift gv_strRightDeletingTrailing
Space.
Overlay gv_ StrWith'123 '.
Leading 0:
ShiftGv_strLeftDeletingLeading
'0 '.
When creating a self-built table, we may need to convert the domain. In this case, we usually use the conversion routine
The name of conversion routine is only five characters long. In fact, it is also an enhancement technology. After the name is completed, you need to create two function modules in se37:
Conversion_exit_xxxxx_input
Conversion_exit_xxxxx_output
(XXXXX indicates the name of conversion routine. Note that both function modules must define an input parameter and output parameter)
The former is used to convert the input values (for example, to maintain a self-built table, when you enter the field value for the query to automatically add zero effect ), the latter converts the output values (for example, if you take out the database table data,
In the list ).
How to create your own convers. routine? Generally, we use SAP standard alpha, such:
I have always been curious about what Alpha is, not a function group, not a function module. Until recently I had a requirement to create convers containing some special logic. routine, only to find that this Alpha is only a part of the function module name. Double-click Alpha, for example:
Originally, as long as the FM that complies with the conversion_exit_xxxxx_input/conversion_exit_xxxxx_output naming rule can be used as a conversion routine.
In this way, we only need to create two FM instances, name them according to the above rules, and assign the XXXXX In the middle to domin to implement our own conversion rules.
Of course, this FM is not started with Z. When it is created, SAP will have a warning and ignore it.
PS: You can use the above FM to Add/Remove leading zeros, or use the following methods:
Data gv_str type char10.
Gv_str = '123 '.
Shift gv_strRightDeletingTrailing
Space.
Overlay gv_ StrWith'123 '.
Leading 0:
ShiftGv_strLeftDeletingLeading
'0 '.
When creating a self-built table, we may need to convert the domain. In this case, we usually use the conversion routine
The name of conversion routine is only five characters long. In fact, it is also an enhancement technology. After the name is completed, you need to create two function modules in se37:
Conversion_exit_xxxxx_input
Conversion_exit_xxxxx_output
(XXXXX indicates the name of conversion routine. Note that both function modules must define an input parameter and output parameter)
The former is used to convert the input values (for example, to maintain a self-built table, when you enter the field value for the query to automatically add zero effect ), the latter converts the output values (for example, if you take out the database table data,
In the list ).