Changing Query Component's criteria items at runtime

Hi All,
As per my requirement i am changing query component's criteria items on some user input.
So initially there were 9 components on query panel form and after user input it will become 7. I programatically used to set this two component's UI Hint as setVisible(false).
Its working fine but if user input some value in to be removed 2 components it throws an null pointer exception.
I understood the problem which is:-
On query form if user input any value it used to persist. for same framework used to store this user entered value somewhere and after refresh it apply this value to the relevant components.
Since two of the component are missing after refresh. it throws a null pointer exception as it tried to call setValue() method on removed component which is not there.
After refresh the query panel form is rendered as per defined by QueryDescriptor object.
Is there any way we can update this QueryDescriptor object with the changes...????

Hi Simran,
Yes, it is possible with the help of store procedure. In SQL Server there is a IF-Else Conditional block, which you can use inside store procedure. Create a SP with 2 additional parameter something like FlagReadAgain and KeyField. Pass the flag always as True or False. For the Key field pass the record key which you want to read again if you are passing the Flag as True else pass it as 0 or whatever.
In the procedure check if the value of flag is True -> If yes, Read the entry with key name specified in where part.
In the else part put the query which you are using for the normal flow.
IF (FlagReadAgain) = TRUE
BEGIN
   SELECT EmpName, EmpAddress
   FROM Employee
   WHERE EmpID = 'E001'
END
ELSE
   BEGIN
     SELECT EmpName, EmpAddress
     FROM Employee
     WHERE Status = 'N'
   END
You may also use the approach which Srini mentioned. Create an application to restore any value to intial stage so that it can be picked up by XI when it poll again.
Choose any approach which you like.
Regards,
Jitender Chauhan

Similar Messages

  • "Error: Not able to connect to search service to retrieve valid settings" from CHange Query under search criteria

    Hi Everyone,
    I might made a big mistake by clicking Stop then Start action to "SharePoint Server Search" under  "Services on Server" from Central Administrator. Then all my search results have error messages. I did reset Index and start
    all crawls. It didn't work. Please Help.
    Thanks.
    Miranda
    Here is the picture under search page

    Hello Rk_muddala,
    I had a customer case where we got the same user friendly error in the Search Service Application of the Central Administration. When we looked at the ULS we got the following error:
    Exception in Query Builder OnLoad: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Attempted to perform an unauthorized operation.
    In our case it was because the user that was launching the Query Builder wasn't Administrator of the Search Service Application. Overhere is an Technet article how you can add an administrator:
    http://technet.microsoft.com/en-us/library/ee704546(v=office.15).aspx 
    - Dennis | Netherlands | Blog |
    Twitter

  • Changing the position of graphic item

    Hi all,
    I am using graphical items in my form canvas. I want to change the position of these items in runtime.
    can any one suggest me how to change the positions at run time.?.....
    Thanks,
    Pavan.

    Hello,
    This question has been aked so many times, and the answer is always the same : NO
    There is no available buit-in to deal with graphical objects located on the canvas. All you can do is to drop them on a small stacked-canvas, then move this stacked-canvas.
    Francois

  • Refreshing ADF Query Component after changing some property of a criteria

    Hi All
    Use Case : Refreshing ADF Query Component after changing some property of a criteria attribute.
    I have a query panel with 2 query criteria i.e. FirstName and DepartmentId where in DepartmentId is a drop down. The scenario is like when change the value of DepartmentId to 'Finance' with code value of '100' then my criteria attribute 'Firstaname' should be invisibe(queriable=false).
    Approach: Have overriden the queryOperationListener of adfquery as " queryOperationListener ="#{backingBeanScope.backing_queryLstener.processQueryOperation}" "
    My backing bean method goes as below :
    public void processQueryOperation(QueryOperationEvent queryOperationEvent) {
    // Add event code here...
    if( queryOperationEvent.getOperation().equals(queryOperationEvent.getOperation().CRITERION_UPDATE) ){
    DCBindingContainer bindings = (DCBindingContainer)this.getBindings();
    DCIteratorBinding iter =bindings.findIteratorBinding("EmployeeView1Iterator");
    ViewObjectImpl voimpl = (ViewObjectImpl)iter.getViewObject();
    ViewCriteria vc = voimpl.getViewCriteriaManager().getViewCriteria("EmployeeViewCriteriaDemo");
    Row currRow = vc.first();
    System.out.println("Department :"+currRow.getAttribute("DepartmentId"));
    if( (Integer)currRow.getAttribute("DepartmentId") ==100 ){
    AttributeDef[] attrs = voimpl.getAttributeDefs();
    int attrIndex = voimpl.getAttributeIndexOf("FirstName");
    ViewAttributeDefImpl attrDef = (ViewAttributeDefImpl) attrs[attrIndex];
    attrDef.setQueriable(false);
    // AdfFacesContext.getCurrentInstance().addPartialTarget(getQryId1()); //here i need to refresh the query component which is not happening
    // refreshQueryComponent(getQryId1());
    Everything is happening as expected but the query panel s not get refreshed.When i refresh the whole link/page then i can see the change.
    Please suggest.
    Thanks in adv.
    -Sanjeeb

    Hi,
    can's say anything about the first part of the question as more insight to the implementation would be required. However, have a look at http://www.oracle.com/technetwork/developer-tools/adf/learnmore/83-bidi-synchronization-tree-form-401841.pdf, which may be what you are looking for
    To the second part: You can programmaticallly refresh the tree component from a managed bean. So instead of using the declarative PPR option (or ChangeEventPolicy set to PPR on the iterator binding) you can wire the submit button to the managed bean, perform your validation and if it fails don't refresh teh tree
    The call is
    AdfFacesContext.getCurrentInstance().addPartialTarget(the_tree_instance)
    Frank

  • How to change the "name of column" property of an text item in runtime?

    How to change the "name of column" property of an text item in runtime?
    I look the properties of items in help and found nothing about this!
    It's possible?

    Hi,
    an other solution is change the block property QUERY_DATA_SOURCE_TYPE from "Table" to "Sub-query" , than change at run time the property QUERY_DATA_SOURCE_NAME.
    First create block and add items
    The QUERY_DATA_SOURCE_NAME will be for ex. "Select 'A' as col1, 'B' AS col2, 'C' as col3 from dual"
    Set into items the column name property to col1 , col2 ...
    At run time change the query to "Select 'Z' as col1, 'X' as col2 , 'Y' as col3 from dual"
    in this way you can change the source of column value.
    Caution because if you change value type from varchar2 to date you must cast date into varchar2.
    May be that this way is valid only for view data not for insert-update, i don't remember.
    bye
    Message was edited by:
    Killernero

  • Reorder Saved Search items in af:query component

    Hi,
    Is there any way to change the order of Saved Searches listed in the af:query component. The order that the view criteria are displayed in this component does not seem to have any relationship to the order that they occur in the VO.xml file, nor are they listed alphabetically.
    I'm only interested in ordering the view criteria in the choice list, that I have configured at design time.
    Is this possible?

    forgot to mention in my initial post that I'm using Jdeveloper 11g Rel 1.
    Thanks,

  • Criteria item is not being used in the LOV query

    Hi All,
    I have one 'messageChoice' bean which is associated with a view
    I have configured it correctly
    I have one 'messageLOVInput' bean
    above 'mesaageChoice' acts as criteria item for 'messageLOVInput'
    I created two maps one for each beans
    When I select a value from 'messageChoice' and click LOV button
    now LOV window should query based on the value from choice..
    but its not at all taking choice selection in the query criteria...
    Where I am doing mistake..?
    Thnaks
    -Praveen

    Hi,
    we are gathering JDeveloper 11 technology preview related question in a separate forum
    JDeveloper and OC4J 11g Technology Preview
    Frank

  • Programmtically Setting View Criteria in ADF Query Component

    I have created two view criterias for a View Object and used ADF Query component for searching. User can select any one of the View Criteria from "saved search" in ADF Query component. but i want to set it programmatically based on some business rules. How i can do that?

    No I don't want to set view criteria on search click. Actually I have ADF Query component on my page which is by default disabled. There are also some fields outside the query component on the value of which i enable ADF Query component and wants to set a particular ViewCriteria based on context. All ViewCriterias are defined and listed in "saved search" of ADF Query component but i don't want to allow user to select it but wants to application set it automatically based on context. For it i will be needed to set a particualar ViewCriteria for ADF Query component through code and then refresh ADF Query component to show newly set ViewCriteria. I know how to refresh query component or any other component through code but don't know how to set ViewCriteria on ADF Query component?

  • Change the color of text item after execute query

    Dear friends
    I would like to know how can I make a tabular form like grid and chang the color of text item when (for exp in emp table) the value of sal column between 2000$ and 4000$.
    I used the SE_IEM_PROPERTY command but it change all of the text items of sal column.
    please help me
    thanks a lot

    Highlight the Existing Record in Forms
    (Compatible with 4.x, 5.x, 6.x & 9i)
    Step 1: Create a New Visual Attribute(BLUE_VA) (Color of highlighted record)
              Font – Arial
              Size – 8
              Style – Plain
              Font width - Normal
              Font Weight - Bold
              Foreground Color – Black
              Background Color – Blue
              Fill Pattern – Transparent
    Step 2: Create another Visual Attribute (WHITE_VA) (Default Color of the record)
              Font – Arial
              Size – 8
              Style – Plain
              Font width - Normal
              Font Weight - Bold
    Foreground Color – Black
              Background Color – White
              Fill Pattern – Transparent
    Step 3: Add Following code to Block-level Trigger WHEN-NEW-RECORD- INSTANCE, POST-BLOCK
    (Add to the block, which has these records)
    -- Following code will only highlight an item
    DISPLAY_ITEM(<block_name>.<item_name>,'BLUE_VA');
    -- Following code will highlight complete Record (ref: DISPLAY_ITEM example)
    DECLARE
              cur_itm VARCHAR2(80);
              cur_block VARCHAR2(80) := :System.Cursor_Block;
    BEGIN
    cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
    WHILE ( cur_itm IS NOT NULL ) LOOP
    cur_itm := cur_block||'.'||cur_itm;
    Display_Item( cur_itm, 'BLUE_VA');
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
    END LOOP;
    END;
    Step 4: Add Following code to Block-level Trigger PRE-RECORD, PRE-BLOCK
    (Add to the block, which has these records)
    -- Following code will only highlight an item
    DISPLAY_ITEM(<block_name>.<item_name>,'WHITE_VA');
    -- Following code will highlight complete Record (ref: DISPLAY_ITEM example)
    DECLARE
              cur_itm VARCHAR2(80);
              cur_block VARCHAR2(80) := :System.Cursor_Block;
    BEGIN
    cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
    WHILE ( cur_itm IS NOT NULL ) LOOP
    cur_itm := cur_block||'.'||cur_itm;
    Display_Item( cur_itm, 'WHITE_VA');
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
    END LOOP;
    END;
    I am using the above code in one of my forms and I so far haven't seen any problem

  • Defaulting search fields in af:query component

    I have a search popup with af:query and a result table. My requirement is to default some of the fields in af:query when the popup launches.
    Since i could not achieve this, i wrote a temporary work around which should be removed as soon as we find a permanent solution.
    Work around:
    1. Wrote a method showQBE() in the bean. Wrote the logic to default the QBE fields by manually iterating through the component binding.
    2. Call showQBE() in the visible property of the af:query so that this executed when the popup is invoked.
    public boolean showQBE(){
    RichQuery rq = this.getResourcePickerQBE(); // Bindning for QBE
    QueryDescriptor dq = rq.getValue();
    List children = rq.getChildren();
    Iterator childrenItr = children.iterator();
    while (childrenItr.hasNext()) {
    RichPanelGroupLayout rpcl = (RichPanelGroupLayout)childrenItr.next();
    Iterator rpclItr = rpcl.getChildren().iterator();
    while (rpclItr.hasNext()) {
    // RichPanelLabelAndMessage
    UIComponent rplm = (UIComponent)rpclItr.next();
    Iterator rplmItr = rplm.getChildren().iterator();
    while (rplmItr.hasNext()) {
    UIComponent comp = (UIComponent)rplmItr.next();
    Iterator compItr = comp.getChildren().iterator();
    while (compItr.hasNext()) {
    UIComponent comp1 = (UIComponent)compItr.next();
    String class2 = comp1.getClass().getSimpleName();
    if (class2.equals("RichInputText")) {
    RichInputText rit = (RichInputText)comp1;
    if ("value40".equals(rit.getId()) ||
    "value41".equals(rit.getId())) {
    rit.setValue("Bryan");
    } else if ("value50".equals(rit.getId()) ||
    "value51".equals(rit.getId())) {
    rit.setValue(ADFUtil.evaluateEL("Adams"));
    } else
    rit.setValue("");
    AdfFacesContext.getCurrentInstance().addPartialTarget(rit);
    Popup code:
    <af:popup id="resourceSearch1"
    popupFetchListener="#{backingBeanScope.TerritoryProfileBean.showParentTerrOwnerReportsForTerrTeamMember}"
    binding="#{backingBeanScope.TerritoryProfileBean.resourcePickerPopup}"
    popupCanceledListener="#{backingBeanScope.TerritoryProfileBean.cancelButtonListener}"
    contentDelivery="lazyUncached" childCreation="deferred">
    <af:dialog id="d20" type="none" title="#{salesterrmgmtterritoriesuiGenBundle}">
    <af:panelGroupLayout id="pgl191" layout="vertical">
    <af:panelHeader id="ph21" text=" ">
    <af:query id="qryId2" headerText="#{applcoreBundle.QUERY_SEARCH_HEADER_TEXT}" disclosed="true"
    value="#{bindings.ResourcePickerSearchQuery.queryDescriptor}"
    model="#{bindings.ResourcePickerSearchQuery.queryModel}"
    queryListener="#{backingBeanScope.TerritoryProfileBean.onSearchBtn}"
    saveQueryMode="hidden" resultComponentId="::t3"
    binding="#{backingBeanScope.TerritoryProfileBean.resourcePickerQBE}"
    visible ="#{backingBeanScope.TerritoryProfileBean.showQBE}"
    queryOperationListener="#{backingBeanScope.TerritoryProfileBean.queryOperationListener}"/>
    </af:panelHeader>
    <af:panelStretchLayout id="psl2" startWidth="50px"
    visible="#{backingBeanScope.TerritoryProfileBean.showSearchTable}">
    <f:facet name="bottom"/>
    <f:facet name="center">
    <af:table value="#{bindings.ResourcesPicker.collectionModel}"
    var="row"
    rows="#{bindings.ResourcesPicker.rangeSize}"
    emptyText="#{bindings.ResourcesPicker.viewable ? applcoreBundle.TABLE_EMPTY_TEXT_NO_ROWS_YET : applcoreBundle.TABLE_EMPTY_TEXT_ACCESS_DENIED}"
    fetchSize="#{bindings.ResourcesPicker.rangeSize}"
    rowBandingInterval="0"
    selectionListener="#{bindings.ResourcesPicker.collectionModel.makeCurrent}"
    rowSelection="multiple" id="t3"
    binding="#{backingBeanScope.TerritoryProfileBean.resourcePickerTable}"
    contentDelivery="immediate"
    columnSelection="multiple" autoHeightRows="10"
    summary="#{salesterrmgmtterritoriesuiBundle.THIS_TABLE_LISTS_THE_RESOURCES}">
    <af:column sortProperty="ResourceName" sortable="true"
    headerText="#{bindings.ResourcesPicker.hints.ResourceName.label}"
    id="c3" rowHeader="unstyled">
    <af:inputText value="#{row.bindings.ResourceName.inputValue}"
    label="#{bindings.ResourcesPicker.hints.ResourceName.label}"
    required="#{bindings.ResourcesPicker.hints.ResourceName.mandatory}"
    columns="#{bindings.ResourcesPicker.hints.ResourceName.displayWidth}"
    maximumLength="#{bindings.ResourcesPicker.hints.ResourceName.precision}"
    shortDesc="#{bindings.ResourcesPicker.hints.ResourceName.tooltip}"
    id="it6">
    <f:validator binding="#{row.bindings.ResourceName.validator}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="PrimaryPhoneNumber" sortable="true"
    headerText="#{bindings.ResourcesPicker.hints.PrimaryPhoneNumber.label}"
    id="c6">
    <af:inputText value="#{row.bindings.PrimaryPhoneNumber.inputValue}"
    label="#{bindings.ResourcesPicker.hints.PrimaryPhoneNumber.label}"
    required="#{bindings.ResourcesPicker.hints.PrimaryPhoneNumber.mandatory}"
    columns="#{bindings.ResourcesPicker.hints.PrimaryPhoneNumber.displayWidth}"
    maximumLength="#{bindings.ResourcesPicker.hints.PrimaryPhoneNumber.precision}"
    shortDesc="#{bindings.ResourcesPicker.hints.PrimaryPhoneNumber.tooltip}"
    id="it10">
    <f:validator binding="#{row.bindings.PrimaryPhoneNumber.validator}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="EmailAddress" sortable="true"
    headerText="#{bindings.ResourcesPicker.hints.EmailAddress.label}"
    id="c5">
    <af:inputText value="#{row.bindings.EmailAddress.inputValue}"
    label="#{bindings.ResourcesPicker.hints.EmailAddress.label}"
    required="#{bindings.ResourcesPicker.hints.EmailAddress.mandatory}"
    columns="#{bindings.ResourcesPicker.hints.EmailAddress.displayWidth}"
    maximumLength="#{bindings.ResourcesPicker.hints.EmailAddress.precision}"
    shortDesc="#{bindings.ResourcesPicker.hints.EmailAddress.tooltip}"
    id="it1">
    <f:validator binding="#{row.bindings.EmailAddress.validator}"/>
    </af:inputText>
    </af:column>
    </af:table>
    </f:facet>
    </af:panelStretchLayout>
    </af:panelGroupLayout>
    <f:facet name="buttonBar">
    <af:group id="g41">
    <af:commandButton actionListener="#{backingBeanScope.TerritoryProfileBean.onApplyOrDoneFromResourcePicker}"
    id="cmdDone1" immediate="true"
    partialSubmit="true"
    text="#{acrGenBundle}">
    <af:resetActionListener/>
    </af:commandButton>
    <af:commandButton id="cb5" actionListener="#{backingBeanScope.TerritoryProfileBean.cancelButtonListener}"
    text="#{acrGenBundle}"/>
    </af:group>
    </f:facet>
    </af:dialog>
    </af:popup>
    * I created the same thread ADFbc forum: http://myforums.oracle.com/jive3/thread.jspa?threadID=632625. Since there is no response posting here.
    Thanks

    The af:query is based on a View Criteria from a PVO, so i wrote the following code to set the value for the criteria items in the View criteria.
    I wrote it in view object's getter in the AMImpl.java
    public ResourcePickerVOImpl getResourcePicker(){
    ResourcePickerVOImpl vo = findViewObject("ResourcesPicker");
    ViewCriteria vc = (ViewCriteria)vo.getViewCriteria("ResourcePickerSearch");
    ViewCriteriaManager vm = vc.getViewCriteriaManager();
    Row rows[] = vc.getAllRowsInRange();
    for(Row row : rows){
    List<ViewCriteriaItem> cit = ((ViewCriteriaRow)row).getCriteriaItems();
    Iterator<ViewCriteriaItem> itr = cit.iterator();
    while(itr.hasNext()){
    ViewCriteriaItem vtr = itr.next();
    vtr.setValue("Mathew");
    System.out.println("Column name: " + vtr.getColumnName() + " Value: " + vtr.getValue());
    I changed the contextDelivery = immediate and childrenCreation = immediate since the popup was always showing empty search fields.
    After changing this property i am seeing a new issue -> First time when i open the popup nothing is shown in the search fields. Then from the subsequent times it is showing the values defaulted through the above code.
    Any idea!
    Edited by: [email protected] on Aug 26, 2010 4:30 AM

  • Accessing fields of the af:Query Component

    Hi all,
    I need to get the value of a dynamic field that is added to the query component at runtime.
    In my application there is field named "Member Id" which adds a "select one component" in the advanced search mode.
    This "select one component" has a string value "self".
    What I need to do is,
    When the value "self" is selected from the "select one component" I need to use the Id of the user
    as the "Member Id" for the search query.
    Is it possible achive this by using af:query component ? or is there a different approch?
    I'm using JDeveloper 11.1.1.0.1
    Thanks,
    Melaka

    Melaka,
    first create a custom View Object Class for your View Object from the Java Classes pane. Then override the buildQuery() method of the ViewObjectImpl by writing the following code:
    @Override
    protected String buildQuery(int noUserParams, boolean forRowCount) {
    // call super.buildQuery() to allow the framework to build the query
    String query = super.buildQuery(noUserParams, forRowCount);
    // here you will modify the query
    // if the query contains your keyword
    if (query.contains("'self'")) {
    // replace it with the actual user id
    // return the modified query
    return query;
    I am sure there are other cleaner ways to accomplish this.
    Consider for example using two separate attributes: one Transient for your "Member Id" query criteria - what is shown to the user - and another attribute actually mapped to a column that is used for querying. You set the value of the second attribute as the first one changes.
    Regards,
    Nick

  • While trying to change a BOM with transaction CS02, a runtime error appears

    While trying to change a BOM with transaction CS02, a runtime error appears.
    In intial screen he entered material ,plant BOM usage and date valid from  after executed then id displayed item list in that he wantu2019s delete one item, he has been deleted selected item after that when he was saving he is getting runtime error
    Developer trace
    ABAP Program SAPLKED1_WRITE_CE4_BPS1                 .
    Source LKED1_WRITE_CE4_BPS1U01                  Line 30.
    Error Code SAPSQL_ARRAY_INSERT_DUPREC.
    Module  $Id: //bas/640_REL/src/krn/runt/absapsql.c#17 $ SAP.
    Function HandleRsqlErrors Line 775.
    RABAX: level LEV_RX_STDERR completed.
    RABAX: level LEV_RX_RFC_ERROR entered.
    RABAX: level LEV_RX_RFC_ERROR completed.
    RABAX: level LEV_RX_RFC_CLOSE entered.
    RABAX: level LEV_RX_RFC_CLOSE completed.
    RABAX: level LEV_RX_IMC_ERROR entered.
    RABAX: level LEV_RX_IMC_ERROR completed.
    RABAX: level LEV_RX_DATASET_CLOSE entered.
    RABAX: level LEV_RX_DATASET_CLOSE completed.
    RABAX: level LEV_RX_RESET_SHMLOCKS entered.
    RABAX: level LEV_RX_RESET_SHMLOCKS completed.
    RABAX: level LEV_RX_ERROR_SAVE entered.
    RABAX: level LEV_RX_ERROR_SAVE completed.
    RABAX: level LEV_RX_ERROR_TPDA entered.
    RABAX: level LEV_RX_ERROR_TPDA completed.
    RABAX: level LEV_RX_PXA_RELEASE_RUDI entered.
    RABAX: level LEV_RX_PXA_RELEASE_RUDI completed.
    RABAX: level LEV_RX_LIVE_CACHE_CLEANUP entered.
    RABAX: level LEV_RX_LIVE_CACHE_CLEANUP completed.
    RABAX: level LEV_RX_END entered.
    RABAX: level LEV_RX_END completed.
    RABAX: end RX_RFC
    In sm21
    Perform rollback
    Run-time error "SAPSQL_ARRAY_INSERT_DUPREC" occurred
         Short dump "090618 110101 donalda 11557 " generated
    Runtime Error          SAPSQL_ARRAY_INSERT_DUPREC
    Exception              CX_SY_OPEN_SQL_DB
           Occurred on     18.06.2009 at   11:01:01
    The ABAP/4 Open SQL array insert results in duplicate database records.
    What happened?
    Error in ABAP application program.
    The current ABAP program "SAPLKED1_WRITE_CE4_BPS1" had to be terminated because
    one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    What can you do?
    Print out the error message (using the "Print" function)
    and make a note of the actions and input that caused the
    error.
    To resolve the problem, contact your SAP system administrator.
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer
    termination messages, especially those beyond their normal deletion
    date.
    Error analysis
    An exception occurred. This exception is dealt with in more detail below
    . The exception, which is assigned to the class 'CX_SY_OPEN_SQL_DB', was
    neither
    caught nor passed along using a RAISING clause, in the procedure
    "RKE_WRITE_CE4__BPS1" "(FUNCTION)"
    Since the caller of the procedure could not have expected this exception
    to occur, the running program was terminated.
    The reason for the exception is:
    If you use an ABAP/4 Open SQL array insert to insert a record in
    the database and that record already exists with the same key,
    this results in a termination.
    (With an ABAP/4 Open SQL single record insert in the same error
    situation, processing does not terminate, but SY-SUBRC is set to 4.)
    How to correct the error
    The exception must either be prevented, caught within the procedure
    "RKE_WRITE_CE4__BPS1"
    "(FUNCTION)", or declared in the procedure's RAISING clause.
    To prevent the exception, note the following:
    Use an ABAP/4 Open SQL array insert only if you are sure that none of
    the records passed already exists in the database.
    You may able to find an interim solution to the problem
    in the SAP note system. If you have access to the note system yourself,
    use the following search criteria:
    "SAPSQL_ARRAY_INSERT_DUPREC" CX_SY_OPEN_SQL_DBC
    "SAPLKED1_WRITE_CE4_BPS1" or "LKED1_WRITE_CE4_BPS1U01"
    "RKE_WRITE_CE4__BPS1"
    If you cannot solve the problem yourself, please send the
    following documents to SAP:
    1. A hard copy print describing the problem.
       To obtain this, select the "Print" function on the current screen.
    2. A suitable hardcopy prinout of the system log.
       To obtain this, call the system log with Transaction SM21
       and select the "Print" function to print out the relevant
       part.
    3. If the programs are your own programs or modified SAP programs,
       supply the source code.
       To do this, you can either use the "PRINT" command in the editor or
       print the programs using the report RSINCL00.
    4. Details regarding the conditions under which the error occurred
       or which actions and input led to the error.

    Hi ,
    you are getting beacuse u are trying to do mass update to database.
    Please check that below note are applicable to your system.
    Note 453313 - DBIF_RSQL_ERROR_INTERNAL for mass insert
    Note 869534 - AFS MRP doesn't work properly with all BOM item categories
    Thanks Rishi Abrol

  • Setting default value read from user session, for an LOV in Query component

    I want to set the default value of a field in VO that participates in a named view criteria and thereby in Query component. That field is configured with an LOV by mean of a view accessor. The values are Y and N and the corresponding display strings obtained from view accessor are true and false respectively.
    I am able to set the default value by setting the value of the criteria item corresponding to that field in view criteria. I am setting the value as either Y or N and I am able to corresponding display string as per the view accessor, on the query component when it is rendered.
    I want to read the defauilt value from the ADF BC user session and set it as default value. I tried setting the values as "adf.userSession.userData.usageFlag". Iam ensuring that the attribute usageFlag is set before the view activity that has the query component is invoked. But this is ending up showing no default value in the Query component when rendered.
    Can any one let me know how to go about with this?

    I made up your table since you didn't provide some example, but I'm sure this will give you the picture:
    SQL> var run_type varchar2(1)
    SQL> exec :run_type := 'A'
    PL/SQL procedure successfully completed.
    SQL> create table my_cycles as select level cycle_id
      2                            ,      level cycle_status
      3                            from   dual connect by level <= 5;
    Table created.
    SQL> select cycle_id
      2  from   my_cycles
      3  where  case
      4           when :run_type = 'D' and cycle_status  = 1 then 1
      5           when :run_type != 'D' and cycle_status  in ( 2, 3 ) then 1
      6         end = 1;
      CYCLE_ID
             2
             3
    2 rows selected.
    SQL> exec :run_type := 'D';
    PL/SQL procedure successfully completed.
    SQL> /
      CYCLE_ID
             1
    1 row selected.
    SQL>

  • Incorrect operators in af:query component

    We have created a search popup using af:query component based on a view criteria.
    The view criteria uses two string[varchar2(60) in EO] attributes named "Name" and "Owner".
    TerritorySearchViewCriteria
    Group
    Name CONTAINS :BindTerritoryName -- String in VO, Varchar2(60) in EO
    AND Owner CONTAINS :BindOwnerName -- String in VO, varchar2(360) in EO
    Issue:
    The operators drop down shows some irrelevant search operators(not meaningful to strings) such as "BETWEEN",
    "NOT BETWEEN", "BEFORE", "AFTER", "ON OR AFTER" and "ON OR BEFORE". Because of this we are seeing some unexpected
    search results when this operators are used for searching.
    On looking at the Bali site and BLAF guidelines page it clearly states that the list of operators for string are
    "EQUALS", "NOT EQUALS", "STARTS WITH", "ENDS WITH", "CONTAINS", "DOES NOT CONTAIN", "LIKE", "IS BLANK" and "IS NOT
    BLANK".
    Bali link: http://dadvmc0454.us.oracle.com:9002/faces-11.1.1.2.0/faces/components/query.jspx?_afrLoop=19876843626481699&_afrWindowMode=0&_afrWindowId=null
    BLAF guidelines: http://blafstaging.us.oracle.com/blafSite/guidelines5/search.html#queryPanelCond
    Attribute Definition in TerritoryEO:
    <Attribute
    Name="Name"
    IsNotNull="true"
    Precision="60"
    ColumnName="NAME"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    SQLType="VARCHAR"
    TableName="MOT_TERRITORIES">
    Attribute definition in TerritoryVO:
    <ViewAttribute
    Name="Name"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="Name"
    EntityUsage="Territory"
    AliasName="NAME">
    Query component in ManageTerritories.jsff:
    <af:query id="qryId1" headerText="#{acrGenBundle['Header.Search']}"
    disclosed="true"
    value="#{bindings.TerritorySearchQuery.queryDescriptor}"
    model="#{bindings.TerritorySearchQuery.queryModel}"
    queryListener="#{backingBeanScope.ManageTerritoriesBean.onTerritorySearchQuery}"
    queryOperationListener="#{bindings.TerritorySearchQuery.processQueryOperation}"
    resultComponentId="::pc2:resId1"
    saveQueryMode="hidden"
    modeChangeVisible="false"
    conjunctionReadOnly="true"
    styleClass="AFStretchWidth"/>
    Is there a way to eliminate the operators which does not make sense for String type.
    Thanks,
    Sekar

    As per the guidelines mentioned for String, You could remove the unwanted operators from the view criteria item.
    The example below shows - how the unwanted operators namely BETWEEN & NOTBETWEEN could be removed.
    For more details, look into the following section 27.3.3 in the developer's guide:
    http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/web_search_bc.htm#CIHIDGGC
    Sample:
    <ViewCriteria
    Name="EmployeesVOByFirstNameOrLastName"
    ViewObjectName="model.views.EmployeesVO"
    Conjunction="AND">
    <Properties>
    <CustomProperties>
    <Property
    Name="displayOperators"
    Value="InAdvancedMode"/>
    <Property
    Name="autoExecute"
    Value="false"/>
    <Property
    Name="allowConjunctionOverride"
    Value="true"/>
    <Property
    Name="showInList"
    Value="true"/>
    <Property
    Name="mode"
    Value="Basic"/>
    </CustomProperties>
    </Properties>
    <ViewCriteriaRow
    Name="vcrow0"
    UpperColumns="1">
    <ViewCriteriaItem
    Name="FirstName"
    ViewAttribute="FirstName"
    Operator="CONTAINS"
    Conjunction="AND"
    Value=""
    Required="Optional">
    *<CompOper*
    Name="Category"
    ToDo="-1"
    Oper="BETWEEN"/>
    *<CompOper*
    Name="Category"
    ToDo="-1"
    Oper="NOTBETWEEN"/>
    </ViewCriteriaItem>
    <ViewCriteriaItem
    Name="LastName"
    ViewAttribute="LastName"
    Operator="CONTAINS"
    Conjunction="OR"
    Value=""
    Required="Optional"/>
    </ViewCriteriaRow>
    </ViewCriteria>
    Thanks,
    Navaneeth

  • Add custom field to af:query component?

    Anyone had any experience overriding af:query copmonent? I need to add my custom search field (to query component), which would have a search icon next to it, and on click, a popup widow would open containing my custom task flow where I could select a record with certain value and on return that custom field (in query component) would get populated with selected value. I hope I'm being clear. Please point me to any useful information. Is that even possible? I use JDeveloper 11.1.2.3.4.0 Regards, Marko

    Hi,
    af:query is a component that comes as is. Its not designed for customization in that you can add your own fields. If you have a requirement for this then
    1. expose a method on the VO Impl or AM Impl that expect arguments (your query parameters)
    2. Use the arguments to populate bind variables used by a ViewCriteria
    3. Apply the View Criteria to the View Object
    4. Execte the View Object
    5. Drag and drop the method from the DC panel as a parameter form
    6. Ensure the result table PartialTrigger property is pointing to the button ID of the parameter form
    7. Change whatever UI component you want to change in the parameter form
    This gets you going ...
    Frank

Maybe you are looking for

  • SCCMReporting.log growing under %AppData%\Local\Temp

    Tried to lookup this from the net, but couldn't find anything.. so the problem is that my reporting services account on the reporting services point is having this logfile called SCCMReporting.log under %AppData%\Local\Temp and it consumes 30GB of di

  • Cs6 trial on mac not opening error 4960

    trying to download cs6 trial on my mac i open and a error cannot open disk something error 4960. download bar/window keeps running as if it will extract but it wont

  • HT1414 I dont want to restore my phone. How do I go back?

    I'm getting the iTunes icon and the USB cord. I don't want to restore my phone. How do I cancel and go back to my home screen?

  • Sync from the favorites on win7

    Hi all, i have a big problem: Since i reinstall my win7 Notebook (Win7 Pro) i get no favorites from my icloud. But if i create a new favorite on my win pc, i can see this link on my ipad and my iphone. If i create a link on my ipad, i can see it on m

  • Multiple Person in Company entry

    Hi , Is it possible to have more than one person listed in a company contact ? For example i have a company called 'ACME' but it only allows me to have one contact name in it