on 10-31-2014 1:19 PM
Hello All,
I am trying to create dynamic UI element for (PANEL) under root element container ( Please find the code below )
But it dumps saying " ERROR: Access using a 'ZERO' object reference is not possible. (termination: RABAX_STATE) "
in ST22 also i didnt get any clue..
But Instead of panel if i try to add Transperent container under rootelement container ( lo_tco TYPE REF TO cl_wd_transparent_container ) it works fine..
am i missing some thing mandatory for cl_wd_panel?
METHOD wddomodifyview.
DATA: lo_container TYPE REF TO cl_wd_uielement_container,
lo_matrix TYPE REF TO cl_wd_matrix_head_data,
lo_panel TYPE REF TO cl_wd_panel.
CHECK first_time = 'X'.
lo_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lo_panel = cl_wd_panel=>new_panel(
height = '50'
id = 'PANEL1'
title = 'Panel desc' ).
CLEAR : lo_matrix.
lo_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lo_panel ).
lo_panel->set_layout_data( lo_matrix ).
CALL METHOD lo_container->add_child
EXPORTING index = 1
the_child = lo_panel.
ENDMETHOD.
Hi,
You need to set the layout to the panel UI. Try the below code:
DATA: lo_container TYPE REF TO cl_wd_uielement_container,
lo_matrix TYPE REF TO cl_wd_matrix_head_data,
lo_panel TYPE REF TO cl_wd_panel.
CHECK first_time = 'X'.
lo_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lo_panel = cl_wd_panel=>new_panel(
height = '50'
id = 'PANEL1'
title = 'Panel desc' ).
CLEAR : lo_matrix.
lo_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lo_panel ).
lo_panel->set_layout_data( lo_matrix ).
cl_wd_matrix_layout=>new_matrix_layout( lo_panel ).
CALL METHOD lo_container->add_child
EXPORTING
index = 1
the_child = lo_panel.
hope this helps u,
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
No such mandatory parameters in the NEW_PANEL method, the error seems that some object reference your are trying to access is having NULL.
before accessing any object, check if its bound
if lo_panel is bound.
lo_panel->......
endif.
Share the details of st22 or your complete code to point to the right line.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.