cancel
Showing results for 
Search instead for 
Did you mean: 

NULL reference dump?

former_member194142
Participant
0 Kudos

Hello

I have a view say, my_view, it has a node say, my_node, it has 2 attributed, say, attr_1 and attr_2

I have put the TimedTrigger UI elements on my_view, but every time for this triggering of TimedTrigger my data is loosing/refreshing, hence by SDN experts suggestion, i am trying to change the cursor FOCUS onto a dummy filed, so, i wrote the below code

Tree str. of context is as below

MY_NODE

     | --- ATTR_1

     |

     | --- ATTR_1

* Set focus on dummy fld
  DATA: lr_if_wd_view TYPE REF TO if_wd_view.
  DATA: lr_elem TYPE REF TO if_wd_view_element.

  lr_elem = lr_if_wd_view->get_element( 'ATTR_2' ). " its a Dummy fld meant for just set the focus so that i will retain my user entered data on the "screen


  IF lr_elem IS BOUND.
    lr_if_wd_view->request_focus_on_view_elem( lr_elem ).
  ENDIF.

But, am getting NULL reference short dump, pls. correct the code pls?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The dump may be coming because You have not initialized LR_IF_WD_VIEW anywhere.

If the code is in WDDOMODIFYVIEW method, add one statement.

LR_IF_WD_VIEW = VIEW.

former_member194142
Participant
0 Kudos

Thank you.

My code is in the action event of TimedTrigger, say DO_POPUP_MESSGAE_ON_TIMED_TRIGGER,

this action event popup a message for timeTrigger fires

Pls. let me jknoe i hv to put the same in WDDOINIT as well?

LR_IF_WD_VIEW = VIEW.

Former Member
0 Kudos

To write this statement you first need the reference of the view you are currently on i.e. VIEW which is only available in WDDOMODIFYVIEW Method.

Since you need to write the code in your action handler follow the steps.

1. Go to 'Attributes' tab of Component Controller.

2. Declare a variable LO_VIEW of type Ref to IF_WD_VIEW ( Check both the checkboxes there )

3. Go to your view VIEW1

4. Go to WDDOMODIFYVIEW method of VIEW1

5. Write the code: WD_COMP_CONTROLLER->LO_VIEW = VIEW

6. Go to your action handler method DO_POPUP_MESSGAE_ON_TIMED_TRIGGER in VIEW1.

7. Write code:

LR_IF_WD_VIEW = WD_COMP_CONTROLLER->LO_VIEW.

lr_elem = lr_if_wd_view->get_element( 'ATTR_2' ).

.... and your entire code


If you are unclear on what you are doing or why you are doing this, post back.

Hope this helps.

former_member194142
Participant
0 Kudos

When you get a chance, pls. respond to my other thread,

http://scn.sap.com/thread/3213740

Thank you

Answers (0)