on 07-29-2008 4:02 PM
Hello Web Dynpro experts,
Could you kindly help me to show a table with empty content.
I am showing content of an internal table in WebDynpro and in case this internal table is initial I am getting an exception.
What is the correct way to handle such situation. In other words in case the internal table to be shown is empty-> what is the correct way to show empty table and avoid exception?
Thank you in advance and best regards
Andrey
If internal table has no data empty tablw will display.I think you are not binding the internal table properly.
check this code.
DATA:
node_flights TYPE REF TO if_wd_context_node,
it_flights type table of sflight.
* navigate from <CONTEXT> to <FLIGHTS> via lead selection
node_flights = wd_context->get_child_node( name = 'FLIGHTS' ).
* Get Flights data
select * from sflight into table it_flights up to 20 rows.
* Now Bind Internal table to Context.
node_flights->bind_table(
new_items = it_flights
SET_INITIAL_ELEMENTS = ABAP_TRUE
).
Thanks
Suman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems the cardinality of node with which you are binding is 1..N. Make it 0..N and then Check
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrey,
In most case, when you try to set lead selection when there is no record - exception will raise.
One way to avoid is always check for
if not <element> is initial.
<ur code>
endif.
I hope u r getting null object reference exception.
If so above soultion will resolve ur problem.
If not send the error details.
Thanks...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.