Sap bw User-Defined Functions

Source: Internet
Author: User

 

1. Create a function group. Before customizing a function, create a function group. Se37, go to function builder, and choose goto ---> function groups ---> Create group.

2. Enter the create function group and enter the corresponding name and remarks. Note that the name must start with "Z". Otherwise, the system prompts that you do not have the permission to perform the operation. Enter the access key. This may be because SAP has a set of rules. What we define is to start with "Z.

3. Click the green check box. The prompt is as follows:

4. Create your own function. Enter the corresponding function name and press create to continue.

5. Select the function group. Here I select the created zfmkg50. And fill in short text.

6. Here I will describe the functions implemented by this function. Pass in the and B values of the integer type, and then return the result of their addition. The following import defines the input parameters.

7. define the type of a value. Note that this associated type will pop up and select "Search for data elements ".

8. Enter and select "data type ".

9. Select int4. Check and return.

10. As shown in the following figure, I am not quite sure what this is for. It is estimated that we should choose the proper length.

11. The default value is 0.

12. Define B in the same way.

13. Final Result

14. Define the output result, which is defined at the export.

15. The input and output parameters are defined, and the specific implementation code is defined in the source code.

 

16. check whether it is correct. Activate it.

17. Call this function demonstration. se38 enters the ABAP editor and defines a program: ztestcallfm50,

 

18. Enter the Complete title and select executed program. Status and SAP standard production program.

19. Check and enter

20. Write the specific implementation code under report ztestcallfm50g. Of course, it also provides a shortcut. You can use the "pattern" button to call the function in a conversational manner.

21. In the pop-up dialog box, select the ztestfm50 function you just created.

22. The system automatically fills in some code.

23. On this basis, I complete the functions I want to implement.

24. check whether it is correct. Activate it. Run or F8 again to check the result. Note that you should not put the function in the edit State in another session; otherwise, the call is wrong.

 

The functions provided here are simple, but they only illustrate the process of calling a function in BW.

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.