Populating data in dropdown
Hi all ,
i have 2 dropdowns .the first dropdown contain countries list and second dropdown contain states . my requirement is when a country is selected in the first dropdown ,states should be populate in the second dropdown automatically.
pls can any one expalin the requirement
thanks
Rajeev
Hi,
write this code in init
public void wdDoInit()
//@@begin wdDoInit()
Hashtable country = new Hashtable();
country.put("india", "india");
country.put("us", "us");
Hashtable indiastates = new Hashtable();
indiastates.put("ap", "ap");
indiastates.put("hyd", "hyd");
Hashtable usstates = new Hashtable();
usstates.put("us1", "us1");
usstates.put("us2", "us2");
Enumeration keys = country.keys();
IWDAttributeInfo nameInfo =
wdContext.getNodeInfo().getAttribute(
IPrivateCountrydropView.IContextElement.COUNTRY);
ISimpleTypeModifiable nameType = nameInfo.getModifiableSimpleType();
nameType.setFieldLabel("country");
IModifiableSimpleValueSet nameSet =
nameType.getSVServices().getModifiableSimpleValueSet();
//get the list of slat records
while (keys.hasMoreElements()) {
String key = keys.nextElement().toString();
String value = country.get(key).toString();
nameSet.put(key, value);
Enumeration newKeys = country.keys();
while (newKeys.hasMoreElements()) {
main.put(newKeys.nextElement().toString(), indiastates);
main.put(newKeys.nextElement().toString(), usstates);
//@@end
and in action button of the first dropdown write this code
public void onActionselect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionselect(ServerEvent)
IWDAttributeInfo nameInfo = wdContext.getNodeInfo().getAttribute(IPrivateCountrydropView.IContextElement.STATES);
ISimpleTypeModifiable nameType = nameInfo.getModifiableSimpleType();
nameType.setFieldLabel("states");
IModifiableSimpleValueSet nameSet = nameType.getSVServices().getModifiableSimpleValueSet();
nameSet.clear();
Hashtable contacts = new Hashtable ();
contacts = (Hashtable) main.get(new String(wdContext.currentContextElement().getCountry()));
Enumeration tableKeys = contacts.keys();
while (tableKeys.hasMoreElements()) {
String tableKey = tableKeys.nextElement().toString();
String tableValue = contacts.get(tableKey).toString();
nameSet.put(tableKey, tableValue);
//@@end
thanx,
ramani.p
Similar Messages
-
Need help in Populating data in to new fields using BDT
Hi all,
in BDT,
i have created a VIEW and attached it to a subscreen,
i am able to see the the fields and have problem in populating data into the fields,
In the BEFORE OUTPUT FM, i am populating data into the screens, but its not available in the screen,
Please help me in this.
Thanks and regards,
Sumanth.Hi,
Use managedBean scope as pageFlowScope and try
See
http://tanveeroracle.blogspot.com/2011/02/pageflowscope-variables.html -
F4 help for custom table field - to be used when populating data thru SM30
Hi,
I have a custom table with 5 fields - say A, B, C, D and E. While populating data to the table through SM30, I need to create a F4 help for the field C. A custom function module needs to be used.
I have created a module for the same in the event PROCESS ON VALUE-REQUEST of the function group of the table.
But the F4 for field C depends on the values put in fields A and B.
I am not able to get the values of fields A and B from within the module PROCESS ON VALUE-REQUEST.
Please help me to create the F4 help.hii,
This is the piece of code i have used in one of my SM30 to get f4. mopdify according to ur need and use.
revert back for further help.
w_dynpread-fieldname = 'ZSITEDCDATA-SITE'.
APPEND w_dynpread TO i_dynpread.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = 'SAPLZSITEDCDATA'
dynumb = sy-dynnr
translate_to_upper = 'X'
TABLES
dynpfields = i_dynpread
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE i_dynpread INTO w_dynpread INDEX 1.
IF sy-subrc IS INITIAL.
SELECT land1 FROM t001w
INTO TABLE i_site
WHERE werks EQ w_dynpread-fieldvalue.
IF i_site[] IS NOT INITIAL.
DATA: lv_line TYPE i.
CLEAR lv_line.
DESCRIBE TABLE i_site LINES lv_line.
IF lv_line GT 1.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ZSITEDCDATA-SITE_COUNTRY'
dynpprog = 'SAPLZSITEDCDATA'
dynpnr = sy-dynnr
window_title = 'Site Country'
value_org = 'S'
TABLES
value_tab = i_site[]
return_tab = i_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
READ TABLE i_return INTO w_return INDEX 1.
IF sy-subrc IS INITIAL.
zsitedcdata-site_country = w_return-fieldval.
ENDIF.
ENDIF.
Thanks ,
Gaurav -
Restricted key figure not populating data
Hi Guru's,
I am facing problem with restricted keyfigure. I have restricted amount with cal year which is not populating data.
This key figure is having data in provider.
Could you let me know how to overcome this .
Thanks in advance.
Thanks,
Vijay.Hi,
The quesry is on Multiprovider? or infoset? it matters first..... or directly on cube? check it and apply relevent infoprovider properties for logic check.
Check the global filters are there any infoprovider restrications etc...
And also while checking the datafor the KF in infoprovide " use ALL the restrictions that are in query and impact the data"
also try removing the restiction and look for data...
Hope this helps.' -
Urgent--error in populating data in segments of Idoc-DELVRY03
Hi experts,
I am populating data in segments of DELVRY03 where I am using process code DELV with Message Type SHPORD.
For this I am using EXIT_SAPLV56K_002.
As I have to populate many segments I am giving case statement. But IDOC_DATA-SEGNAM is empty.
Please help me with this issue as I am running out of time.
Waiting for replies.
ThanksHi,
Loop at IDOC_DATA.
thanks -
Hi all,
I am trying to get a Date in DropDown, that is when i click on the dropdown arrow i want to get the calender of the current month
Is there any procedure to do that as i am not able to get that, While i am able to do this using inputfield,But my requirement is to get the calender in dropdown.Hi Valery,
The solution for my question that u have sent was very useful but i am still unable to resolve my issue.
let me explain in detail:
My application is to select a date in the Input Field and then click on the image which i put it in Link to Url UI Element When i click on the image which looks like a button it should go to the concerned link and get the reports according to the date I selected in the Input Field.
But What's happening is, after i select the date Only after pressing enter I am able to pass the date to the reference link of the Image(Link to Url).
I want to pass the parameters of the date without pressing enter Is there anyother way to solve my Problem.
Thanks,
Kalyan. -
Want JTree e.g. of populating data from database.
I want ur JTree example of populating data from database, can u plz give me that eg.?
Awaiting 4 ur reply.Hi,
AFAIK, there is no direct approach to populate a JTree directly from a resultset. However, JTree can use a DOM tree as its model by using the adapter pattern. The procedure to do this is well-documented in the SUN website and the link is provided below. The code to convert a resultset to XML is provided below:
protected void resultSetToXML(OutputStream out,
ResultSet rs,
String stylesheet)
throws IOException, ServletException {
// Create reader and source objects
SqlXMLReader sxreader = new SqlXMLReader();
SqlInputSource sis = new SqlInputSource(rs);
// Create SAX source and StreamResult for transform
SAXSource source = new SAXSource(sxreader, sis);
StreamResult result = new StreamResult(out);
// Perform XSLT transform to get results. If "stylesheet"
// is NULL, then use identity transform. Otherwise, parse
// stylesheet and build transformer for it.
try {
// Create XSLT transformer
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t;
if (stylesheet == null) {
t = tf.newTransformer();
} else {
// Read XSL stylesheet from app archive and wrap it as
// a StreamSource. Then use it to construct a transformer.
InputStream xslstream = _config.getServletContext().
getResourceAsStream(stylesheet);
StreamSource xslsource = new StreamSource(xslstream);
t = tf.newTransformer(xslsource);
// Do transform
t.transform(source, result);
} catch (TransformerException tx) {
throw new ServletException(tx);
The classes SQLXMLReader and other classes used in this example are available in the following java packages.
import java.sql.*;
import javax.sql.DataSource;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.sax.*;
import javax.xml.transform.stream.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import org.xml.sax.helpers.AttributesImpl;
The following is the link that explains how to load a JTree from DOM.
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPDOM6.html
Cheers,
vidyut -
Categories tab in app store is not populating data
Dears,
I have a problem in my Iphone OS 3.1.3 as the Categories tab in app store is not populating data and coming blank.
it was working fine before and suddenly stopped, although I restore to original setting 2 times and still not working.
Appreciate your help.Hi, it seems like this but let's wait reply from apple in order to know when will it work again
-
Data population in a dropdown inside a Table in WebDynpro Java
Hi All ,
I have a table inside which there is a dropdown in a ZCI Form. I am using enumerated dropdown list.
The issue is binding of this dropdown is not woking as it works for normal dropdown.
I am getting pdfdocumentcreation exception if trying to bind this dropdown using dynamic binding.
Anybody help me out to solve this issue.
regards
RavindraHi,
Refer the below link you will get useful information
Dropdownlist to display r3 table
Re: DropdownList box to display R/3 table
see this link for when to use DropDownByIndex (DDI) vs DDK (DropDownByKey) and how populate data from R/3.
Re: webdynpro populating dropdown values programmatically
create context value attribute and bind to drop down by key
not getting value from DropDownByKey
Dynamically adding values to dropdown by key thread
Dynamicaly adding values to DropDownByKey
Dropdown by key
dynamic DropDownByKey
http://help.sap.com/saphelp_nw04/helpdata/en/4a/8613e41629344194e4f40393740d51/content.htm
Regards,
Saraswathi.
Pls reward points for useful info
Message was edited by: Saraswathi D -
How to filter the data in dropdown?
Hello,
How to filter the data
I got all the project name in dropdown when you select the project name in other textbox the project id will come automatically.
so I want to get only those project name that is assigned to that particular user.
I have
ProjectName(dropdown),
ProjectId(Textbox),
Employee code(Unique value),
employee Id (Unique for particular employee means if User A works on 5 projects so for all 5 projects the employee Id will be same),
Project Id( 5 projects 5 different id)
I didnt get the exact formula or I have to use any javascript code.Any help...
Thanks,If I am understanding correctly, you want to populate a drop down with values from a list.
Using InfoPath:
right click on the drop down to be populated, and choose drop down list box properties.
add the list with the values as a data source.
click the filter box next to entries.
select the field you want from the other list.
click filter data.
set the filter (click AND if you need more lines).
click OK on any dialogs you need to to get back to the editor.
Test your form. -
Schema, pre-populated data and submit
Hello guys,
I'd like a help here.
I've designed a form with a schema defined, a XML data file sample and now it is pre-populating a dropdownlist with the data from XML properly (let's say 50 items). But when I submit the form as XML, is submitting the whole list of 50 items plus the selected one.
Is it possible to submit only the selected item?
To be more specific, how can I choose which fields I need to be submitted?
ThanksHi Diego,
As far as I understood your problem , You need to update certain fields based on the selections made in the DropDown ? Am i correct ?
If yes, you have to remove the data binding, unless it will export all the XML data that you are embedding to it, no matter what you do.
You need to directly read the values of the attributes through the node of the XML you are embedding. It needs a bit of scripting.
Otherwise you can use XSLT to transform the data in which I have no expertise You need to know about the data mapping while doing this.
So, out of the above choices, what you need to do ? It would be great if you can share your form.
Thanks.
Bibhu. -
How to delete the populated data in the control screen of XK02 transaction
In the vendor master ( XK01/2/3) "Control screen " we have some user defined fields with data already populated into those fields. Now, the user is asking to delete the data which is already populated for a particular purchaging Organization. How to do that.
Ur help wil be highly appreciated.Hello,
If the data is like after every C5* or C6* there is an underscroll sign (_), then below code will work in start routine:
Data: wa_source_package like line of source_package,
itab_sp type standard table of tys_SC_1,
a(6) type c,
b(10) type c.
loop at source_package into wa_source_package.
split wa_source_package at '_' into a and b.
if strlen( a ) = 7.
append wa_source_package to itab_sp.
endif.
endloop.
refresh source_package.
source_package = itab_sp.
Regards,
Shashank -
Getting error to bind data to dropdown list
hay dear,
i bind data to a dropdown list, everything gonna ok but when i run the project the web page containing the bellow error message. could anyone help me
Exception Handler
Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
Exception Details: java.sql.SQLException
Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : oracle.jdbc.pool.OracleDataSource
Possible Source of Error:
Class Name: com.sun.gjc.spi.base.DataSource
File Name: DataSource.java
Method Name: getConnection
Line Number: 112
Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
Exception Details: java.lang.RuntimeException
java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : oracle.jdbc.pool.OracleDataSource
Possible Source of Error:
Class Name: com.sun.data.provider.impl.CachedRowSetDataProvider
File Name: CachedRowSetDataProvider.java
Method Name: setCursorRow
Line Number: 343
Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
Exception Details: com.sun.rave.web.ui.appbase.ApplicationException
java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : oracle.jdbc.pool.OracleDataSource
Possible Source of Error:
Class Name: com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl
File Name: ViewHandlerImpl.java
Method Name: cleanup
Line Number: 603
Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.I'm not a guru, but I would say : your jdbc isn't working. Make sure that it's functioning properly.
The errormesages suggest that the application can not find the datasource.
Best Regards,
Martijn -
Need help in populating data in advanced table in oaf
Dear All,
I have a requirement as below:
I have a custom OAF page, from that i am invoking a popup page and from the popup page i am selecting some rows and populating in my base page advanced table region.
that is fine so next time when i am calling again the popup page and selecting some data and pressing button this time it is again populating properly in base page my requirement is i need to populate the old data that selected as well as new data wht selected, so every time the table refreshed with the data selected rather than keeping old data wht selected, can it be posibel please help me out.
ThnaksHi Vishnu,
in all sapscript for standard sap transaction cases, you can always find the original sap solution abd/or sap sample routines. Start from there and then look at your custom programming.
I can't explain in more detail because you do not give more detail.
Another frequent issue is that the sapscript form is not configure and activated correctly.
Anyway, follow this guide and find the solution ist possible.
Regards,
Clemensl -
How to check which Table & Field is populating Data source
Hi,
My requirment is to check from which Table and Which field the data is extracted in the data source
Data Source : 0MAT_PLANT_ATTR
Field in Data Source : MINBE
Now i want to check from where (Table/Field) in R/3 is populating the Field MINBE in Data source 0MAT_PLANT_ATTR
How can i do thatHi,
Since you have the extract structure and the extractor, you can try Extractor Checker RSA3.Execute ST05 (activating SQL Trace), switch on the trace and execute the extractor checker. Once the extractor checker presents the results
switch off trace. The clcik on Display trace and you will see all the tables that were hit by the extractor checker to retrieve data and present it to you.
Note: Set the break point in the Extractor Function module.
View the ST05 Extended Trace list. The Object name shows the Tables accessed.
Hope this helps.
Thanks,
JituK
Maybe you are looking for
-
Having trouble playing some videos in IE9
Vista Home Premium SP2 32 bit IE9 and Firefox 7 I am having a terrible time with flash in IE9. I can not access that hardware acceleration feature to turn it off. If I right click on the video box I just get my normal context menu. I went to the page
-
Hi, Can some one guide me on how can we tune this query below : select glinv.segment1 "legal", glinv.segment2 "business_unit", glinv.segment3 "site", glinv.segment4 "department", glinv.segment5 "account", glinv.segment6 "product", glinv.segment7 "cli
-
Hi, I am new to Report builder, I have developed character mode report on client server mode, It is working fine, and fast printing. Please tell me this report can i run on web using report server with same speed of printing? Regards Kinjal Shah
-
List Component : Dragging position marker
If you setup a basic List component and add support for dragEnabled and custom drop handling with a custom itemRenderer i have come across the following issue. When you drag an item within a ListBase (List, DataGrid, etc..) component, you get a posit
-
Error:pricing procedure is getting changed in credit management
Hi, Sales order is created.delivery is created In invoice its picking value from credit management. here pricing procedure is changing. What is issue for changing pricing during invoice and taking credit managment. regards SAP SD User