Aprroval for Invoice have due date greater than 100 days

Hi all!
I would like to create query to approve for Invoice have due date greater than 100 days.
SELECT 'true' from OINV  where max(datediff(day, OINV.docduedate, getdate()))>100 and OINV.docstatus ='O' and  cardcode = $[$4.0.0] group by cardcode
It's not working. Can you help me!
Thanks!

Hi Tien,
Hopefully not trying to teach you how to suck eggs here, but it looks like the query is doing too much. There shouldn't be a need to perform a "GROUP BY" in a query to dictate if an approval is to be triggered or not, only the criterai to make it happen.
For examle, the following code will send a transaction for approval if the customers code equals a specific reference.....
SELECT 'TRUE' FROM ORDR T0 WHERE ${ORDR.CardCode} = 'ABC001'
If you're wanting a query to just return a boolean answer based on the date criteria, you might want to try adapting your query to something like.......
SELECT 'true' from OINV where max(datediff(day, ${OINV.docduedate}, getdate()))>100 and ${OINV.docstatus} ='O' and  cardcode = ${$4.0.0}
(As an additional tip, in order to test a query that you're wanting to use as either a formatted search or approval type selection, when in the transaction, if you locate the relevant saved query under "Tools > Queries > User Queries" etc, where you have references to specific fields e.g. ${ORDR.CardCode}, this will pick up the values from the current record and give you a what if scenario. I tend to have just a "Temp" query I use for WIP type queries of this nature.)
Note - You need to replace the bracket's "{}" with square ones, I've used the others as the forum posts as a http reference.
Hope this helps!
Julian

Similar Messages

  • Exit or BAdi for Validating GR posting date Greater than PO creation date.

    Hi all ,
    Is there any Exit or BAdi for restricting users to post GR date greater than PO creation date.
    Regards
    Gibi Philip

    Gibi,
    check this:
    MB_CIN_LMBMBU04                         posting of gr
    Amit.

  • F110 - Bill of exchange - latest due date more than 999 days ?

    Hi all:
      We have a problem about Payment run / F110.
      Because finance department want to open "Check" to bank  and the due date is about 4 years later (1500 Days).
      And we run the payment run it shows error message " FZ 732 Item not due in 000 - 999 days " .
      I think the reason is because the maxium latest due date only allowed 999 days,right ??
        "Latest due date in" of "Bill of exchange due date for outgoing payments" in paying Company Code  (OBVS)
      Is there any way ( IMG / Exit / Enhancement ) can resolve this problem ??
      thanks a lot.

    Hi Mauri:
      Thanks your reply.
      actually, we have asked user to open their check - more then 999 days - manually.
      Because this is the second case we met in past 6 months, so we are looking for any solution ( Exit / Enhancement ) to meet user's requirement. 
      We won't create any new add-on program to meet user's requirement, but hope exit or enhancement can make it, anyway, thanks again.

  • Greater than 90 Days

    Hi ,
       I have a characteristic ZMANUDATE.
       Basically, I need to provide a query whereby only materials which have been manufactured greater than 90 days ago
       Please advice

    Cheers Arun,
         My concern is if I was to offset by -90 , would this result
         1) show me all the machines which were produced at exactly 90 days ago
         2) show me all the machines which were produced from CURRENT DATE to 90 days ago.
          Option (2) is my requirement.
          Please advice if your proposition will still hold.

  • Can't add numbers greater than 100 in the Data Editor for a column chart

    I'm trying to create a column chart in Keynote '09 but every time I add a data point with a value greater than 100 in the Data Editor it turns the number into a date. I have the Y Axis set to "Number" and it works fine for numbers less than 100 but I want to show a graph that goes from 0 - 1000. Is this happening to anyone else?
    Chart Settings:
    Y Axis Options:
    - Max = 1000
    - Steps = 5
    - Format = Number
    X Axis Options
    - Show Axis
    - Show Categories
    - No Tick Marks
    thanks in advance for the help

    Welcome to the discussions, AlexEberts.
    No, it's not happening for me. This is what I'm doing
    1) Insert -> Chart -> Column
    2) In the Data editor, for 2007, I enter 110.
    The chart automatically expands to 110 (because, by default, it's set to autosize the Y-axis)
    Does this work for you? If it does, then we can look at why it doesn't work when you add parameters.

  • User Exit for Changing Payment Due date for Invoices

    HI Gurus,
    Could anyone suggest a User Exit which cane be used for Due Date calculation an all Invoice Entries like MIRO, FB60 etc.
    This is required for overwriting the Due Date determined via payment terms by a Particular day in a week. (Eg: Friday)

    Hi
    User exit
    Re: user exits in MM
    Regards
    Ram

  • AP Invoice incorrect due date

    Hi SAP B1 experts:
    When the user is going to create a AP Invoice does not matter what payment term appears in the document the due date is the same (03012010) format DDMMAAAA. It is like the system seems not to take this configuration in order to calculate the due date neither if you change the posting date to differents days.
    At the moment to create e AR invoice the due date is calculated correctly, so is strange taking that the payment terms are the same for all the BP`s.
    I do not know any configuration related with this, so I will appreciate whatever information.
    Thanks in advance,
    Manuel Barrero

    Hi Manuel,
    the due date calculation is influenced by a few factors.
    Please have a look in the EES 'Dates in SAP Business One 2005A Sp01'. You'll find it in the archives of the psd calendar.
    https://psd.sap-ag.de/PEC/calendar/
    In that session most date calculations are explained in detail, including the due date. If you are an end customer, please contact your partner to make the presentation available to you.
    All the best,
    Kerstin

  • Calculation of due date based on Business Days for FICA documents

    Hi All,
    I am working on project where SD - FICA integration is in picture. We post some charges through SD and FICA document gets posted on relevant Contract Account.
    Normally we create Sales Order using transaction VA01 and then we do Billing for this Sales Order through VF01. After billng is done, FICA document automatically gets generated.
    We have following requirement to be fulfilled.
    For the SD bills posted as above, I want to calculate due date of these bills based on Business Days for FICA document generated (SAP Standard calculate due date based on Calander days). We can use factory calander for calculating business days in relevant function module.
    I have checked in the system and it seems that event 1330 ( FM - ISU_DUE_DATE_DETERMINE) is not working in this scenario. Is there any other FM which I can use?
    Can anyone help me on this?
    Regards,
    Pradeep

    Hello Praeva ,
    The event 1330 has a sample FM FKK_SAMPLE_1330. It doesnt even have a Standard Function Module.
    You need to create a Installation-Specific FM and put your code to determine the Due Date based on the logic.
    Rgds
    Ram Kumar.

  • When choosing date on a banking site a box appears telling me to use a to date greater than from date.

    I am trying to get a report from a bank site and a box pops up asking me to choose a to date greater than from date. I have the correct dates chosen. Is there a fix or away around this.

    Check the date and time in the clock on your computer: (double) click the clock icon on the Windows Taskbar.
    *https://support.mozilla.com/kb/Secure+Connection+Failed

  • Need to create a workflow after Date Modified is greater than 7 days

    I'm using SharePoint Deisnger 2010 and attempting to create a workflow to generate an email after the Date Modified is greater than 7 days. Checking to see if there is a way to create this workflow without creating a "calculated" field with a date.
    Have:
    If Current Item:Modified is greater than Today
    But would like to have 7 days not today or a set date.
    What's the best way to do this?

    Hello,
    In addition to Bistech, here is link to set date in WF context variable.
    http://stackoverflow.com/questions/17082455/sharepoint-designer-2010-set-variable-today-x-days
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Select only dates greater than static value

    I am retreiving dates from an sql table, currently I am pulling all the dates. How do I only pull dates greater than say 5/1/2008?
    Below is the current code.
    String strSQL = "Select convert(nvarchar, wk_dt, 101) as outDt From t_fiscal_weeks Where wk_dt <= '" +
    DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM).format(new java.util.Date()) + "' Order by wk_dt desc";
    Thanks for the help

    Always, always, always use a PreparedStatement: [http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html]

  • Invoice payment due date.

    Dear all,
    I would like to display the invoice payment due date in my SAPscript. I've heard about the FI_TERMS_OF_PAYMENT_PROPOSE function module and thought that it could feet my need. But I'm wondering if there is no other way to proceed since I can't find documentation on the above function module. Also I'm surprise to do not find in standard among the structured tables the invoice payment due date data.
    Best regards.
    Nozome.

    Hi Nozome,
    You may look at the following post.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=/forums/sdn_jive_forums/thread{74687265616449443d3731303434}.jspa
    Cheers
    Vinod

  • How can I set the java Date not greater than the day inputed?

    When I would input the date, I don't want it to be after this day because it would violate some business logic in my program. I am allowed to input date latter than this day like yesterday, last week etc. but not after this day.....Can anyone give me a concrete example or logic on how to do this?THANKS!

    tr3k wrote:
    Can you explain it by code?I could, but I won't. I pointed you in the right direction. Now it's up to you to make the effort. Give it your best shot and post a more detailed question if you have problems.
    http://www.javaworld.com/jw-12-2000/jw-1229-dates.html
    http://www.javaalmanac.com/egs/java.text/FormatDate.html
    http://www.javaalmanac.com/egs/java.text/ParseDate.html
    http://java.sun.com/javase/6/docs/api/java/util/Date.html
    http://java.sun.com/javase/6/docs/api/java/util/Calendar.html
    http://java.sun.com/javase/6/docs/api/java/util/GregorianCalendar.html
    http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html

  • Cannot perform rounding for invoices with a currency other than the documen

    Hi all,
    I need some one to help me
    I want to process the incoming payment.
    The AR Invoice is using USD
    In Incoming Payment i want to pay using SGD,
    I already set the BP in all currency
    I also set the Bank account in Bank transfer payment mean in all currency.
    But when i add the document i saw the message like this
    "Cannot perform rounding for invoices with a currency other than the document currency.  [Message 3524-31]"
    What should i do ?
    Thanks in advance
    Regards
    KK

    Hi gordon,
    Thanks for your respon.
    I still do not understand, what you mean.
    I test it in SBO DEMO Au which is the local currency is AUD and the system currency is also AUD.
    Is the any special setting for this issue?
    Or Do i miss the settings in SBO
    My version is 8.81 pl 9
    Thanks in advance

  • Create variant for VL10b for max delivery date higher than 30 days

    Hi expert,
    I want to create a variant for the transaction VL10b with a max delivery date higher than 30 days.
    The standard transaction make 30 days as default.
    How can a proceed?
    Thanks for your help.
    Regards,
    Haja

    Hi Haja,
    From the moment you run your variant via transaction VL10B, the delivery creation date
    range will get the values saved in your variant. In a second step, when you click
    on "Purchase Order" Tab, the system will re-determine the Delivery creation date
    range taken into account the fact that field CalcRuleDefltDlvCrDt is empty and that
    MaxDelivCreateDate (visible in the variant) is equal to 30.
    Please note, the date calculation is being influenced by 2 factors :
    -The MaxDelivCreateDate field whose default value can be modified in 2 different ways:
      a) either in customizing via transaction VL10CUC
           or
      b) manually, after unchecking the "Use list profile" check box in the user role of VL10.
          By doing this, the field will be made visible and can then be manually modified.
    Afterwards, the date calculation is also controlled by the rule defined in CalcRuleDefltDlvCrDt field. You can then possibly also set this field to blank or define your own calculation rule via an
    user-exit (include V50R_USEREXIT_PREPARE). If the rule is set to 2, then regardless of the
    value stored in MaxDelivCreateDate, the date range will only cover today and tomorrow.
    These are the only 2 influencing factors for the program (not the variable type in the variant). Please try any combination you may need and this should suit your needs.
    BR,
    Enrique

Maybe you are looking for

  • Preview tool

    My Preview does not have a Create Signature tool. How do I update Preview to sign a pdf document? 

  • Migrating DB from SQL Server (Windows) to Oracle (Unix)

    I wish to migrate a SQL Server 2000 database on a Windows environment to an Oracle database on a Unix environment. Are there any issues with using the Oracle Migration Workbench to migrate a SQL Server database to Oracle between different operating s

  • [solution] Installing vmware server on x86_64

    I have been getting errors when attempting to run vmware-config.pl on vmware-server with kernel 2.6.30 The error happened when compiling the modules A solution and a download link for the patch can be found here http://communities.vmware.com/message/

  • Missing data fields in Query designer

    Hi Guys, A query exists on an ODS. There are few characteristics and navigational attributes in the ODS. In Query designer, on the left hand side under Dimensions, i can see 'Data part' (for Data fields of ODS) and 'Key section' (for Key fields of OD

  • Pai module enter key from key board

    hi can any one tell me how can i display material description after entering material no in screen  . by just clicking enter key from keyboard . Regards Rakesh singh