Skip to Content
0
Former Member
Mar 06, 2012 at 08:12 AM

Null reference error

68 Views

Hi Experts,

I'm an ABAPER and new to CRM Web UI working on developing a z-bsp-component. I need to trigger a pop-up window to show an alert message to the user who submits a request if some information is not available. I succeeded in achieving this one as a 'INFORMATION' message in the view, but couldn't trigger a new pop-up window as i end up with "access null reference error". This is the code i tried in the view attribute level get-method.

IF VALUE IS NOT INITIAL.

***

  • Data: lr_confirm_popup TYPE REF TO if_bsp_wd_popup,*

  • lr_comp_controller TYPE REF TO CL_BSP_WD_COMPONENT_CONTROLLER,*

  • lr_wd_ctrl TYPE REF TO CL_BSP_WD_CONTROLLER.*

***

  • IF lr_confirm_popup IS NOT BOUND.*

  • CALL METHOD lr_comp_controller->window_manager->create_popup_2_confirm*

  • EXPORTING*

  • iv_title = 'Window Title Here'*

  • iv_text = 'Message Text Here'*

  • iv_btncombination = if_bsp_wd_window_manager=>co_btncomb_ok "OK Button*

  • RECEIVING*

  • rv_result = lr_confirm_popup.*

***

  • lr_confirm_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ).*

  • lr_confirm_popup->set_on_close_event( iv_event_name = 'POPUP_CLOSED' iv_view = lr_wd_ctrl ).*

  • ENDIF.*

  • lr_confirm_popup->open( ).*

***

*ENDIF.

The error message is as follows:

Error when processing your request

Note

The following error text was processed in the system DCR : Access via 'NULL' object reference not possible.

The error occurred on the application server dcr_DCR_02 and in the work process 1 .

The termination type was: RABAX_STATE

The ABAP call stack was:

Method: GET_AREA of program ZL_ZHMS_CRM_TABVIEW_CN00======CP

Method: IF_BSP_MODEL_BINDING~GET_ATTRIBUTE of program CL_BSP_MODEL==================CP

Method: RESOLVE_MODEL_BINDING of program CL_THTMLB_INPUTFIELD==========CP

Method: IF_BSP_ELEMENT~DO_AT_BEGINNING of program CL_THTMLB_INPUTFIELD==========CP

Please advise me on fixing this error.

Thanks and Regards,

Arun V.

Edited by: Arunmozhi_06 on Mar 6, 2012 9:15 AM