on 03-24-2008 9:02 AM
Gudday,
I have table with some entries in my WDA application.
When the table is empty n when i press edit button it is throwing dump..access via 'NULL' object reference not possible .....
Instead of that i want to display message.
Can anyone help me to proceed further.....
Awaiting your reply.
Thanks,
Deepthi.
Hi Deepthi,
Probably you are trying to get the reference of the table element by using get_element method and now that the table is empty it is not instantiated.
Exit the code when the node or the element is initia.
Assume that the table is bound to node table then if the context node or the element is initial throw the message accordingly and exit the application.
navigate from <CONTEXT> to <table> via lead selection
node_table = wd_context->get_child_node( name = if_action_list=>wdctx_<table> ).
handle not set lead selection
IF ( node_table IS INITIAL ).
" Message
EXIT.
ENDIF.
get element via lead selection
elem_action_list = node_action_list->get_element( ).
handle not set lead selection
IF ( elem_table IS INITIAL ).
"message
EXIT.
ENDIF.
get all declared attributes
elem_table->get_static_attributes(
IMPORTING
static_attributes = stru_table ).
Hope this helps,
Regards,
Sravan Varagani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Inside theMethod for Edit,first check whether the Table is initial.
Eg.,
DATA lo_nd_table TYPE REF TO if_wd_context_node.
DATA lo_el_table TYPE REF TO if_wd_context_element.
DATA lt_table TYPE wd_this->elements_table.
DATA ls_table TYPE wd_this->element_table.
lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
* get all declared attributes
lo_nd_table->get_static_attributes_table(
IMPORTING
table = lt_project ).
if lt_project[] is initial.
* get message manager
data lo_api_controller type ref to if_wd_controller.
data lo_message_manager type ref to if_wd_message_manager.
lo_api_controller ?= wd_This->Wd_Get_Api( ).
CALL METHOD lo_api_controller->GET_MESSAGE_MANAGER
RECEIVING
MESSAGE_MANAGER = lo_message_manager
.
* report message
CALL METHOD lo_message_manager->REPORT_ERROR_MESSAGE
EXPORTING
MESSAGE_TEXT = 'The Table has no Values' .
endif.
Regards,
Padmam.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.