Skip to Content
avatar image
Former Member

ST22: OBJECTS_OBJREF_NOT_ASSIGNED

Hi SDN, can somebody give me a clue about this ST22 dump:

Coding OnInputProcessing:

DATA: event TYPE REF TO cl_htmlb_event.
DATA: data_t TYPE REF TO cl_htmlb_inputfield.

event = cl_htmlb_manager=>get_event( runtime->server->request ).

IF event->id = 'BZUR' AND event->event_type = 'click'.

Coding im Layout:

      <htmlb:form method="post" >
        <htmlb:button id      = "BZUR"
                      onClick = "clicked"
                      text    = "zurück"></htmlb:button>

I thought this is the way to make things work safely - still sometimes I get this short dump:

     1 method _ONINPUTPROCESSING.                                         
     2 * event handler for checking and processing user input and         
     3 * for defining navigation                                          
     4                                                                    
     5 DATA: event TYPE REF TO cl_htmlb_event.                            
     6 DATA: data_t TYPE REF TO cl_htmlb_inputfield.                      
     7                                                                    
     8 event = cl_htmlb_manager=>get_event( runtime->server->request ).   
     9                                                                    
 >>>>> IF event->id = 'BZUR' AND event->event_type = 'click'.             
    11                                                                    
    12 * HOOK_URL ist befüllt und muss nicht erst neu geholt werden       
    13   data_t ?= cl_htmlb_manager=>get_data(                            
    14                               request = runtime->server->request   
    15                               name     = 'inputField'              
    16                               id       = 'I01'                     
    17                               ).                                   
    18   IF NOT data_t IS INITIAL.                                        
    19     hook_url = data_t->value.                                      
    20   ENDIF.                                                           
    21                                                                    
    22   navigation->set_parameter( name = 'HOOK_URL' value = hook_url ). 
    23   navigation->goto_page( url = 'start.htm' ).                      
    24 ENDIF.                                                             

The dump does not occur regularly only seldom randomly.

regards, matthias

ps: this is WAS 700

SAP_ABA 700 0010 SAPKA70010

SAP_BASI 700 0010 SAPKB70010

pps: I did some more testing and noticed taht this dump occurs when hitting the submit Button, which is not htmlb but mere html with some css formats:

<input type="submit" name="onInputProcessing(go)"
                       value="an EVI senden" style="border: solid 1px black;
                       background-color: #C1D3E0; color: #000000; font-size: 11px;">

Message was edited by:

Matthias Kasig

Message was edited by:

Matthias Kasig

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 20, 2007 at 08:05 AM

    Hi Matthias,

    I guess as in your case the form is not submitted by the respective JavaScript libraries of HTMLB that some hidden inputfields that contain more information about the type of the event are not filled and therefor the event-manager cannot create the event. To circumvent the dump you can just check whether the event is bound.

    if event is bound and .....

    In case the event is not bound (could not been instantiated) the rest of the if-clause will not be checked.

    The better option from my point of view is to proceed as follows:

    Use the bsp-tag htmlbEvent on the layout to get the javascript for executing an event generated:

    <bsp:htmlbEvent  event_code = "<%=lv_event%>"
                     event_type = "MyEventType"
                     id         = "SubmitMyEvent"
                     name       = "SubmitMyEvent"/>

    If you place this within your layout the variable lv_event contains the javascript that is required to trigger the event. If you put this coding into you Button as onClick:

    <input type="BUTTON" value="Submit" onClick="<%=lv_event%>">
    

    Then you should be able to handle the event in the onInputprocessing by:

     DATA: event TYPE REF TO IF_HTMLB_DATA.
    
     event = cl_htmlb_manager=>get_event_ex( runtime->server->request ).

    Now you can find your Id's in the attributes of the interface reference. In case you use standard htmlb-elements to trigger the form submit (e.g. checkbox or dropdown) you can use the following to distinguish what element has fired the event:

    CASE event->event_name.
      WHEN htmlb_events=>checkbox.
      "Checkbox was clicked
      WHEN .......
      "Some other events
    ENDCASE.
    

    The constants for the htlmb-events are available in class htmlb_events, the ones for phtmlb in phtmlb_events and the ones for xhtmlb in xhtmlb_events.

    Hope that helps.

    Best Regards

    Michael

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 08:08 AM

    Hi,

    I noticed, that according to Tomas Jung I had tried to use an old odd way to call ABAP methods from html-submit. For those interested: It's in thread:

    assign-javascript-variable-to-abap-variable-not-us

    the name of my submit-button is "onInputProcessing(go)", but I don't do an input processing - in fact for various reasons I just send the form using normal html submit, but I had this odd name. Now I have changed the name to something neutral like name1. It seemed that, the odd name triggered the event onINputProcessing and got stuck in:

    event = cl_htmlb_manager=>get_event( runtime->server->request ).
    
    IF event->id = 'BZUR' AND event->event_type = 'click'.
    

    Still I don't know why the event = .... line does not work then.

    regards, matthias

    Add comment
    10|10000 characters needed characters exceeded