Block AP Invoice less than PO date ( Udf )

Hi All,
I am trying to Make an SP based on the UDF which is there in the AP invoice named as PODate. I want to block the AP invoice if AP Invoice Posting Date or AP Invoice Document Date is less than the Date of the this UDF. This UDF Captures the PO date basically and I want to Block all AP Invoice whose Posting Date is less than the PO Date.
I tried the below SP but could be sucessful.
---AP Invoice vs PO Date
if @transaction_type = 'A' and @object_type ='18'
begin
if exists(select T0.docnum from dbo.OPCH T0 where T0.docentry = @list_of_cols_val_tab_del
and T0.docdate > T0.U_PODATE
BEGIN
SET @error = 17
SET @error_message = N'AP Invoice Date less than the PO Date'
end
end
Kindly advise.
Regards,
venky

Hi Venky......
Try this.....
---AP Invoice vs PO Date
if @object_type ='18' and @transaction_type = 'A'
begin
if exists(select T0.docnum from dbo.OPCH T0 where T0.docentry = @list_of_cols_val_tab_del
and T0.docdate < T0.U_PODATE
BEGIN
Select @error = -1,
@error_message = N'AP Invoice Date less than the PO Date'
end
end
If you see in your SP you have given reverse condition that is T0.docdate > T0.U_PODATE but it shoudl be T0.docdate < T0.U_PODATE
ANyways try this SP.......
Regards,
Rahul

Similar Messages

  • AR Invoice date should not be less than delivery date

    How can i make an alert for user when they will prepare AR Invoice?
    Example:
    If Delivery date is 01-10-2010 and Invoice date should be later or same but not less than delivery date(01-10-2010).
    if Invoice date is less than delivery date then This data should not be added into the database.
    So there is any way to stop this error.
    Thanks
    Mizan

    Dear Bala,
    Here is the SP:
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    ALTER proc [dbo].[SBO_SP_PostTransactionNotice]
    @object_type nvarchar(20),                     -- SBO Object Type
    @transaction_type nchar(1),               -- [A]dd, <u>pdate, [D]elete, [C]ancel, C[L]ose
    @num_of_cols_in_key int,
    @list_of_key_cols_tab_del nvarchar(255),
    @list_of_cols_val_tab_del nvarchar(255)
    AS
    begin
    -- Return values
    declare @error  int                    -- Result (0 for no error)
    declare @error_message nvarchar (200)           -- Error string to be displayed
    select @error = 0
    select @error_message = N'Ok'
    --     ADD     YOUR     CODE     HERE
    If @object_type='13' and @transaction_type='A'
    BEGIN
    If Exists (Select distinct 'error' from [dbo].[OINV] T0 Inner Join INV1 T1
    On T0.DocEntry=T1.DocEntry Inner Join DLN1 T2 On T1.BaseEntry=T2.DocEntry
    Where T0.DocDate<T2.DocDate
    And T0.DocEntry = @list_of_cols_val_tab_del)
    BEGIN
    Select @error = -1,
    @error_message = 'DocDate for Invoice Should not be Less than Del. Date. So You can not Add this Doc'
    End
    End
    -- Select the return values
    select  @error,@error_message
    end
    Regards,
    Mizan

  • PR Date Should be less than PO date

    Hi
    I have done the change in message type to control PO date at the time of creation, now PO can be created only in current date but if at a later stage somebody has been created one more PR and change the PO and add one more line item from this PR then PR date is greater than PO date.
    So this is objectionable and I want to control this i.e. PR date should be less than PO date.
    Please guide how can i achieve this?
    Regards
    Ajay Goel

    Hello,
    Ajay if u you want to restrict the PO can be created only in current date then u can take help of your ABAPER because its possible through BADI.
    If you want to add the other line item in PO Or Use Tcode Me22n you can not change the document date that time bcoz its disable check it.

  • Date should not be  less than current date.

    Hello, I have a form.It has an item called end_date. I want to have validation of end_date in such a way that "end_date should not less than current date". Any tips would be helpful.
    Thanks in advance.

    jwellsnh wrote:
    Pravish,
    A dynamic action executing JavaScript can do this:
    Create a Dynamic Action:
    Event Before Page Submit
    Condition JavaScript Expression
    Value $v('P1_END_DATE')<$v('P1_BEGIN_DATE')In this scenario; P1_BEGIN_DATE would need to default to sysdate and could be a hidden item on the page.
    Jeff
    Edited by: jwellsnh on Jul 19, 2012 9:50 AMMaybe I'm missing something but isn't this just a use case for a common-or-garden validation? Would be interested to know why you thought of javascript rather than normal built-in functionality (not meant as a criticism incidentally!) - is javascript your first port of call when it comes to APEX?
    I'd also watch out for comparisons to SYSDATE - remember that SYSDATE includes the current time, so you'd need to take that into account (maybe you could make use of the TRUNC function to remove the time element?). Indeed, would javascript evaluate that expression as comparing two dates (I know Javascript evaluates variables byDuck Typing but does this work in practice)?

  • ESS Bank Information errors if end date is less than system date

    Hi to all,
    We have create an WD Java aplication to create new entries in infotype 0023. We have used a standar component DC (PersInfo).
    The first problem - we couldn't create new entries if start date is less than system date and we used:
    In transaction SPRO got to Personnel Management>Employee Self Service>Service Specific Setting-->Change Default Start Date
    Business Add-In HRXSS_PER_BEGDA. You can set the date in the DEFAULT_DATE method.
    Parameters of the method DEFAULT_DATE:
    MOLGA (Importing)
    PERNR (Importing)
    INFTY (Importing)
    SUBTY (Importing, optional)
    BEGDA (Changing)
    We have solved the first problem with begda.
    The second problem - we couldn't create new entries if end date is less than system date.
    Can anybody helps me about this second problem?
    Thank a lot.

    Can anybody helps me?
    Thank a lot.

  • ESS Information errors if end date is less than system date

    Hi to all,
    I have create an WD Java aplication to create new entries in infotype 0023.
    First problem: At the beginning I couldn't create new entries if start date is less than system date. To solve this problem I used:
    The transaction SPRO to go to Personnel Management>Employee Self Service>Service Specific Setting-->Change Default Start Date
    In HRXSS_PER_BEGDA I changed BEGDA to 01.01.1900 in the DEFAULT_DATE method and i solved the first problem.
    Now I need solved the second problem - we couldn't create new entries if end date is less than system date.
    In this method DEFAULT_DATE I can't change ENDDA because ENDDA isn't a parameter in this method.
    MOLGA (Importing)
    PERNR (Importing)
    INFTY (Importing)
    SUBTY (Importing, optional)
    BEGDA (Changing)
    Can anybody helps me about this second problem?
    Thank a lot for your help.

    I am creating an aplication WD Java:
    - This application uses a R3 Function Module HRXSS_PER_MODIFY_PNNNN
    - This FM uses the method CALL METHOD xss_adapter->modify
    - This Method uses IF_HRPA_PERNR_INFTY_XSS~MODIFY
    - This method uses:
      IF buffer_entry-container->a_pskey-endda < user_today.
        msg-msgid = 'PG'.
        msg-msgty = 'E'.
        msg-msgno = '016'.
        msg-msgv1 = 'Data valid only for past is not'(009).
        msg-msgv2 = 'allowed;'(010).
        msg-msgv3 = 'correct'(011).
        msg-msgv4 = 'end date to a date today or future date.'(012).
        CALL METHOD message_list->if_hrpa_message_handler~add_message
          EXPORTING
            message = msg
            cause   = xss_adapter_generic.
      ENDIF.
    How can I change the value user_today?
    This value is a parameter for the method GET_INSTANCE in CL_HRPA_PERNR_INFTY_XSS, but I don't know when this method is called.
    Can you help me?

  • End date should not less than Start date, else CLEAR it

    Hello
    I put CONTRACT START DATE and CONTRACT END DATE fields on the form. These 2 objects (Date/Time objjects) i pulled them from Satndard tab of pallette and dropped on my layout page design, fine.
    Now, am trying to put a validation that the end dat eshould not lower than start date, so, i got a thread as below from Niall,
    http://forums.adobe.com/message/1909551
    and i did my FormCalc coding under EXIT event of END DATE field as below,
    // Pls. note this FormCalc
    // End date should not less than Start date, else CLEAR it - Begin
    var stDate
    var endDate
    stDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_START_DATE") .rawValue
    endDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").r awValue
    if (stDate > endDate) then
        xfa.host.messageBox("End date is lower than Start date! End date is cleared")
        xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").r awValue = null
    endif
    // End date should not less than Start date, else CLEAR it - End
    I tried in VALIDATE, CALCULATE, CHANGE events of END DATE, but nothing working!!
    PLs. let me kow how can i achieve my requirement? I am anewbie,
    Thank you

    If you use the exit event, you will probably have to have the same code on both the start and end date fields since they have a dependancy on each other. Maybe better to try the validate event of the end date so that if either field is changed the event gets fired. You can try the following for validate event
    // Pls. note this FormCalc
    // End date should not less than Start date, else CLEAR it - Begin
    var stDate
    var endDate
    stDate = CON_START_DATE.rawValue
    endDate = $.rawValue
    if ( HasValue(endDate) ) then
        if (stDate > endDate) then
            xfa.host.messageBox("End date is lower than Start date! End date is cleared")
            $.rawValue = null
        endif
    endif
    1
    // End date should not less than Start date, else CLEAR it - End

  • Contract End date should not less than Start date, else CLEAR it

    Hello
    I put CONTRACT START DATE and CONTRACT END DATE fields on the form. These 2 objects (Date/Time objjects) i pulled them from Satndard tab of pallette and dropped on my layout page design, fine.
    Now, am trying to put a validation that the end dat eshould not lower than start date, so, i got a thread as below from Niall,
    http://forums.adobe.com/message/1909551
    and i did my FormCalc coding under EXIT event of END DATE field as below,
    // Pls. note this FormCalc
    // End date should not less than Start date, else CLEAR it - Begin
    var stDate
    var endDate
    stDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_START_DATE") .rawValue
    endDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").r awValue
    if (stDate > endDate) then
        xfa.host.messageBox("End date is lower than Start date! End date is cleared")
        xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").r awValue = null
    endif
    // End date should not less than Start date, else CLEAR it - End
    I tried in VALIDATE, CALCULATE, CHANGE events of END DATE, but nothing working!!
    PLs. let me kow how can i achieve my requirement? I am anewbie,
    Thank you

    http://forums.adobe.com/message/4264933#4264933

  • Rogers is saying that IOS4 won't allow use of the personal hotspot with a plan of less than 1GB data.  I say it's a policy of theirs, not an iOS restriction.  Anyone know the truth?

    Rogers is saying that IOS4 won't allow use of the personal hotspot with a plan of less than 1GB data.  I say it's a policy of theirs, not an iOS restriction. Anyone know the truth?
    I call BS but the tech guy was insistent that the iPhone can detect what plan I have and won't enable the feature and there's nothing they can do about it, short of selling me a larger data plan...

    robfromkelowna wrote:
    Actually it does.  It's wrong to lie to a customer.  By blaming Apple, they shift the blame and make it seem like there is nothing they can do about it.  If they admitted it was their policy, I could complain and try to get it changed or I could move to another carrier.
    If a person killed someone and blamed it on a heart attack, the person is stil dead, does it matter? Either way they're dead, right...  (extreme, I know, but illustrating a point)
    Wow.
    It is certainly Rogers policy and is not unusual at all among carriers.
    Seems like a non-issue to me, but apparently being "lied to" ( perhaps the employee was simply mistaken, it happens) is a major deal to you.

  • ESS Bank Information errors if start date is less than system date

    Hello Developers,
    We are unable to create a new Bank Information record of type "Other"  from ESS Web Dynpro ECC 6.0 when we set the begda field to a date earlier than the system date.  When we attempt this we get the message: "Start date should be after <todays date> or later".
    Is there a configuration setting that will allow new records to be created with the begda set to a past date when creating new "Other" bank type records?
    Our payroll runs bi-weekly and we need to set the beginning date of a new record to the start date of the payroll cycle, which can be earlier than the creation date.
    Thank you

    Terry,
    In transaction SPRO got to Personnel Management>Employee Self Service>Service Specific Setting-->Change Default Start Date
    Business Add-In  HRXSS_PER_BEGDA. You can set the date in the DEFAULT_DATE method.
    Parameters of the method DEFAULT_DATE:
    MOLGA (Importing)
    PERNR (Importing)
    INFTY (Importing)
    SUBTY (Importing, optional)
    BEGDA (Changing)
    Regards
    Sarath

  • MIRO posting date less than MIGO / SES posting date

    Hi,
    In our system , user can make MIRO with respect to a PO and give posting date less than posting date of GRN or Service entry sheet. I want that user can give posting date of MIRO document equal to or greater than posting date of GRN / SES of that PO.  How can i do this?
    Regards
    Kalpesh

    Hi,
    Please write a validation in order to avoid the user keying in the pre posting date at the time of MIRO

  • How to write more than 65536 data in excel Via Labview in one column

    I have more than 65536 data and i want to write these data in excel sheet. It is giving Error:-
    "Description:-
    Error -2146827284 occurred at an unidentified location
    This error code is undefined. No one has provided a description for this code, or you might have wired a number that is not an error code to the error code input."
    Less than 65536 data can be written....
    Please give some solution...

    This is not a limitation of LabVIEW writing to a spreadsheet file but a limitation of Microsoft Excel (and also of Notepad) itself.
    One option could be, you can switch to Excel 2007 or higher verison...!!
    Other solution could be, forget about writing to Excel, instead write in some other format and use LabVIEW your other compatible (with large data) application to read it back.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • SALES ORDER CAN NOT BE LESSER THEN POSTING DATE

    Hi everyone
    Can any one tell how can I restrict sales delivery date less then posting date. Like if user create a sales order on 22,03.14 then delivery date should not be before 22.03.14. I saw in system if I enter sales delivery date before 22.03.14 then system accept the date

    Hi,
    Try this:
    IF @transaction_type in ('A') AND (@OBJECT_TYPE='17')
    BEGIN
    If exists (SELECT t0.docentry FROM ORDR T0 WHERE T0.[DocDueDate] < T0.[DocDate] and  T0.DocEntry =  @list_of_cols_val_tab_del)
    Begin
    SET @error = 10
    SET @error_message = 'Not allowed to enter delivery date less than posting date'
    End
    End
    Thanks & Regards,
    Nagarajan

  • Set the values less than the value prompted

    Hi Every one,
    I have a requirement where the report will be navigating to other report.
    example: I have a report A and when I click on the any value in date column it navigate to other report by filtering the data by the date we clicked to navigate.
    Here my question is, it is filtering the navigated report by the date we selected. but I want it filter the dates equal to or less than the date we selected
    like if I click on date 11/7/2011 it should navigate to the report B and in report B the data should show data for the dates equal to or less than 11/7/2011
    is there any way to set this. because i can see only is prompted that we set for this requirement.
    Thanks in Advance.
    Edited by: 861096 on Nov 11, 2011 9:01 AM

    Hi ,
    While creating the prompt give the presentation varible.
    So when you will select the value for the Report A say ex :11/7/2011 it will be catched by the presentation variable.
    In your second report use this presentation variable as a filter condition where date < = presentation variable.
    It will work for you .
    Thanks,
    Ananth

  • MIRO(Invoice Verification) posting date is lesser than MIGO(Goods Receipt)

    MIRO(Invoice Verification) posting date is lesser than MIGO(Goods Receipt) posting date.
    Explanation:
    Miro sholud be posted after the GRN has posted. It means that the Posting date of Miro should be greater than or equal to the Posting date of Migo. But I am facing the issue that I can able to post the Miro before the Migo date..
    For example:  I have posted the Migo(Goods receipt) document with the posting date u2013 10.8.09 and at the same time I can also able to post the Miro(Invoice Verification) posting date as u2013 5.08.09. This is should not be allowed . Kindly give me the solution. Is there any options in SAP standards to restrict this type of Postings(without using user exit).
    regards
    Varadharaj

    Hi
    you  need to use BADi for this INVOICE_UPDATE
    you can give logic as whil;e MIRO system will compare posting date with MIGO doc , then create a Z error msg in se91 nad assign it in that badi
    take help of ABAPer, check following link
    [LINK |GR date lesser than the PO date, the system should show an error message.;

Maybe you are looking for

  • How do i change my icloud apple id on my iphone?

    I can't change my apple id password for my apple id!  It says it sent me a message but I never get it.  I need to change the password but I can't.  My iphone keeps assking me ALL DAY to enter a password and wearing down my battery!  HELP

  • MSI GE60 2OE - blocked, Win 8.1 trouble

    First of all, Hello everybody! I'm in big trouble with my MSI, I got stuck and don't know what else to do. I have been trying to fix for three days, looking for information, I have read most of sticky post and searching in the forum and I haven't fou

  • I am unable to delete the files

    Hi all, I am totally new with this iPad stuff, so I hope that someone could help me a bit. I bought the software which is called BUZZ Player (plays videos and subtitles). So, I installed the software and upload a few videos (avi's) and subtitle's (.i

  • Keyword Filtering please help !!!!!

    Hi all, I am doing my program which is a web browser with filtering funciton, it's running properly now but it have some problem with the keyword filtering function, it still not work properly. I try out a target webpage but that page still displayin

  • Mountain Lion Hangs - restart needed

    I am starting a new topic on this issue. I looked at a similar issue that was started in July 2012 and it had 26 pages of posts. Does not seem like the issue has been resolved for 10.8.2. I feel like I am back working in OS 9 where computer freezes w