Create your own convers. Routine.

Source: Internet
Author: User

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 ).

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.