on 04-09-2013 11:03 AM
Hi Guys,
I got a requirement on Dynamic programming in webdynpro.
My requirement is-> online exam pattern and its like the following:
1. Question number - 1
2. Question number - 2
3. Question number - 3
4. Question number - 4
and so on....
All the records retrieving from the database tables. I have created a one questions related table.
To display as above...I went to dynamic programming in webdynpro.
I'm fetching the table and displaying the User Interface using with TextView UI element along with the displaying the Radio Buttons also. But it is not
displaying as I have shown above. It is displaying as below.
1. Question number - 1
2. Question number - 2
3. Question number - 3
4. Question number - 4
and so on......
But I want to display as starting shown manner.
and this is my code which I have used to implement the above please check following code:
data : lr_textview type ref to cl_wd_text_view.
Data:lr_container type ref to cl_wd_uielement_container.
DATA: LR_RADIOBUTTON1 type ref to CL_WD_RADIOBUTTON.
data lr_matrix type ref to cl_wd_matrix_head_data.
data:
Node_Ques type ref to If_Wd_Context_Node,
Elem_Ques type ref to If_Wd_Context_Element,
Stru_Ques type If_Main_View=>Element_Ques ,
it_ques TYPE If_Main_View=>Elements_Ques .
Node_Ques = wd_Context->get_Child_Node( Name = IF_MAIN_VIEW=>wdctx_Ques ).
select * FROM ZQUESTIONS_TBL INTO CORRESPONDING FIELDS OF TABLE it_ques.
LOOP AT it_ques INTO Stru_Ques .
lr_textview = cl_wd_text_view=>new_text_view( view = view
text = Stru_Ques-QNAME ) .
lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_textview ).
lr_textview->set_layout_data( lr_matrix ).
CALL METHOD lr_container->add_child
EXPORTING
index = 1
the_child = lr_textview.
DO 4 TIMES.
CALL METHOD cl_wd_radiobutton=>new_radiobutton
EXPORTING
* BIND_KEY_TO_SELECT = 'SFLIGHT.CONNID '
bind_selected_key = 'SFLIGHT.CONNID '
* BIND_TEXT = 'SFLIGHT.QID'
receiving
control = LR_RADIOBUTTON1.
lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( LR_RADIOBUTTON1 ).
LR_CONTAINER->ADD_CHILD( LR_RADIOBUTTON1 ).
ENDDO.
ENDLOOP.
Please let me give me a way to reach my target. Looking forward your answers.
Thanks and Regards
Venkatesh
Hi Venkatesh,
Try to use row repeater. That will be more suitable for this kind of layout.
http://wiki.sdn.sap.com/wiki/display/WDABAP/steps+to+create+row+repeater+ui+element
-Manish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manish,
I'm so happy to receive answer from you and its very helpful.
you have given URL its fine to display all the records which is getting from the database table.
What about the "Radio Buttons"?. Each and every row repeater I must require Four Radio Buttons.
Please show a path to reach my target and looking for your answer.
Thanks and Regards
Venkatesh
Hi Venkatesh,
Check out this link, its something similar to your requirement.
http://scn.sap.com/docs/DOC-27866
-Manish
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.