on 03-07-2012 11:33 AM
Hi i am a java developer hence find wd-abap and simple abap a little challenging,
i have a table 'Lang' with 2 fields 'Code' and 'Text '
My FM returns me a internal table IT_Employee with only CODE to which i mapped the UI,
to get the text for this code i have to get it via.....below..provosion.
My FM also returns me a internal table IT_LANG which has all the Code and Text in it ,
How can i code so that when i clcik on the UI (inputbox/dropdown) it must give me both Code and text or atleast text?
Hi Jack,
Create an input field and bind an string attribute to it.then in wddoinint write the below code, then two fields will dispaly if you clck on F4
DATA: node_info TYPE REF TO if_wd_context_node_info.
node_info = wd_context->get_node_info( ).
node_info = node_info->get_child_node('NODENAME').
DATA: lt_valueset TYPE wdr_context_attr_value_list,
l_value TYPE wdr_context_attr_value.
l_value-value = '30'.
l_value-text = 'Casual Leave'.
INSERT l_value INTO TABLE lt_valueset.
l_value-value = '10'.
l_value-text = ' Priviliged Leave'.
INSERT l_value INTO TABLE lt_valueset.
node_info->set_attribute_value_set( name = 'ATTRIBUTENAME' value_set = lt_valueset ).
NOW INPUTFILED WILL GET 10 Privilged leave
30 casual leave
It works only for input field not for dropdown
Regards
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jack,
I doubt about the feasibility of displaying two fields in Drop Down By Index.
However, instead of CODE, if you want to display TEXT only, then, it can be achived - while binding (TEXTS property of DropDownBy Index) use TEXT instead of CODE
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Steps (to replicate the scenario):
1) I have created a database table using SE11 transaction. Table fields: NAME - CHAR20 and SURNAME - CHAR20
2) SE80 -> Create webdynpro component -> WINDOW1, VIEW1
3) Go to COMPONENT CONTROLLER -> Context tab -> Right click on CONTEXT -> Create NODE (ITAB) (Cardinality 0..N, Selection 0..1)
4) Dictionary structure <table name> -> Click on ADD ATTRIBUTE FROM STRUCTURE -> Select NAME and SURNAME and click on OK
5) Create SUPPLY FUNCTION -> In supply function, use code wizard -> Select NODE/ ATTRIBUTE as ITAB -> READ option -> click ON
6) Write following code:
DATA ttab TYPE TABLE OF zaj_emp. "Enter your table name here
SELECT * FROM zaj_emp INTO TABLE ttab.
lo_nd_itab->bind_table( ttab ).
7) Go to VIEW1 -> CONTEXT tab -> drag and drop ITAB from CONTEXT COMPONENT CONTROLLER side to CONTEXT VIEW1 side to maintain Context Mapping
😎 View1 -> Layout tab -> drag and drop DROP_DOWN_BY_INDEX -> go to TEXTS property and maintain the binding with NAME or SURNAME (as per your requirement)
Hope it helps!
Hi,
Try with this;
[Using Drop Down By Index in Table UI Element in WebDynpro ABAP|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c03227f9-e48f-2c10-4bad-8ebdec704f3d?QuickLink=index&overridelayout=true&45290430176506]
Or this:
http://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynproforABAPCellVariants
Regards,
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.