How to select value from DropDownByKey?
Hi all,
In my application, I am using 2 Bapis. The first one just for displaying data with all material numbers. The second Bapi is for inserting the Sales data to database. Both of them have Material number. Now from the first Bapi, I displayed all the materials in a dropdown list. Now when i select one value from Dropdown list, and I fill some values for Sales data, then the data has to be stored in database along with the material number.I displayed the material number of first Bapi in my View and the remaining feilds of second (Sales)Bapi. How to do this?
Help is highly appreciated.
Hi,
Step1:
//Input Tothe First BAPI
<Bapi>Input input1=new <Bapi>Input();
wdContext.node<BAPIInput>().bind(input);
input.set<Param>(wdContext.current<ContextName>Element.get<Param>());
Step2:
//Execute the First BAPI
Step3:
//Output Of the FirstBapi
int len=wdContext.node<BAPIList>().size();
Step4:
<Bapi2>Input input2=new <Bapi2>Input();
wdContext.node<BAPI2Input>().bind(input2);
//SecondBapi Input from First Bapi
for(int l=0;l<len;l++) {
String returndata=String.valueOf(((IPrivate<viewname>.I<BAPIList>Element)(wdContext.node<BAPIList>().getElementAt(l))).get<Parameter>());
input2.set<Param>(returndata);
//Do Other Input for Second Bapi
input2.set<Param>("Input");
//Execute the Second Bapi
//Output Of Second Bapi//Like Step4
//Execute the SQl
Kind Regards
Mukesh
Similar Messages
-
How to select value from database view with * in wher clause
Hi ,
I ahve a database view with some fields.
Now my requirement is to serach a single row on the basis of process type.
Process type can have values like ZBA,ZBC,ZBD,ZBE or similarly anything starting with ZB.
Now i know that starting two letters will be ZB , but dont knwo the last letter.
So how should i use select query for the same?
Should i use like operator for the same?
regards
PGhi,
u can use character '%'.sample code like this
SELECT reltype
instid_a
catid_a
instid_b
FROM /dbm/ord_docflow
INTO TABLE it_link
FOR ALL ENTRIES IN it_pnwtyh
WHERE instid_a = it_pnwtyh-instid_a AND
instid_b LIKE 'QMSM%' AND
typeid_a = 'BUS2400' AND
typeid_b = 'BUS2400' AND
catid_a = 'BO' AND
catid_b = 'BO' AND
reltype = 'VONA'.
this is similar to using* while we fetch values from table.in the above code only i no QMSM rest values not sure,so used QMSM% -
How to select value from list with multiple selections ?
HI,
i have a list with multiple selections where i show email address retrieved from database.
what i want to do is to send the selected email address to the invoiceedit.jsp.
please look at the following code which gives you the better idea.
<td class='smalltext'><select name="email" size="3" multiple="multiple">
<%
Connection conn = null;
Statement stmt = null;
Statement stmt_contactperson = null;
Statement stmt_address = null;
try{
conn = getREConnection();
stmt = conn.createStatement();
ResultSet rs = null;
rs = stmt.executeQuery("SELECT PROPERTYID, VALUE FROM PROPERTIES WHERE ENTITYID="+ g_strGroupID+" AND NAME = 'invoice_default_email'");
int numofrows = 0;
while(rs.next())
%>
<option value="<%= rs.getString("VALUE") %>" selected="selected"> <%= rs.getString("VALUE") %> </option>
<%
}//end of while
%>
</select>
<a href="invoiceedit.jsp?entityid=<%=g_strGroupID%>&add=1"><font color="#000000">Add</font></a>
<a href="invoiceedit.jsp?entityid=<%=g_strGroupID%>&email_to="><font color="#000000"> Edit</font></a> </td>thanksUse a form button instead of a link so that you can send it as a request parameter to the server. In the server side just use HttpServletRequest#getParameterValues() to obtain all values for the given parameter name. If you really need a link rather than a button, then use Javascript to submit the form on click of the link.
That said, your design is bad. Java code belongs in Java classes, not in JSP files. Database access logic belongs in a DAO class. Business and controlling logic belongs in a Servlet class. Only presentation logic belongs in the JSP file. Avoid scriptlets as much as possible and use JSP EL and/or JSTL instead. -
*SELECT: How to select value from cube into variable?
Hi,
I have an application that need lots of complex calculations. Currently I am facing problem in retrieving a value from BPC application/database (BW cube) into a script logic local variable. Let's say the application has these following dimensions
1. FYPD ( fiscal yr period. 200901, 200902 etc)
2. REGION ( A, B , C , D etc)
3. PRODUCT(Product ID)
4. VERSION ( ACTUAL, FORECAST etc)
5. AMOUNT (Sales Amount, signed data )
Now I need to extract the sales amount into a local valriable where REGION = "A" and PRODUCT = "SMK-1234" and FYPD = "200905" and VERSION = "ACTUAL"
What's should be the equivalent SELECT command? I tried but could not figure out. Any help?
Regards
DipMHi DipM,
There isn't really a concept of local variables for values in script logic. Instead, you'll want to use *WHEN, *LOOKUP, or MDX statements.
For example, this will copy the value you mention into the PLAN version:
*WHEN REGION
*IS A
*WHEN PRODUCT
*IS SMK-1234
*WHEN FYPD
*IS 200905
*WHEN VERSION
*IS ACTUAL
*REC(FACTOR=1,VERSION=PLAN)
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
See *WHEN ([link|http://help.sap.com/saphelp_bpc70sp02/helpdata/en/36/339907938943ad95d8e6ba37b0d3cd/frameset.htm]) and *REC ([link|http://help.sap.com/saphelp_bpc70sp02/helpdata/en/25/8d51050c43496887ddff88f13e5f1a/frameset.htm]) documentation for more.
As mentioned, you can also use *LOOKUP or MDX statements to look up values and drive calculations in *REC(EXPRESSION=....) statements. This functionality is outlined in the SP02 documentation addendum ([link|http://service.sap.com/~form/sapnet?_SHORTKEY=00200797470000088146&_SCENARIO=01100035870000000202&]).
In the MS Version of BPC, there is a concept of local MDX variables that work with the specialized *GO script logic statement. This statement is not available in the Netweaver version.
Ethan -
How to select values frm table giving the condition value at runtime in SQL
Hi All,
How to select values from a table by giving the condition value at runtime in SQL
My SQL statement is select * from employee where empno=<empno>, this empno I want to provide at run time. Also I don't have any bind variables defined. Can anyone please tell how can I achieve this. Also do I have to write a SQL or pl/sql statement.Hi Roshni Shankar,
You can use substitution variable in case of SQL.
SQL> select * from employees where emplployee_id = &emp_id;
Enter value for emp_id: 100
old 1: select * from employees where emplployee_id = &emp_id
new 1: select * from employees where emplployee_id = 100If you want to put condition on varchar values then eighter provide values in single quotes or use single quote for substitution variable.
SQL> select * from employees where last_name = &emp_name;
Enter value for emp_name: 'King'
old 1: select * from employees where last_name = &emp_name
new 1: select * from employees where last_name = 'King'
no rows selected
SQL> select * from employees where last_name = '&e_name';
Enter value for e_name: King
old 1: select * from employees where last_name = '&e_name'
new 1: select * from employees where last_name = 'King'In case of pl/sql you can pass values to procedure and you can use those values at run time.
create or replace procedure test (p_emp_id number)
as
v_last_name varchar2(100);
begin
select last_name
into v_last_name
from employees
where employee_id = p_emp_id;
dbms_output.put_line(p_emp_id ||' -> '||v_last_name);
end;
show errors
SQL>exec test(100);
SQL>exec test(101);Edited by: Gaurav Bhide on Oct 29, 2012 4:07 AM -
How to get selected value from selectOneRadio ???
Hi...i want to how to get selected value from selectOneRadio and use it in another page and in backing bean.
Note i have about 10 selectOneRadio group in one page i want to know value of each one of them.
Plzzzzzzzz i need helpYou have a datatable in which each row is a question, correct?
Also in each row you have 5 possible answers that are in a radio, correct?
So,
You need to put in your datatable model, a question, and a list of answers (5 in yor case) and the selected one.
So you will have a get to the question, an SelectItem[] list to populate the radios and another get/set to the selected question.
ex:
<h:selectOneRadio value="#{notas.selectedString}" id="rb">
<f:selectItem itemValue="#{notas.valuesList}"/>
</h:selectOneRadio>
Search the web for examples like yours. -
How to get selected value from OADefaultListBean.
Hi All,
How to get selected value from OADefaultListBean ?
Thanks,Hi,
To identify the user's selection(s) when the page is submitted, you would add the following logic to your processFormRequest() method:
OADefaultListBean list =
(OADefaultListBean)webBean.findChildRecursive("positionsList");
String name = list.getName();
String[] selectedValues = pageContext.getParameterValues(name);
To retrieve all the values in the list box, call list.getOptionsData().
--Prasanna -
Dvt:pivotFilterBar - how to get selected values from filter
Hi all,
I have a question: how to programmatically get selected values from pivot table's filter bar?
I have tried to use
pivotTable.getDataModel().getDataAccess().getValueQDR(startRow, startCol, DataAccess.QDR_WITH_PAGE);but for page edge dimensions it returns BAD DATA, it seems that it returns some cached values.
Environment: JDev 11.1.1.3.0 without any patches.
thanks,
MiroslawHi,
You can retrieve the selected value in the PivotFilterBar through the model of PivotFilterBar, instead of dataaccess:
// get the model from the pivot filter bar instance
QueryDescriptior queryDescriptor = (QueryDescriptor)pivotFilterBar.getValue();
// retrieve a list of criterion, each one is used to populate each lov within the pivot filter bar
ConjunctionCriterion conjunctionCriterion = queryDescriptor.getConjunctionCriterion();
List<Criterion> criterionList = conjunctionCriterion.getCriterionList();
for (int i=0; i<_criterionList.size(); i++) {
AttributeCriterion criterion = (AttributeCriterion)criterionList.get(i);
// _selected is the currently selected value
Object selected = criterion.getValues().get(0);
System.out.println(_selected);
Hope that helps,
Chadwick -
How to get selected value from a listbox
Hi !
I use following code to fill in my LISTBOX with values :
AT SELECTION-SCREEN OUTPUT.
val-key = 1.
val-text = '0016'.
APPEND val TO list_values.
val-key = 2.
val-text = '0028'.
APPEND val TO list_values.
val-key = 3.
val-text = '0035'.
APPEND val TO list_values.
val-key = 4.
val-text = '2001'.
APPEND val TO list_values.
val-key = 5.
val-text = '0515'.
APPEND val TO list_values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING id = 'p_list'
values = list_values.
My question is - how to get a selected key/text value ? i dont need it to be done dynamically - i just need it in START OF SELECTION to perform tasks.
Thx in advance.Unfortunetly it does not work
i Define parameter as follows :
PARAMETERS:
p_list AS LISTBOX VISIBLE LENGTH 10.
Then i add values to it :
AT SELECTION-SCREEN OUTPUT.
val-key = 1.
val-text = '0016'.
APPEND val TO list_values.
val-key = 2.
val-text = '0028'.
APPEND val TO list_values.
val-key = 3.
val-text = '0035'.
APPEND val TO list_values.
val-key = 4.
val-text = '2001'.
APPEND val TO list_values.
val-key = 5.
val-text = '0515'.
APPEND val TO list_values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING id = 'p_list'
values = list_values.
Then when i add a blank section :
AT SELECTION-SCREEN ON p_list.
I set a breakpoint in START OF SELECTION block - but the value is empty no matter what do i select.
Actually when i select value from the list and hit enter key on selection screen the selection in a listbox goes empty :/
Whats the cause of this ?
Edited by: Jacek Zebrowski on Feb 26, 2009 12:38 PM -
How do I pass selected values from dynamic LOV to Command SQL in Oracle
My environment:
Crystal 11
Oracle 10
I've created and tuned a SQL script for a report. In the Database Expert, I've copied the SQL into a Command. I've modified the Command to create 3 parameters.
I need help with the following:
1) How do I create a dynamic, cascading LOV and associated prompt group for the three parameters defined in the Command?
2) How do I pass the user selected valueS from the prompt group into the Command SQL as limits applied to the query executed against the database?I have the same problem with same environment .
The main report is having a 2 level cascading dynamic parameters.
I created a sub report with a command as below.
*select * from (*
select DATUM,MSEC,CNT,B1_NAME,B2_NAME,B3_NAME,ELEM_NAME,INFO_NAME,m.INFOTYPE,V.NAME,rank()
over (partition by B1_NAME,B2_NAME,B3_NAME order by DATUM desc ,MSEC desc,CNT desc) currentRank
from MESSAGES m,INTYDE i,VANAME v
where DATUM <=SYSDATE and trim(B1_NAME)='{?B1Name}'
and trim(B2_NAME)='{?B2Name}'
and m.INFOTYPE=i.INFOTYPE
and i.VALUE_NAME_NUMBER = v.VALNUM) where currentRank=1
I needs to pass cmbination of B1Name and B2Name from main report. I created a formula like
formula=Join({?B1Name},{?B2Name}),'|'); But this is showing some error.
and How I will substitute this in my command . As I new to Crystal XI help expected. -
How to capture selected value from drop down by index
Dear friends,
i want to capture the value of select value from drop down by index, for eg if select air france, how to capture , could any one please let me know
Thanks
VijayaHi Vijaya,
You can get the value of selected from drop down as below
Check out the event handler method attached to Onselect event of the ui element drop down by index , if no event is associated, then create an event and attach to the drop down list
Now you will be having the CONTEXT_ELEMENT in the WDEVENT parameter
data lo_element type ref to if_wd_context_element.
lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT').
Now, you can get the static attribute value of selected drop down value & let us say your drop down list values are populated from context node 'ND_DRP_DOWN'
data ls_data type wd_this->element_nd_drp_down.
lo_element->get_static_attributes(
importing
static_attributes = ls_data ).
Hope this helps you.
Regards,
Rama -
How to make validation in Bean and select value from another table
I want to know how to select data from table in backing bean according to primary key i have
the problem is that
i have a table Employee_Salary contains Employee ids and their salary
Empoloyee_Salary table
Employee_ID Number
Employee_salary Number
And Another table Called Employees
Employees table
Employee_ID Number
IsManager Varchar2 its value is [*Yes or NO*]
and other columns that i don't care about this table
i have on a jsff page an <af:table> this table is editable this is the Empoloyee_Salary table
*i want to check before save or after insert if this employee is Manager [from Employees tabke(yes or no)] the salary*
cannot be less that 100
i want to know how to make this how to select the value from employees table according to the id i have in the employee_salary table how to make this and make this validation
i have to select IsManager from Employees Table to see if this manager or no
i want to know how to make this in a bean
i use jdeveloper 11g
and my project is ADF Fusion project
and the page that have the Emplpyee_Salary table is JSFF
thanks in advanceYou might want to write this code in a validator on the entity object if it should apply from every screen.
If you want to access view objects from a backing bean the basics are here: http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcservices.htm#sthref918 -
How to select 2column from 1 column values
Hi All,
How to select 2column from 1 column values
Ex : In Emp they have JOB column
JOB
CLERK
MANAGER
SALESMAN
MANAGER
MANAGER
ANALYST
PRESIDENT
SALESMAN
CLERK
CLERK
ANALYST
CLERK
here i want to get output like as follows
Ex: ejob1 ejob2
ANALYST SALESMAN
ANALYST SALESMAN
Can anyone helps me in this,it is urget
Thanks,Something like
select a.job, b.job from scott.emp a, (select job from scott.emp) b
CLERK CLERK
CLERK SALESMAN
CLERK SALESMAN
CLERK MANAGER
CLERK SALESMAN
CLERK MANAGER
CLERK MANAGER
CLERK ANALYST
CLERK PRESIDENT
CLERK SALESMAN
CLERK CLERK
CLERK CLERK
CLERK ANALYST
CLERK CLERK
SALESMAN CLERK
SALESMAN SALESMAN
SALESMAN SALESMAN
SALESMAN MANAGER
... -
How to get selected value from SelectOneChoice
Hi,
I'm facing a problem to get selected value from SelectOneChoice. I have valueChangeListener event on a (SelectOneChoice)item. After user makes a choice I want to store selected value in a bean property to pass it to a method.
For example List item shows dname from dept table after user makes a choice I want to get deptno and populate into bean which I use to pass into my method.
If I use valueChangeEvent.getNewValue() I always get negative value instead I want deptno selected. Sample code pasted below.
public void setDeptno(ValueChangeEvent valueChangeEvent) {
BindingContainer b = getBindings();
OperationBinding oB = b.getOperationBinding("setDeptno");
//Checking instance of because same method is called from another text inputText item.
if (valueChangeEvent.getSource() instanceof CoreSelectOneChoice){
CoreSelectOneChoice cN = (CoreSelectOneChoice)valueChangeEvent.getSource();
if (columnName.getId().toString().equals("deptDname")){
JSFUtils.setManagedBeanValue("dept.deptDeptno",valueChangeEvent.getNewValue());
}if your selectOneChoice has value equal to #{bindings.deptno} bound to the iterator Dept1Iterator,
then the backing code will look more like
public void setDeptno(ValueChangeEvent valueChangeEvent) {
BindingContainer b = getBindings();
OperationBinding oB = b.getOperationBinding("setDeptno");
//Checking instance of because same method is called from another text inputText item.
if (valueChangeEvent.getSource() instanceof CoreSelectOneChoice){
CoreSelectOneChoice cN = (CoreSelectOneChoice)valueChangeEvent.getSource();
if (columnName.getId().toString().equals("deptDname")){
FacesContext ctx = FacesContext.getCurrentInstance();
Application app = ctx.getApplication();
ValueBinding bind = app.createValueBinding("#{bindings.Dept1Iterator.currentRow}");
Row row = (Row)bind.getValue(ctx);
JSFUtils.setManagedBeanValue("dept.deptDeptno", row.getAttribute("deptno"));
} I haven't tested it, so it could perfectly not work at all -
How to capture the selected values from module pool dialog list box !
Hi experts,
Can anyone help me out in capturing the values from the list box.
i am able to set the values in the list box.But i am not able to capture the selected value from the list box. Always the list box name is getting as "space"
I also tried in using the FM "VRM_GET_VALUES" but it is retireving all the values. Is there is any flag for filttering out the selected value.
Your inputs are appreciated.
Thanks,
Vijay.Along with the PBO and PAI event, add a POV event in the flow logic of the screen
DEMO_DROPDOWN_LIST_BOX -is a good demo example.
PROCESS ON VALUE-REQUEST.
FIELD structure_name-field_name MODULE create_dropdown_box.
In the report :
MODULE create_dropdown_box INPUT.
SELECT carrid carrname
FROM scarr
INTO CORRESPONDING FIELDS OF TABLE itab_carrid.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CARRID'
value_org = 'S'
TABLES
value_tab = itab_carrid
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
ENDMODULE.
In the layout, assign a Function Code , for eg : 'SELECTED' to the listbox and lets say name of the field is SDYN_CONN-CARRID. So in the PAI module,
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'SELECTED'.
MESSAGE i888(sabapdocu) WITH sdyn_conn-carrid.
ENDCASE.
ENDMODULE.
sdyb_conn-carrid will contain your selected field
Maybe you are looking for
-
How do I change the name of my IMAC
I purchased a new IMAC i7, a little over a year ago. Transfered the files/programs from my older IMAC to the new one using Migration. Shortly after that the hard drive went out and I brought it in to be replaced. The guy at Genius bar said they ch
-
APEX 3.0 PDF FOP OC4J REPORT: how to put a variable in the header or footer
hello. I want to put a variable ( like :P15_MY_PARAMETER) in the header OR footer of a standard PDF report , but does'nt work. I tried HTML formating with ' &P15_MY_PARAMETER. ' like described in the thread Include a display value in HTML footer ( In
-
Hi All, I have an ALV report in which i am using reuse_alv_list_display and this executes with certain details like Delivery no , sales organisation , reference no, transport group, shipping point and so on . the report gets displayed as below show
-
Mackeeper icon won't let me drag to trash
I am trying to uninstall mac keeper from my mac book pro. When I drag the icon to trash, it reappears in my app file. I have gone into my library and sent all the files with zoebit to trash. Also, I had to go in and remove all the cachdb files. I jus
-
Changing the HTML Target From a Servlet
Is there any way to change the HTML TARGET when sending an HTML page from a servlet to a HttpServletResponse object?