Assistance SP to restrict OQUT.DocDueDate based on specific Item

Hello
I am trying to create a SP which restricts the 'Valid to' date of Quotes which contain a specific Item: (OQUT.DocDueDate)
--No valid to date later than 30 september for WGR -1-BSPP
If @object_type = '23' and @transaction_type IN ('A','U')
BEGIN
If Exists (Select T0.DocEntry from [dbo].[OQUT] T0 Inner Join QUT1 T1 On T0.DocEntry=T1.DocEntry
Where T0.DocEntry = @list_of_cols_val_tab_del and T1.ItemCode = 'WGR-1-BSPP' AND T0.DocDueDate > '30.09.2014')
BEGIN
Select @error = -1,
@error_message = 'Adjust valid to date, must be before 30th September'
End
End
The query is executing ok without error but I get following error when trying to add a quote with the part:
"The conversion of a varchar data type to a datetime data type resulted in an out-of-range value (CINF.)"
I can see that my understanding of the dating part is wrong - can anyone assist?
Thanks
Karen

Try this:
--No valid to date later than 30 september for WGR -1-BSPP
If @object_type = '23' and @transaction_type IN ('A','U')
BEGIN
If Exists (Select T0.DocEntry from [dbo].[OQUT] T0 Inner Join QUT1 T1 On T0.DocEntry=T1.DocEntry
Where T0.DocEntry = @list_of_cols_val_tab_del and T1.ItemCode = 'WGR-1-BSPP' AND T0.DocDueDate > convert(datetime,'20140930',103))
BEGIN
Select @error = -1,
@error_message = 'Adjust valid to date, must be before 30th September'
End
End
Regards,
JC.

Similar Messages

  • Restricting the values based on keyfigures.

    Hi All,
    Good Morning..
    I have a query on Bex reporting.
    I want to calculate transit aging.Just i want to find the difference between the two dates.
    I have one more field called quantity.
    I want to calculate the difference of dates only whose quantity is "ZERO". I can restrict the keyfigures based on characteristics. But for my case i want to restrict the keyfigures based on Quantity keyfigures.
    Is it possible in Query designer.
    Thanks in advance.
    Thanks,
    Siva.

    Hi,
    p.o number ______p.odate_______consimentdate______qty__aging
    87000001______01.02.2009______02.02.2009________1___ nil
    87000002______05.02.2009______07.02.2009________0____( current date - consiment date)
    Craete Two formula Variables with replacement path in columns..
    1. One is for PO date and replace with Key.
    2. Other is forconsiment date and replace with Key.
    then just drag and drop in two columns in report and see the output. Then create one formula and do substraction. In another column you craete one more formula and use If condition
    Column A = p.odate (with Replacemet variable value)
    Column B = consimentdate (with Replacemet variable value)
    Column C = B-A
    Column D =  If QTY <> 0 then C
    Thanks
    Reddy

  • Access restriction in IM52 based on company code and investment reason

    Hi,
    How can we have access restriction in IM52 based on company code and investment reason?
    thanks
    Randeep

    hi
    please check the authorization object for the transaction
    company code you can

  • Restrict SR Type based on responsibility

    Hi all,
    I am trying to restrict SR Type based on responsibility. Oracle 11.5.9 document has the following statement. has anyone got this going ? or is there a bug??
    Thanks,
    Gana
    3.10.1.29. Map Service Request Types by Responsibility
    To be consistent with iSupport, Service Request Types can be mapped to responsibilities.
    This allows a customer to filter out the unnecessary or unrelated Service Request Types
    and display the relevant ones to specific responsibilities in the Create, Update and View
    Service Request forms. A Street Service’s agent will only see Service Request types of
    Abandoned Vehicles and Street Cleaning and not Animal Retrieval.

    Thank you.
    But this is a Bug for version earlier then 11.5.9 and it is declared by Oracle.
    It is a enhancement request number 2445606 and is incorporated into the released 11.5.9 version of the product, but it does not function in any earlier release.
    The Profile option is
    'Service: Use SR Type - Responsibility Mapping'
    This profile can be set at Site and / or Responsibility Level.
    If set to 'Y' at only the Site level, this indicates that the Type will always be filtered by Responsibility, no matter what the responsibility is. In this case, the Service Request Types should be mapped to the required responsbilities.
    If set to 'Y' at Site level, and 'N' for Responsibility say 'R1', then responsibility 'R1' will have access to all SR types, but for all other responsibilities, SR types will be filtered to the list of what is mapped to the Responsibility.
    Thank you

  • How to restrict VK11 access based on condition class D (Tax)

    hi ,
    I have a requirement to restrict VK11 access based on condition class D (Tax). Because all users should not have access to maintain tax data in VK11 while general pricing data they can maintain. when condition class is D then we should have control.
    Thanks
    Akhilesh

    Hi Akhilesh,
    Please find the below link and click on View article.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a92195a9-0b01-0010-909c-f330ea4a585c
    how to create authorization object?
    Thanks
    Dasaradha

  • How can we restrict EQL result based on session value

    How can we restrict EQL result based on session value or by checking with EBS secured function?
    Example: I create a Item Search Dashboard but I have more than one inventory organizations and I want to restrict dashboard to bring inventory org respective data by validating responsibility/profile option.
    Can anyone help me on this or if my concept is wrong so can anyone please guide me?

    Hi Bob,
    Thank you. Sorry for the late reply but I was busy in other stuff. I did the jar file and copied that Jar file into .ear/APP-INF/lib and copied on server and updated the df.securitymanager property under framework settings on Endeca Studio and restarted Endeca Server and Studio but seems like my class didn't get read. Kindly suggest and find below snippet of code;
        public void applySecurity(PortletRequest request, MDEXState mdexState, Query query)
                throws MDEXSecurityException
      init(request);
      String remoteUser = request.getRemoteUser();
      String recordFilterExpression = "XX";
      if(recordFilterExpression != null) {
      DataSource ds;
      try {
      ds = new DataSource(request, mdexState.getId());
      try {
      ExpressionBase expression = ds.parseLQLExpression("FND_USER_NAME='" + remoteUser + "'");
      DataSourceFilter dataSourceFilter = new DataSourceFilter(expression); 
      } catch (Exception f) {
      throw new MDEXSecurityException("Unable to apply Expression", f);
      } catch (DataSourceException e) {
      throw new MDEXSecurityException("Unable to create DataSource", e);

  • Javascript needed - need checkbox to check automatically based on selected item from dropdown list

    I am building a fillable form.  In this form, I have created items in a dropdown list.  Based on the item picked from the dropdown list, I need a corresponding checkbox to be checked.  I am certain there is an easy javascript to resolve my current problem.  Please assist.
    For example: dropdown list field (SubSupplier1) -   Demolition                            export value 2
                                                                                    Rough Carpentry Labor       export value 4
                                                                                    Rough Carpentry Material    export value 3
    I need the corresponding checkbox (SalesTax1) to automatically be checked when Demolition (export value 2) or Rough Carpentry Material (export value 3) is selected.
    Thank you,
    Jennifer

    Hi Jennifer,
    This should help you do what you need. Place it in the Custom Calculation property of the dropbox and select "commit selected value immediately" in the fields options:
    var drop = this.getField("SubSupplier1");
    var check = this.getField("SalesTax1");
    if ((drop.value == 2) || (drop.value == 3)){
    check.checkThisBox(0,true);
    else {
    check.checkThisBox(0,false);
    The code is asking if the export value of the field is either '2' or '3' and if so, check the box.
    Otherwise uncheck the box.
    If you don't want it to uncheck on other selections, remove the 'else' section of code.

  • Credit Limit based on Open Items only.

    Dear Friends,
    Is it possible to set credit limit based on Open Items only ( Document Type RV)
    If the credit limit is crossed for accounting documents not yet cleared, then system should allow creating sales order, but block any deliveries further.
    Just to add this, we are using Oldest Open Item, to make sure system blocks deliveries if even one Billing document is overdue for payment.
    << Moderator message - Please do not promise points >>
    << Moderator message - Everyone's problem is important. Please do not ask for help quickly. >>
    Regards
    Trupti Deulkar
    Edited by: Rob Burbank on Dec 16, 2010 4:02 PM

    Hi,
    AT FD32,
    For respective customers Credit Limit should be made 99999999....(i.e maximum)
    Goto OVA8. Select the respective Credit Control area, Risk category & Customer Group.
    tick-> OpenItems
    Max.Open items 100% and Nodays Open here you can maintain the grace days (after the payment term limit expires) is allowed to do the transaction for respective customer.
    if grace days are '0', then as soon as payment term limit is expires system will block the transactions selected.
    Thank You,
    RB.
    Edited by: RB@007 on Dec 16, 2010 3:12 PM

  • How to find Based on PO item find ProjSt or Common Stock?

    Hi Gurus,
    How to find based on PO item and line item number find whether Project stock or it's common stock?  It's there any standard report is there? or provide me table name use with SQVI transaction code?
    Thanks and Regards,
    Deethya.B

    PO with account assignment category P - it is created for projects and need to provide account details in the tab.
    You can check these details from table EKPO - ( EKPO-KNTTP equal to P).
    Project stock can be finding in MMBE using special stock indicator as Q.  Details can be getting from table MSPR.
    Regards,
    Narendra.

  • How I restrict Scheduling agreement type for specific Purchase organization.

    Hello Experts,
    I have created Scheduling agreement type (ZLT). I want to restrict this agreement type for specific purchasing organization.
    I have search many threads but I didn't get solution.
    Is it possible through Configuration or user exit.
    Kindly give me solution in details.
    Thanks,
    Ranjit Kumar.

    hi,
    I don't think that there is standard configuration to restrict Purchasing document type for purchasing group. you can restrict this trough user authorization or you can make user exit development.
    Regards,
    mukesh

  • How to restrict bidders must response for all items?

    hi experts
       we used SRM7.0 with Standalone Scenario.
       we need to restrict the bidder response for all items. in RFx items tab page, there is a checkbox 'RFX response Required for All items'. but it is doesn't work for this purpose. If the bidder reponse without price, they get warning message "Line 0001: '0' in the price field means that you are offering the item for free " . [there should be no free goods]
       how to solve it?    thanks in advance.
      regards
        claud

    Hi,
    In RFx, in Item tab, you have an indicator "RFx Response required for all the items", but unfortunately it does not work! I don't know why?
    One way to make it is, to do validation using BBP_DOC_CHECK_BADI. Other way is to create subline items under outline and check the "lot" indicator for the outlne. For this, you must have assigned HIER_SRM to the process type of RFx and RFx Response. Also refer to note  1267549 while making this assignment. Then if the bidder quotes for one item, then he/she has to quote for all items.
    If you wanted to allow bidder to quote there own quantity check "Bidder can Change Quantities" in item tabl of RFx. Then the bidder gets separate columns as Required Quantity and Submitted Quantity. However note that, the system will not generate any message if the bidder quotes more than the required quantity. If you wanted to so, you need to validate the entry using the same BAdI.
    Hope this has answered your question.
    Ganapathi

  • How to default inv mtl accnt based on the item categories for all trxns

    Hi all,
    There is a requirement for defaulting inventory material account based on the item categories accounts defined in the category accounts window. instead of defaulting from the inventory organization parameters.
    I researched on that and found that we need to do product line accounting setups and modify the accounting client extension code ( Cost Management PDF)
    Am i correct in the approach? will i succeed if we go ahead and do these?
    Need your kind comments....
    Regards,
    Prasad

    Hi,
    I can think of one of the probable solution for your requirement.
    Your need to create new condition table with item Category as one of the key combination.  I think you need to update the item category in field catalog as well as in Doc Structures. Then maintain free goods condition record all the item categories except for the Return item category. This way you can exclude free goods activation for return items.
    Note : If the number of active item categories are more then it may be difficult to maintain condition records for the item categories.
    Hope this will help
    Regards,
    Sanjay

  • Restrict deletion of sales order line items

    Hi,
    I need to restrict deleting of sales order line item, I think we can use the user exit, MV45AFZB, USEREXIT_CHECK_XVBAP_FOR_DELE.
    But when i set the flag to 'X', even though it does not delete at tht instance when the sales order save is clicked again the line item gets deleted.
    ANy idea , to prevent that?
    Thanks
    Keshi

    Hi Keshi,
    That is the correct exit, we are using the same without any problem. Just set US_EXIT  = CHARX.
    Regards,
    John.

  • How to auto populate a field based on drop down list unless specific item is selected

    Hi all,
    Apologies if I have posted this in the wrong area but I am new to Adobe LiveCycle, JavaScript and these forums.
    I am trying to build an Acrobat form using LiveCycle but am having trouble with the drop down lists.
    Inititaly I simply wanted to populate fields in one table based on the selection of a corresponding drop down list in another table.
    I used the following code and it worked fine:
    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)
    var fFrom = xfa.resolveNodes("Workbook.Content.Table1.Row3.AppropriationDetails[*].Row4.Cell1");
    var fTo = xfa.resolveNodes("Workbook.Content.Table2.Row3.AppropriationDetails[*].Row4.Cell1");
    for (var i=0; i <= fFrom.length-1; i++) {
         fTo.item(i).rawValue = fFrom.item(i).boundItem(xfa.event.newText);
    The problem is that now I want the above code to work UNLESS one of the items in the dropdown list is specifically selected in which case I want the text box in the other table to display a message such as "Enter details in the field below".
    I have tried to create an If Else statement using the following code:
    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)
    var fFrom = xfa.resolveNodes("Workbook.Content.Table1.Row3.AppropriationDetails[*].Row4.Cell1");
    var fTo = xfa.resolveNodes("Workbook.Content.Table2.Row3.AppropriationDetails[*].Row4.Cell1"); 
    for (var i=0; i <= fFrom.length-1; i++) {
         if (fFrom.item(i).rawvalue = "Option 3"){
         fTo.item(i).rawValue = "Enter details in the field below";
         else {
         fTo.item(i).rawValue = fFrom.item(i).boundItem(xfa.event.newText);
    The code now populates the field with "Enter the details in the field below" no matter what item I select from the dropdown list.
    Your help is greatly appreciated.
    Cheers,
    ozzy_q

    Follow Up:
    Ok so ive changed things up a bit and have had some more success.
    I have used a Switch statement in my For loop to perform different actions based on the item selected.
    The code looks like this:
    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)
    var fFrom = xfa.resolveNodes("Workbook.Content.Table1.Row3.AppropriationDetails[*] .Row4.Cell1");
    var fTo = xfa.resolveNodes("Workbook.Content.Table2.Row3.AppropriationDetails[* ].Row4.Cell1");
    for (var i=0; i <= fFrom.length-1; i++) {
         switch (fFrom.item(i).rawValue)
         case "Option 3":
         fTo.item(i).rawValue = "Enter the details in the field below";
         break;
         default:
         fTo.item(i).rawValue = fFrom.item(i).boundItem(xfa.event.newText);
         break;
    This code solves my problem but has thrown up a new issue:
    When i select Option 1 or 2 from the dropdown list  the change in the text field is instantaneous, however if I select Option 3 it wont appear in the text field until I either select Option 3 a second time or select another item. Its as if the text field is a selction behind what I have enterd in the dropdown list.
    Any thoughts?

  • LMS 4.2 | discovery based on specific IP Adress

    Hi Netpro
    1)is there any methods to let LMS 4.2 discover Cisco devices based on specific ip like Loopback address ? coz in my Cisco devices i have more than ip address configured , please advice?
    thanks
    ibrahim

    1. Please refer to the context-sensitive help when you get to this step. It will give you a page with very detailed file formats and fields that are used (see screenshot below from my lab server). That page is also in Chapter 4 of the Inventory Management guide online.
    2. Device adjacencies are determined via a correlation of various MIB variables including CDP neighbor details and other details. I recommend you read through Joe Clarke's document on understanding LMS discovery.
    One thing to note is that is is best to have the IP addresses of the devices in DNS. If that is difficult for whatever reason, the first create a local hosts file with the devices. You will get better results if the device IPs resolve to host names.

Maybe you are looking for

  • Problem with Leopard on a Macbook pro

    I'm posting this for my fiance as it's his computer that's acting up and he can't get here himself. The problem goes as this: He went to boot up his macbook pro, which is running leopard and also has windows installed. When he tried to boot up into t

  • How do I make a screen shot/image

    How do I make a copy of the current screen.

  • RH Linux VIP configuration not working for Oracle 10g RAC installation

    Hi all, I am trying to setup my test cluster on Oracle 10gR2 and Red Hat Linux 4. I have the public and private networks working fine and setup. However, after I setup the two VIP addresses, I cannot even ping these two virtual IPs from Linux. CRS in

  • Problem in sql

    hi all, iam having a table by name owner whos is having a particular filed by name mapclientid.one owner is assigned more than one client.iam having a mapping table and in that iam having two fields mapclientid and client id.another table iam having

  • How to know if Index is used by a program or job

    Hi, I am having this problem on how to check if a specific index such as /BIC/B0000** is used by a job or program. This is because I am woking on the Oracle Cost-Based Optimizer to be updated in a weekly schedule. But before a change in the schedule