Create ok code to store ALV tree user interaction









The following ABAP code and information is part of the example ALV tree report demo and adds an ok code to store user response.

In order to define the OK CODE you must fist declare a variable of type SY-UCOMM and then insert this variable into the OK code declaration within the element list (see screen shot below). If you have used the code contained on the iwebsite the ok code should already have been declared as OK_CODE.
i.e. OK_CODE like sy-ucom.

Note: there is also a variable called SAVE_OK, it is good practice to store the returned ok code into a work area as soon as you enter the PAI processing.