on 02-02-2009 5:52 PM
hi gurus,
i have created a table and using select statement i was able to retrieve the data.the problem iam facing is ..when i run the application and give a value for a field and clicked on the button i was able to see only one record in the web dynpro table..actually the database table contains 10 records and i was able to see only one record,i didnt give any where condition in the select statement,i have changed the cardinality property of the node to 0..n and the sys was throwing error and if i put 0..1 or 1..1 it was running fine..
Please give me your valuable inputs for solving this...
Thanks in advance
Regards
ravi
Well you can't have the context set to x:1 and expect more than record to show up. You have specified that you are restricted to just one record with that context setting. So the root question is what is the source of the error when it was set to x:n - since that is the setting you will need. We would have to know more about the rest of your coding and application to be able to comment. Perhaps you code to bind your ABAP internal table was not correct? Were you using BIND_TABLE? What exactly was the error you were getting and were did it occur? Do you have any other UI elements bound to the same context node?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi thomas,
i application iam working on is a basic applcation , retreiving the database table contents to a table in webdynpro.I have written a Select statemtn on a button..I have 2 context nodes,
first node contains the input field for entering value...assume Input1
second node contains the table fields to be filled...
when i gave the where for input1 case in select stament i wa able to see only one record though i have multiple records for tht value in the database table..
I have changed the cardinality for the nodes 1..n and still getting only one row..
Regars
Ravi
hi David ,
thanks for the reply...
this is the select statement code iam using ..
data: it_csunit type /BI0/PCS_UNIT.
select * from /BI0/PCS_UNIT into it_csunit.
ls_n2-Cs_unit = it_csunit-Cs_unit.
ls_n2-Company = it_csunit-Company.
ls_n2-Cons_ba = it_csunit-Cons_ba.
ls_n2-Country = it_csunit-Country.
ls_n2-Co_area = it_csunit-Co_area.
endselect.
CALL METHOD LO_ND_N2->SET_STATIC_ATTRIBUTES
EXPORTING
INDEX = USE_LEAD_SELECTION
STATIC_ATTRIBUTES = ls_n2.
Regards
ravi
Hello,
In your code you're moving only one record to the table (from the work area ls_n2), I suggest you the following:
DATA: it_csunit TYPE STANDARD TABLE OF /BI0/PCS_UNIT,
lo_nd_n2 TYPE REF TO if_wd_context_node.
SELECT * FROM /BI0/PCS_UNIT INTO TABLE it_csunit.
IF it_csunit IS NOT INITIAL.
* GET THE REFERENCE TO THE NODE - SOMETHING LIKE
* lo_nd_n2 = wd_context->get_child_node(name = wd_this->wdctx_nd_n2).
* Bind the data to the node
lo_nd_n2->bind_table( it_csunit).
ENDIF.
Regards.
You aren't appending ls_n2 to anything and you are only calling the SET_STATIC_ATTRIBUTES once outside the loop. So you are only processing one record.
Instead, just read all the records at once into an interal table using SELECT * FROM <TABLE> into table <itab>.
Then you just use the node->BIND_TABLE API to set all the data into the contect at once. It is much easier.
data isflight type standard table of sflight.
select * from sflight into table isflight.
data lo_r_sflight type ref to if_wd_context_node.
lo_r_sflight = wd_context->get_child_node( wd_this->wdctx_sflight ).
lo_r_sflight->bind_table( isflight ).
Are you sure you have the cardinality of the node set correctly to 0:n? The assert condition is usually do to an incorrect violation of the cardinality settings. If that isn't the problem, look at the short dump and see where the assert condition was triggered from. We will need to know more details than just that you got an Assertion error.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.