Find out how to insert predefined or custom code snippets into your code.
Code snippets are small blocks of source code for recurring coding tasks such as calling a method of a custom reuse library. Some code snippets offer parameters for filling in placeholders in the code. There are two kinds of code snippets: Predefined code snippets and custom code snippets. The predefined code snippets are provided by SAP, while the custom code snippets depend on the custom entities you have created in your system.
Predefined code snippets are calls to the custom business objects Write API. These code snippets will only be shown if the method you are implementing has the Write API as a parameter.
-
Select a code snippet from the list.
-
Fill in the placeholders by maintaining the parameters on the Details page.
The parameters are not mandatory. You can also insert the code snippet with placeholders, but then syntax errors will appear.
-
Select Insert Code Snippet to insert the code snippet into your code at the last cursor position.
Custom code snippets are calls to the methods of your custom reuse libraries. The parameters of the method call are prefilled with sample data.