Drop Down in webDynpro.
Hi experts ,
I wana get help on drop down. I have got an internal table which has all the company code related to the user who has loged in UI. I want to display that internal table as drop down. Please provide me a solution .
Hi Madhvi,
I understand that you have an internal table which has the company codes. There are two scenarios here.
Scenario 1
You have only one field in the internal table, i.e., company code.
Here you can make use of the WebDynpro UI element DropDownByIndex. Here you will have to define a node in the context of cardinality 0:n, and an attribute of the type similar to the company code.
Once you have done that, insert the DropDownByIndex element in the Layout, then bind the texts property of the same to the attribute (company code).
Now the coding.
Declare a supply function for the node. Write the code for binding the value in the internal table into the node.
Here, you will get the company codes as a drop down.
Scenario 2
You have only two fields in the internal table, i.e., company code and company code description
And you want to display the description in the dropdown but use the code for processing in the background.
In this particular scenario, you can make use of the DropDownByKey UI element. The dropdown node will have two attributes, one for the company code and the other for the description.
The company code attribute will be bound to the key property of the UI element. Here again, its advisable to use a supply funciton.
Coding:
Declare a workarea of type wdy_key_value, say, wa_key_value and an internal table of type wdy_key_value_table, say, lt_key_value_table.
Assuming the internal table of the company code is lt_company_code, <fs_compay_code> the workarea and the fields are comp_code and comp_desc, comp_code being the company code and comp_desc being the company code description.
node is the reference of the drop down node.
DATA: lt_key_value_table TYPE wdy_key_value_table,
lt_company_code TYPE (table_type of comany code with the above mentioned fields).
DATA: wa_key_value TYPE wdy_key_value.
FIELD-SYMBOLS: <fs_compay_code> TYPE (structure of company code with the above mentioned fields).
LOOP AT lt_company_code ASSIGNING <fs_compay_code>.
wa_key_value-key = <fs_compay_code>-comp_code.
wa_key_value = <fs_compay_code>-comp_desc.
APPEND wa_key_value to lt_key_value_table .
CLEAR wa_key_value.
ENDLOOP.
node->set_attribute_value_set( name = 'KEY'
value_set = lt_key_value_table ).
Similar Messages
-
Subject: Drop Down By index Vs Key
Question: I have domain with Fixed value and i want the drop down in webdynpro screen to pick the domain value automatically
what type of drop down should be used and can you differentiate the two types
kindly replyHi,
You should use drop down by key in order to select the domain value automatically.
Map your contxt attribute as a selected key property of the UI element property.
Diff. b/w the two avalable types:
For drop Down by index, You need to build the value table to the node intially and an intial value will be space by default.
For drop Down by key: you have val-nam pair i.e if you can decide to display domain value or description.
Hope this may be helpful.
Thank you
Depeshl -
WDJ - Native Adobe Form - formating of drop-down box
Hi all,
I have an Adobe Form in WDJ that was created by other consultants some months ago. Its display type is Native, but it has input fields and some static drop-downs that are ActiveX controls. I had to get the dynamic drop-downs working and I was able to do that using the Drop-down from WebDynpro Native group. My problem now is that the WebDynpro Native Drop-down has a thick line around the input / selection box and I am unable to change that other than to remove any box. Even using a custom appearance and specifying the thickness of the lines does not change that.
Also now any box I add, even the ActiveX ones have a thick line around the box.
Any thoughts/
Thanks,
ElizabethHey Elizabeth,
So, you must be using ALD 7.1 then. There is a patch 2 out for the ALD that might help to resolve this problem...
[Note 965548 - Adobe LiveCycle Designer 7.1 Patch|https://service.sap.com/sap/support/notes/965548]
Give that a shot...
Cheers,
Kevin -
OnSelect event for a Drop down UI Element in Webdynpro ABAP Select Options
Hi Experts
We have built our UI based on the webdynpro ABAP Select Options. We have a requirement that, when we change the value of a drop down box in the UI, I need to hide some fields. Can anybody help me out in handling of OnSelect event of a drop down box built using webdynpro ABAP Select Options. We are on SAP Netweaver 7.0 EHP1.
Rrgards,
Srikanth.
Edited by: Srikanth Kancherla on Apr 29, 2010 10:43 PMHi Srikanth,
as you seem to be already aware, the component is dynamically built.
so you would have to enhance the code that builds the element and insert a reference to a new action (enhancement) that could handle the onSelect event.
What is it about this that you particularly want help with?
Cheers,
Chris -
How can I add values on a Drop Down by Index Webdynpro Element?
Hi every body
Can anybody help me?
How can I add values on a Drop Down by Index Webdynpro Element?
How can I invoque my element on the Implementation Webdynpro?Hi Jesus,
You can add elements to your DDbyIndex like this:
//Example: Popular un Dropdown by Index usando Nodos de contexto
// NODE[Card: 1..n, Sele:1..1] Si es obligatorio; || NODE[Card: 0..n, Sele:0..1] Si no es obligatorio y se puede dejar en blanco
//Assuming we created a node called "Source", with a string attribute called "Texto" binded to the dropdownbyindex
for (int i = 1; i <= 101; i++)
ISourceElement sourceElement = wdContext.createSourceElement();
sourceElement.setTexto("Text number "+i);
wdContext.nodeSource().addElement(sourceElement);
Regards.
Julio Herrera -
How can I add values on a Drop Down by Index Webdynpro Element by a Model?
How can I add values on a Drop Down by Index Webdynpro Element with a Model RFC?
Hi Jesus,
Please use the below code for DropDownByIndex Elements :-
Suppose you have model node ABC and attribute xyz. Now you have created custom node CustNode and attribute CustAtt.
ICustNodeElement ele = null;
if(wdContext.nodeABC().size > 0)
for(int i=0; i< CustNode< wdContext.nodeABC().size; i++
ele = wdContext. createCustNode();
ele.setCustAtt(wdContext.nodeABC().getABCElementAt(i).getXYZ)
wdContext.nodeCustNode.add(ele);
Refer to http://help.sap.com/saphelp_nw70/helpdata/en/3b/f1754276e4c153e10000000a1550b0/frameset.htm
Best Regards
Arun Jaiswal -
Webdynpro " How to add values in Drop down list By Key"
Hi experts ,
i want to create a drop down list by key, i don't know how to assign values to it ( i.e. add list entries ) . Please help me on this ..
With regards ,
James..
Valuable answers will be rewarded ....Hi,
To fix values to the drop down key at runtime in the webdynpro application you can use the following code:
DATA:
lr_node_flightinfo TYPE REF TO if_wd_context_node,
lr_nodeinfo_flightinfo TYPE REF TO if_wd_context_node_info,
l_scarr type scarr,
lt_value_set TYPE TABLE OF wdr_context_attr_value,
lw_value_set like line of lt_value_set.
get nodeinfo of node flightinfo
lr_node_flightinfo = wd_context->get_child_node( name = 'FLIGHTINFO' ).
lr_nodeinfo_flightinfo = lr_node_flightinfo->get_node_info( ).
get value set (VALUE = CARRID , TEXT = CARRNAME)
select carrid carrname from scarr into table lt_value_set.
clear lw_value_set.
lw_value_set-value = 'AI'.
lw_value_set-text = 'Air India'.
append lw_value_set to lt_value_set.
sort the value set by the describing TEXT
SORT lt_value_set BY text.
set value to context attribute
lr_nodeinfo_flightinfo->set_attribute_value_set(
name = 'CARRID' value_set = lt_value_set ).
Here CARRID is a drop down by key field on the screen.
in The context it is an attribute in the node FLIGHTINFO.
Please give Reward Points if this piece of code helps
Regards,
Manish -
DROP Down By Index in Webdynpro ABAP
Hi,
I 've a small doubt in Drop down by Index in ABAP-Webdynpro
I have two Dropdown, In first dropdown i have few Departmnet name for EX:- Dept1 , dept2 etc..
based upon DEPT from first drop down i need to get the employee deails in second dropdown.
scenario:-
if i will chosse dept1 in first dropdown in second dropdown dept1 employee should populate
iif i will chosse dept2 in first dropdown in second dropdown dept2 employee should populate
Thanks...
Edited by: Rakshar on Sep 12, 2011 7:30 AMHi Rakshar,
1. Add an onSelect event to the Dropdown 1.
2. In the event handler get the the selected value of Dropdown 1 from the context of the same. Based on the selected value, retrieve the data to be displayed in Dropdown 2 ( for example data from a table)
3. Invalidate the context for Dropdown 2
4. Bind the data retrieved from table to the context for Dropdown 2 by using method BIND_TABLE
Let me know if you face any difficulty.
Regards,
Arpan -
Drop down by index in webdynpro
I am using a drop down by index element in my webdynpro ABAP screen.
I populate this drop down by fetching values through a remote-enabled function module. How do i set one particular value as default after fetching these values. ?
I am getting the currency keys as the list of values and want to show a particular value when the view is first shown. How is this possible?
regards,
PriyankHi Priyank,
I have the sample code where index is used.
This code is used for radiobutton group by index.
You can use same logic in your requirement.
data:
text type string,
element type ref to if_wd_context_element,
index type string.
DATA:
node_check TYPE REF TO if_wd_context_node,
elem_check TYPE REF TO if_wd_context_element,
stru_check TYPE if_start_ior=>element_check ,
item_check_attribute LIKE stru_check-check_attribute.
element = wd_context->get_lead_selection( ).
index = wdevent->get_string( 'INDEX' ).
Case when Overhead option is selected
navigate from <CONTEXT> to <CHECK> via lead selection
node_check = wd_context->get_child_node( name = if_start_ior=>wdctx_check ).
get element via lead selection
elem_check = node_check->get_element( ).
get single attribute
elem_check->get_attribute(
EXPORTING
name = `CHECK_ATTRIBUTE`
IMPORTING
value = item_check_attribute ).
if index EQ 2.
elem_check->set_attribute( name = 'CHECK_ATTRIBUTE' value = Abap_true ).
endif.
if index EQ 1.
elem_check->set_attribute( name = 'CHECK_ATTRIBUTE' value = Abap_false ).
endif.
Hope this answer will help you.
Cheers,
Darshna. -
Filling dynamic drop down in adobe interactive form( webdynpro ABAP)
HI all,
Im new in Webdynpro ABAP, my requirement is to fill drop down list in adobe interactive form. i created adobe form and its working fine.
I Created context like ROOT(cardinality 1:1)->DATANODE cardinality 0:n. This context is for drop down and in wddoinit i did like this.
IN WDDOINIT ,
DATA lo_nd_root TYPE REF TO if_wd_context_node.
DATA lo_nd_datanode TYPE REF TO if_wd_context_node.
DATA lo_el_datanode TYPE REF TO if_wd_context_element.
DATA ls_datanode TYPE wd_this->elements_datanode.
navigate from <CONTEXT> to <ROOT> via lead selection
lo_nd_root = wd_context->get_child_node( name = wd_this->wdctx_root ).
navigate from <ROOT> to <DATANODE> via lead selection
lo_nd_datanode = lo_nd_root->get_child_node( name = wd_this->wdctx_datanode ).
get element via lead selection
lo_el_datanode = lo_nd_datanode->get_element( ).
ls_datanode[] = lt_dna_value[].
CALL METHOD lo_nd_datanode->bind_table
EXPORTING
new_items = ls_datanode
set_initial_elements = ABAP_TRUE.
index =
while executing i'm getting this error ": WebDynpro Exception: ADS: com.adobe.ProcessingException: No output was generated while rendering: Stream for: PDFOut.(200,101). " . can u please tell me how to bind value for drop down.
I created sample table in same form and i binded same value to table, that time its executing fine.
can u please tell me solution for this Scenario.
Thanks
Hemachandran.
Edited by: hemachandran R on Sep 12, 2008 2:27 PMhi,
My requirement, is to use dynamic drop down in dynamic table. I am using webdynpro abap.
i populated the value in drop down.
Its working fine but the problem is how to fill the default value in drop down. because i want to bind the default value which im getting specify value from the table.because each row
im getting different values, like first row
CAR
, that CAR want to fill as a default value in drop down and second row as
BIKE
that BIKE want to fill as default value in drop down ( example drop down contain car , bike , cycle).
In adobe form i binded like this
$record.DATANODE.DATA[*].DNA_RATING
i dont know whether this one is correct or wrong .
im getting default value as empty.
please give me some solution how to do this.its very urgent
thanks
hemachandran. -
Webdynpro for ABAP - interactive Adobe form - drop down lists not working
Hi all,
I'm trying to create an interactive form for a client using webdynpro for ABAP and I've viewed the demo "Create SAP Interactive Forms by Adobe with Web Dynpro for ABAP" by Thomas Jung, but when I implement it the form following similar steps the form is not interactive.
In the properties of the "InterativeForm", I've tried clicking the "enabled" flag both on and off. I've also tried setting the "displayType" property to both "ActiveX" and "Native". But none of this worked.
I though my problem might be with Adobe reader so I switched from 8.0 back to 7.0 but this didn't make any difference either.
The system we are using is NW04s WAS 700. Any hints would be greatly appreciated!
Thanks,
-tomThanks for the suggestion Dezso. I've downloaded a newer version of ACF as indicated by the OSS note and installed it. I'm still having the same issue.
My basic question is what options should I be using in the form and on the InteractiveForm component? It looks like because of the evolution of the product there are multiple options available. I recall reading somewhere that as of a certain SP level we should have ZCI (zero client install) available. The would be our preference. It will be a support nightmare if each user needed a manual download of ACF.exe installed.
Should I click the "enabled" flag on the InteractiveForm object? When I create the form should I use the "Native" drop down list or the one from the "Active X" tab? I would like to use the "List Box" control on the form as well but it is only available in the "Standard" tab. So does that mean I can't get the selections from a "List Box"?
Thanks,-tom -
ABAP WebDynPro tutorials for Roadmaps and drop-down list box
Hi Experts,
I need some tutorials on Roadmaps and drop-down list box in ABAP WebDynPro which will show me step by step process how to create application using this. 'help.sdn' pages do show the procedures for implementing those ui elements.
And also the previous threads refer to some expired documents.
Thanks in advance.....
Plz help....
Edited by: Akashdeep Basu on Aug 9, 2008 9:30 AMHi
[SAP BLOG on ABAP-WEBDYNPRO|https://www.sdn.sap.com/irj/sdn/nw-development?rid=/webcontent/uuid/512040e1-0901-0010-769c-c238c6ca35d9]
[Step-By-Step Approach|http://help.sap.com/saphelp_nw04s/helpdata/en/79/002c2a0d43e645a39a89dd662b5f68/content.htm]
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a282c952-0801-0010-1eb5-87953e036712
Regards
Pavan -
How to get prefilled drop down list in Adobe form from WebDynpro context
Hi All,
We all know that we can have dropdown list in webdynpro which can be automatically populated by the context node collection.
How can we have the same functionality in Adobe form drop down list. I tried to bind the node attribute to drop down list in Adobe form but it shows me only first element. I am not able to see all the elements in the dropdown but if I am doing same thing for WebDynpro DropDown list I can see the complete List.
Anybody with Solution?Hi Ricky
I have started a thread for this problem and got an answer for it already. Unfortunately I did not have the time to check it out yet; have a look over there:
https://mail.cirrus.ch/exchweb/bin/redir.asp?URL=https:///community [original link is broken]
I appreciate if you tell me whether it worked for you.
Andreas -
Hi guys,
I want to conver an Input File in Drop Down, but i have the next error.
com.sap.tc.webdynpro.progmodel.context.ContextException: MappedAttributeInfo(Detail.test): must not modify the datatype of a mapped attribute
I use the next code:
IWDAttributeInfo attInfo = wdContext.getNodeInfo().getAttribute(IPrivateDetail.IContextElement.TEST);
ISimpleTypeModifiable fundCType = attInfo.getModifiableSimpleType();
fundCType.setFieldLabel("Fiscal Year");
IModifiableSimpleValueSet valueSet1 = fundCType.getSVServices().getModifiableSimpleValueSet();
for (int i = 0; i < wdContext.nodeWa_Plants1().size(); i++) {
wer = wdContext.nodeWa_Plants1().getWa_Plants1ElementAt(i).getWerks();
na = wdContext.nodeWa_Plants1().getWa_Plants1ElementAt(i).getName1();
valueSet1.put(wer, na);
wdContext.currentContextElement().setTest("");
What should i do?Hi Freddy,
I still think you did not understand what Armin was trying to say. The basic point is that if there is some context in your view controller which is mapped to a context in your component controller, then you cannot modify this context's data type in your view controller. If you try to do this, then you will get the error message saying "must not modify the datatype of a mapped attribute". You will have to do this in your component controller. If you want to modify a context's data type in view controller implementation, then you will have to remove the mapping.
The code snippet which you have given, what I can understand is the context "Test" is of type string in your application. And in you code you are making this context as a simple type for the purpose of populating a drop down. So this eventually means you are modifying the data type of this context from string to a simple type. So just do this coding in your component controller.
I hope it helps...
Bye
Ankur
Message was edited by:
Armin Reichert -
How to fill a drop down box in a webdynpro application
Hi friends ,
i am facing one problem while filling a dropdown box with some hot coded values : " High","Medium","low"..etc..
drop down box having fixed elements always.....
means all values should be static and i have to fill it at design time only..
can any body pls reply for the above same......
Thanks and Regards
Ratnakar reddyHi Ratnakar,
If u r using Dropdown By Key, u can use the method that Armin suggested.
If u r using Dropdown By Index, then do the following
Let ur View Name be 'MyView'
1. In ur View Context,Create a Node(Say Root) of Cardinality 0..N
2. Create a value attribute(Say Name) in 'Root'.
3. In wdDoInit(), add the following code
IPrivateMyView.IRootNode rNode=wdContext.nodeRoot();
IPrivateMyView.IRootElement rEl=rNode.createRootElement();
rNode.addElement(rEl);
rEl.setName("HIGH");
rEl=rNode.createRootElement();
rNode.addElement(rEl);
rEl.setName("MEDIUM");
rEl=rNode.createRootElement();
rNode.addElement(rEl);
rEl.setName("LOW");
Hope this be Helpful
Fahad Hamsa
Maybe you are looking for
-
Why does this message keep appearing when Itry to instal windows 7 through bootcamp? - "Your bootable USB drive could not be created. An error occurred while copying the Windows installation files."
-
Dear experts, Under the same client in SAP system, can different company codes have different sales employee number ranges? If yes, should I just activate the number range? You know, there's no number range assignement to company codes. Plz help. Man
-
Convert/Export Flex chart to MS Word
Hi All, Please let me know how to Convert/Export the Flex Chart to MS Word... Please send the related links or samples if you have. Thanks in advance. Regards, Seshadri Babu.G
-
HP mini 100e error after updating BIOS
HP MINI 100E model no: A1C35AA. error 104-unsupported wireless network device halt remove the device and restart after upadting the BIOS. when i remove the wireless card it works well. Kindly advise on a way to resolve this issue.
-
I am trying to create a MultiPool in a cluster, every time the server starts up I get <Mar 30, 2005 3:55:00 PM EST> <Error> <JDBC> <BEA-001151> <Data Source "MY_DATASOURCE" deployment failed with the following error: DataSource(MY