cancel
Showing results for 
Search instead for 
Did you mean: 

Access via null value

Former Member
0 Kudos

hi

i have a ALV table display with 4-5 records,now the intial records is coming selected,but if i try tp select the other records of the ALV table,its giving me the dump of:

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

redgs

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

Check out the Selection Property of node binded to ALV .

Un-Tick the lead Selction Checkbox : No record will be selected by default.

Set the selection to 0..n so that you are able to select multple records.

Have you implemented Lead Selection event ? plz check that.

Former Member
0 Kudos

hi

i have done that,but same error again.

also i just need to select 1 record at 1 time so i have to keep selection 0-1.

my ALV table is displaying the data,with the last column as editable.so if i need am selection any other records its giving me error.

card:1.n

selection:0.1.

last 2 check box are tick.

pls reply how to resolve this.

Former Member
0 Kudos

You must have wrriten something because of which it is showing dump.

Please check the code you have written to make your last row editable.

Comment it and chck.

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Check if your element is holding any value or not.

i.e on lead select did u write any code.

if you have written any code

check the lo_el___.....is holding the reference of the selected element of ALV or not.

Regards,

Priya

Former Member
0 Kudos

Please paste your code...Have you checked in ST22 for error. Paste that.

What is the selection mode you have set to ALV(is it single/multi with lead or without). I guess this is causing the probelm.

Give the selection mode as SINGLE as you want the lead selection.

and check the initialization lead selection for that node.

Edited by: Lekha on Oct 28, 2009 1:49 PM

Former Member
0 Kudos

my code is as below:

this ALV table is in my sales tab_strip.

where i have req to put the multiple entries against a customer,for the partner function,so i had made a ALV table there & its editable.this ALV table is coming through the View container UI Element.

now in this View in modify view i have written the code,so fill the table with some data & make them editable as per as req.

METHOD wddomodifyview .

DATA lo_nd_partner_fn TYPE REF TO if_wd_context_node.

DATA lo_el_partner_fn TYPE REF TO if_wd_context_element.

DATA ls_partner_fn TYPE wd_this->element_partner_fn.

DATA: lines TYPE i.

DATA:lt_tkupa TYPE TABLE OF tkupa,

wa_tkupa TYPE tkupa,

lt_tpaer TYPE TABLE OF tpaer,

wa_tpaer TYPE tpaer,

lv_vtxt TYPE tpart-vtext.

TYPES:BEGIN OF lt_partner,

parvw TYPE knvp-parvw,

vtext TYPE tpart-vtext,

kunn2 TYPE knvp-kunn2,

END OF lt_partner.

DATA:lt_function TYPE TABLE OF lt_partner.

DATA:wa_function TYPE lt_partner,

lv_ktokd TYPE tkupa-ktokd,

lv_pargr TYPE tkupa-pargr.

CLEAR:lv_ktokd,lv_pargr,lines.

lv_ktokd = wd_comp_controller->lv_act_grp.

  • navigate from <CONTEXT> to <PARTNER_FN> via lead selection

lo_nd_partner_fn = wd_context->get_child_node( name = wd_this->wdctx_partner_fn ).

  • @TODO handle not set lead selection

IF lo_nd_partner_fn IS INITIAL.

ENDIF.

  • get element via lead selection

lo_el_partner_fn = lo_nd_partner_fn->get_element( ).

  • @TODO handle not set lead selection

IF lo_el_partner_fn IS INITIAL.

ENDIF.

  • alternative access via index

  • lo_el_partner_fn = lo_nd_partner_fn->get_element( index = 1 ).

  • @TODO handle non existant child

  • IF lo_el_partner_fn IS INITIAL.

  • ENDIF.

  • get all declared attributes

lo_el_partner_fn->get_static_attributes(

IMPORTING

static_attributes = ls_partner_fn ).

IF lv_ktokd IS NOT INITIAL.

IF ls_partner_fn IS INITIAL.

SELECT SINGLE pargr INTO lv_pargr FROM tkupa WHERE ktokd = lv_ktokd.

IF lv_pargr IS NOT INITIAL.

SELECT parvw INTO CORRESPONDING FIELDS OF TABLE lt_tpaer FROM tpaer

WHERE pargr = lv_pargr AND papfl = 'X'.

IF lt_tpaer[] IS NOT INITIAL.

CLEAR:wa_tpaer,wa_function.

LOOP AT lt_tpaer INTO wa_tpaer.

wa_function-parvw = wa_tpaer-parvw.

SELECT SINGLE vtext INTO wa_function-vtext FROM tpart

WHERE parvw = wa_tpaer-parvw AND spras = sy-langu.

APPEND wa_function TO lt_function.

CLEAR:wa_function.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

*************now there i have data in my lt_function table.

IF lt_function[] IS NOT INITIAL.

DESCRIBE TABLE lt_function LINES lines.

  • lo_nd_partner_fn = wd_context->get_child_node( name = `PARTNER_FN` ). -->binding with NODE.

  • lo_nd_partner_fn->bind_table( lt_function ).

***code for partner function alv .

DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

lo_cmp_usage = wd_this->wd_cpuse_partner_alv( ).

IF lo_cmp_usage->has_active_component( ) IS INITIAL.

lo_cmp_usage->create_component( ).

ENDIF.

DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .

lo_interfacecontroller = wd_this->wd_cpifc_partner_alv( ).

DATA lo_value TYPE REF TO cl_salv_wd_config_table.

lo_value = lo_interfacecontroller->get_model(

).

lo_value->if_salv_wd_table_settings~set_visible_row_count( lines ).

DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.

DATA: lr_column TYPE REF TO cl_salv_wd_column,

lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.

lr_column_settings ?= lo_value.

  • lr_column = lr_column_settings->get_column( 'PARVW' ).

  • CREATE OBJECT lr_input_field

  • EXPORTING

  • value_fieldname = 'PARVW'.

  • lr_column->set_cell_editor( lr_input_field ).

  • lr_column = lr_column_settings->get_column( 'VTEXT' ).

  • CREATE OBJECT lr_input_field

  • EXPORTING

  • value_fieldname = 'VTEXT'.

  • lr_column->set_cell_editor( lr_input_field ).

  • lr_column = lr_column_settings->get_column( 'KUNN2' ).

  • CREATE OBJECT lr_input_field

  • EXPORTING

  • value_fieldname = 'KUNN2'.

  • lr_column->set_cell_editor( lr_input_field ).

  • set read only mode to false (and display edit toolbar)

DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings.

lr_table_settings ?= lo_value.

lr_table_settings->set_read_only( abap_false ).

ENDIF.

ENDIF.

ENDMETHOD.

now currently i have make all the fileds as non editable,but still on selection its giving dump.

in context controller:node for partner

card:1.n

selectio:0.1

check:selectivity-tick

singleton-tick

pls tell me also how to make ALV as single selection,is there any other way to do that.i m not aware of it.

Edited by: Vipin on Oct 28, 2009 2:17 PM

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ,

What is the error in ST22 and where does it show error when you click on ABAP editor.

Regards,

Priya

Former Member
0 Kudos

hi all

i got this eror fixed,it was coming due to a action on tab strib,where i was validation the mandatory fields,are they initial or not.

but with this,my validation of mandatory fields is not working now,as i have commented the code.

the code which i commented to make ALV working.

  • DATA l_view_controller TYPE REF TO if_wd_view_controller.

  • DATA l_action TYPE REF TO if_wd_action.

*

  • l_view_controller = wd_this->wd_get_api( ).

  • l_action = l_view_controller->get_current_action( ).

  • CHECK l_action->name = 'TAB_STRIP'.--------------->>>ERROR

  • cl_wd_dynamic_tool=>check_mandatory_attr_on_view( view_controller = l_view_controller ).

now i have 3 tabs,on 1 tab i had added a ALV table,working fine,but now on 2 tab i have to add 2 ALV table,which are coming through binding the ALV through 2 respective views,where earlier,on 1 tab only 1 tab can be binded easily,without any error,if more than 2,its was creating the problem.

so i made it in 2 diff views & binded,but now as i am having the mandatory check on initial views,it doesn't work when i start working on ALV,as it on diff view & thus gives the dump.

pls tell how to resolve this error.

now my req which left is to validate the mandatory fields,as they shdn't be blank.

Former Member
0 Kudos

Hi,

Why are you calling other views inside TABSTRIP.

In the current view itself, have 2 ALV usages and create the Viewcontainer(VCU) elements inside the tab strip.

embed the views of ALV table inside these VCU.

What is the screen sequesnce, Where are these mandatory fields.

Can you be more clear in your design.