Skip to Content
avatar image
Former Member

Shopping Cart column - Custom field - mandatory - dump

Dear All,

I am working in SRM 7.0.

As per the clients requirement i have added a column to the item and made that field as mandatory by making the 'status' as 'REQUIRED' and writing the code in 'WDDOBEFOREACTION' method. With this the column has been made MANDATORY and working fine with the 'EMPLOYEE-SELF-SERVICE' tab shopping cart.

The shopping cart in the 'PURCHASING' tab is giving short dump and the short dump is as mentioned below...

OBJECTS_OBJREF_NOT_ASSIGNED_NO

Access via 'NULL' object reference not possible.

Method: GET_CTXT_ELEMENTS_TO_CHECK of program CL_WD_DYNAMIC_TOOL============CP

Method: CHECK_MANDATORY_ATTR_ON_VIEW of program CL_WD_DYNAMIC_TOOL============CP

Method: WDDOBEFOREACTION of program /1BCWDY/IU0RHDVCLMQ4J466CPJC==CP

Method: IF_WDR_VIEW_DELEGATE~WD_DO_BEFORE_ACTION of program /1BCWDY/IU0RHDVCLMQ4J466CPJC==CP

Method: DO_BEFORE_ACTION of program CL_WDR_DELEGATING_VIEW========CP

Method: BEFORE_ACTION of program CL_WDR_VIEW===================CP

Method: DO_BEFORE_ACTION of program CL_WDR_CLIENT_COMPONENT=======CP

Method: DO_BEFORE_ACTION of program CL_WDR_CLIENT_COMPONENT=======CP

Method: DO_BEFORE_ACTION of program CL_WDR_CLIENT_COMPONENT=======CP

Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP

plz help me in this...

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jul 22, 2009 at 09:19 AM

    Hi Kishore,

    It would be hard to advise anything with this vague understanding of your scenario. Try going to ST22 & check as to where this NULL object reference exception is arising from. May be that can give you a lead as to where things are going wrong. You can then even try paste that part in here or may be give further details of your requirement so that we might guess as to what might be the pitfall.

    Regards,

    Uday

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 22, 2009 at 10:38 AM

    Hi Uday,

    the following is the method where the NULL point is occuring. The dump is occuring 364th line of the method and as shown in below

    
     method get_ctxt_elements_to_check.
    *        importing mandatory_element          type cl_wd_dynamic_tool=>t_ext_check_mandatory
    *                  context_root               type ref to if_wd_context_node
    *                  context_node               type ref to if_wd_context_node
    *                  node_path                  type string
    *                  attribute_name             type string
    *        returning value(context_element_set) type wdr_context_element_set,
    
        constants: c_visible_bool                 type string value abap_true.
        constants: c_visible_enum                 type string value cl_wd_uielement=>e_visible-visible.
    
        data l_attribute_name                   type string.
        data l_node_path                        type string.
        data l_context_node                     type ref to if_wd_context_node.
        data l_context_element                  type ref to if_wd_context_element.
        data l_context_element_path             type string.
        data l_context_element_set              type wdr_context_element_set.
        data l_string                           type string.
        data l_bool                             type wdy_boolean.
        data l_string_tab                       type string_table.
        data l_node_name                        type string.
        data l_child_node                       type ref to if_wd_context_node.
        data l_last_index                       type i.
        data l_context_element_index            type i.
    
        if mandatory_element-context_element_index = 0.             "multiple...
          if mandatory_element-binding_path is initial.
            context_element_set = context_node->get_elements( ).
          else.
            context_element_set = lcl_mandatory_check=>get_context_element_set(
              context_node             = context_root
              mandatory_attribute_path = mandatory_element-binding_path ).
          endif.
          "check visibility:
          if mandatory_element-visible_path is not initial.
            l_context_element_set = context_element_set.
            clear context_element_set.
            get_node_and_attribute(
              exporting whole_path   = mandatory_element-visible_path
              importing
                node_path             = l_node_path
                attribute_name        = l_attribute_name ).
            if l_node_path = node_path.
              " attribute is in same node...
              loop at l_context_element_set into l_context_element.
                l_context_element->get_attribute(
                  exporting name = l_attribute_name
                  importing value = l_string ).
                if l_string = c_visible_bool or
                   l_string = c_visible_enum.
                  insert l_context_element into table context_element_set.
                endif.
                clear l_string.
              endloop.
            elseif node_path cs l_node_path.
              "attribute is in subnode
              replace node_path in l_node_path with ''.
              replace first occurrence of '.' in l_node_path with ''.
              split l_node_path at '.' into table l_string_tab.
              loop at l_context_element_set into l_context_element.
                read table l_string_tab into l_node_name index 1.
                l_child_node = l_context_element->get_child_node( l_node_name ).
                loop at l_string_tab into l_node_name from 2.
                  l_child_node = l_child_node->get_child_node( l_node_name ).
                endloop.
                l_child_node->get_attribute(
                  exporting name = l_attribute_name
                  importing value = l_string ).
                if l_string = c_visible_bool or
                   l_string = c_visible_enum.
                  insert lines of l_context_element_set into table context_element_set.
                endif.
                clear: l_string, l_child_node.
              endloop.
            else.
              "attribute is neither in subnode nor in same node
              l_child_node = context_root->path_get_node( l_node_path ).
    
              

    l_child_node->get_attribute(

    exporting name = l_attribute_name

    importing value = l_string ).

    if l_string = c_visible_bool or

    l_string = c_visible_enum.

    insert lines of l_context_element_set into table context_element_set.

    endif.

    clear: l_string.

    endif.

    endif.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 22, 2009 at 10:41 AM

    the method is

    method get_ctxt_elements_to_check.

    "attribute is neither in subnode nor in same node

    l_child_node = context_root->path_get_node( l_node_path ).

    on line 364 i am getting the NULL point exception.

    >>> l_child_node->get_attribute(

    exporting name = l_attribute_name

    importing value = l_string ).

    Add comment
    10|10000 characters needed characters exceeded