abapwebdynpro

NULL Error in Web Dynpro ABAP on CL_NW7_VIEW_ELEMENT_ADAPTER


My Web Dynpro View generates a short dump at runtime before displaying but after correctly running trough the WDDOINIT and WDDOMODIFYVIEW methods.

The short dump indicates that "Access via 'NULL' object reference not possible." and occurs several levels deep in standard SAP code in CL_NW7_VIEW_ELEMENT_ADAPTER=>CREATE_NW7_BY_VIEW_ELEMENT.

The short dump contains the following search hints:

I've removed embedded views and any logic that might not properly initialise objects.


Solution

  • This error can be caused by incorrect use of the SPLITTER layout element. While the name might lead you to think that it can be used to seperate flowing elements across lines, it's actually a container element that splits its contents with a draggable separator.

    Either remove the splitter or add at least one element to it to prevent the null reference exception.