Sometimes performing even basics tasks in ABAP may confuse, especially if you are a newbie in ABAP.
Today I’m going to show how to add new row (line, element) to context node collection in SAP CRM using ABAP.
At the end of the post you can find the final code example, implementing the discussed task.
Feel free to copy, paste and run this code snippet.
Theory. In order to add new element to context node you have to:
1. Define a structure line of the context node element.
2. Create data reference, based on the structure line, defined at the previous step
3. Define the new context node object that will contain the new values, we’re going to add to the context node
4. Fill the new context node object with the new values
5. Add new context node object, filled with the data to the context node.
Practice. The final code:
As you can see, even such basic stuff in ABAP SAP CRM may contain some «pitfalls».