Urgent due date calculation in vendor ageing(plz solve)

hi everybody there
i have to calculate the due on date
which is calculated as
dueon = BLINE Date (BSIK-ZFBDT) + No of Days(BSIK-ZBD1T)
for this i am using fm
RP_CALC_DATE_IN_INTERVAL
but it is not working .
could u suggest that what is going wrong with this
fm.
i am calling this fm in following code but it is not working , it is going to dump.
could any one suggest me how to use the above fm in my following code so that i will be able to calculate due on date based on above formula.
my code is as follows
*& Report  Z_VENDOR AGEING                                                    *
*&  in this repoet I am calculating the vendor ageing
    which is depending on formula
    AGEING = Current Date(or any date entered by user) – Bline Date(BSIK-ZFBDT)                                                                 *
REPORT  z_vendor  NO STANDARD PAGE HEADING
                  LINE-SIZE 200
                  LINE-COUNT 65(3).
TABLES : bsik.
DATA : BEGIN OF t_out OCCURS 0,
       bukrs LIKE bsik-bukrs,
       saknr LIKE bsik-saknr,
       bldat LIKE bsik-bldat,
       wrbtr LIKE bsik-wrbtr,
       lifnr LIKE bsik-lifnr,
       zfbdt like bsik-zfbdt,
       zbd1t like bsik-zbd1t,
       ageing type i,
       END OF t_out.
parameters : p_date1 type d.
SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
                 s_saknr FOR bsik-saknr,
                 s_lifnr FOR bsik-lifnr.
SELECT bukrs saknr bldat wrbtr lifnr zfbdt
       FROM bsik
       INTO  TABLE t_out
       WHERE saknr IN s_saknr
       AND bukrs IN s_bukrs
       AND lifnr IN s_lifnr.
Loop at t_out.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
  EXPORTING
    i_datum_bis                   = p_date1
    i_datum_von                   = t_out-zfbdt
  I_KZ_EXCL_VON                 = '0'
  I_KZ_INCL_BIS                 = '0'
  I_KZ_ULT_BIS                  = ' '
  I_KZ_ULT_VON                  = ' '
  I_STGMETH                     = '0'
  I_SZBMETH                     = '1'
IMPORTING
   E_TAGE                        = t_out-ageing
EXCEPTIONS
  DAYS_METHOD_NOT_DEFINED       = 1
  OTHERS                        = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Modify t_out.
Clear t_out.
Endloop.
LOOP AT t_out.
  WRITE : / t_out-saknr,
            t_out-lifnr,
            t_out-wrbtr,
            t_out-zfbdt,
            t_out-ageing.
ENDLOOP.

hi sanjeev,
chnage ur code.
note the bolded part.
TABLES : bsik.
DATA : BEGIN OF t_out OCCURS 0,
bukrs LIKE bsik-bukrs,
saknr LIKE bsik-saknr,
bldat LIKE bsik-bldat,
wrbtr LIKE bsik-wrbtr,
lifnr LIKE bsik-lifnr,
zfbdt LIKE bsik-zfbdt,
zbd1t LIKE bsik-zbd1t,
ageing TYPE i,
END OF t_out.
PARAMETERS : p_date1 TYPE d.
SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
s_saknr FOR bsik-saknr,
s_lifnr FOR bsik-lifnr.
SELECT bukrs saknr bldat wrbtr lifnr zfbdt <b>zbd1t</b>
FROM bsik
INTO <b>corresponding fields of table</b> t_out
WHERE saknr IN s_saknr
AND bukrs IN s_bukrs
AND lifnr IN s_lifnr.
if sy-subrc <> 0.
message 'no data' type 'S'.
endif.
  LOOP AT t_out.
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
    EXPORTING
    i_datum_bis = p_date1
    i_datum_von = t_out-zfbdt
I_KZ_EXCL_VON = '0'
I_KZ_INCL_BIS = '0'
I_KZ_ULT_BIS = ' '
I_KZ_ULT_VON = ' '
I_STGMETH = '0'
I_SZBMETH = '1'
    IMPORTING
    e_tage = t_out-ageing
     EXCEPTIONS
     days_method_not_defined = 1
     OTHERS = 2
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
<b>
  data :   dueon like t_out-zfbdt.
  dueon = t_out-zfbdt + t_out-zbd1t.
  write dueon.</b>
    MODIFY t_out.
    CLEAR t_out.
  ENDLOOP.
rgds
anver.
if hlped mark points
  LOOP AT t_out.
    WRITE : / t_out-saknr,
    t_out-lifnr,
    t_out-wrbtr,
    t_out-zfbdt,
    t_out-ageing.

Similar Messages

  • Vendor due date analysis and vendor aging wise analysis

    Could u please explain vendor due date analysis and vendor aging wise analysis. what is the differnce between and with t code y specify

    Hi Venkatkumar,
    Vendor due date analysis refers to the date on which the bill becomes due for payment based on the payment terms and base date. It gives a detailed report of all vendors whose bill have become due for payment on a particular date (Key Date).
    Vendor agewise analysis refers to the grouping of amounts due to vendors for various periods, for e.g. 0-30 Days, 31-60 Days, 61-90 Days & so on.
    T code for Vendor due date analysis is S_ALR_87012078 - Due Date Analysis for Open Items.
    T code for Vendor agewise analysis S_ALR_87012084 - Open Items - Vendor Due Date Forecast
    Thank You.
    Regards,
    Ameet

  • URGENT check the code for vendor ageing (Give Solution)

    hi this is the code which i am using to calculate the
    ageing but not able to get the result.
    every time the result is 0.plz suggest me the solution.
    its very urgent.
    *& Report  Z_VENDOR AGEING                                                    *
    *&  in this repoet I am calculating the vendor ageing
        which is depending on formula
        AGEING = Current Date(or any date entered by user) – Bline Date(BSIK-zfbdt) 
    REPORT  z_vendor  NO STANDARD PAGE HEADING
                      LINE-SIZE 200
                      LINE-COUNT 65(3).
    TABLES : bsik.
    DATA : BEGIN OF t_out OCCURS 0,
           bukrs LIKE bsik-bukrs,
           saknr LIKE bsik-saknr,
           bldat LIKE bsik-bldat,
           wrbtr LIKE bsik-wrbtr,
           lifnr LIKE bsik-lifnr,
           zfbdt like bsik-zfbdt,
           ageing type i,
           END OF t_out.
    parameters : p_date1 type d.
    SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
                     s_saknr FOR bsik-saknr,
                     s_lifnr FOR bsik-lifnr.
    SELECT bukrs saknr bldat wrbtr lifnr zfbdt
           FROM bsik
           INTO  TABLE t_out
           WHERE saknr IN s_saknr
           AND bukrs IN s_bukrs
           AND lifnr IN s_lifnr.
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
      EXPORTING
        i_datum_bis                   = p_date1
        i_datum_von                   = t_out-zfbdt
      I_KZ_EXCL_VON                 = '0'
      I_KZ_INCL_BIS                 = '0'
      I_KZ_ULT_BIS                  = ' '
      I_KZ_ULT_VON                  = ' '
      I_STGMETH                     = '0'
      I_SZBMETH                     = '1'
    IMPORTING
       E_TAGE                        = t_out-ageing
    EXCEPTIONS
      DAYS_METHOD_NOT_DEFINED       = 1
      OTHERS                        = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT t_out.
      WRITE : / t_out-saknr,
                t_out-lifnr,
                t_out-wrbtr,
                t_out-zfbdt,
                t_out-ageing.
    ENDLOOP.

    hi sanjeev,
    still problem there.
    dont worry. just copy this code.
    try this code.
    TABLES : bsik.
    DATA : BEGIN OF t_out OCCURS 0,
    bukrs LIKE bsik-bukrs,
    saknr LIKE bsik-saknr,
    bldat LIKE bsik-bldat,
    wrbtr LIKE bsik-wrbtr,
    lifnr LIKE bsik-lifnr,
    zfbdt like bsik-zfbdt,
    ageing type i,
    END OF t_out.
    parameters : p_date1 type d.
    SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
    s_saknr FOR bsik-saknr,
    s_lifnr FOR bsik-lifnr.
    SELECT bukrs saknr bldat wrbtr lifnr zfbdt
    FROM bsik
    INTO <b>corresponding fields of</b> TABLE t_out
    WHERE saknr IN s_saknr
    AND bukrs IN s_bukrs
    AND lifnr IN s_lifnr.
    <b>loop at t_out.</b>
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
    EXPORTING
    i_datum_bis = p_date1
    i_datum_von = t_out-zfbdt
    I_KZ_EXCL_VON = '0'
    I_KZ_INCL_BIS = '0'
    I_KZ_ULT_BIS = ' '
    I_KZ_ULT_VON = ' '
    I_STGMETH = '0'
    I_SZBMETH = '1'
    IMPORTING
    E_TAGE = t_out-ageing
    EXCEPTIONS
    DAYS_METHOD_NOT_DEFINED = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    <b>modify t_out.</b>
    clear t_out.
    <b>endloop.</b>
    LOOP AT t_out.
    WRITE : / t_out-saknr,
    t_out-lifnr,
    t_out-wrbtr,
    t_out-zfbdt,
    t_out-ageing.
    endloop
    rgds
    anver
    Message was edited by: Anversha s

  • Due Date Calculation on A/R Invoice

    The Due date calculation on an Invoice for a customer with a payment condition of 30 days is wrong on  the system:
    Invoice DocDate: 11.05.17
    Invoice DueDate:  11.07.01
    On the BP Master Data is set a payment condition of 30 days. So it should be a due date of June, not July. This is a invoice that comes from a Sales Order with Approval Procedure.
    Our version is 2007 A SP:00 PL:49.
    Thanks in Advance...

    Hello,
    Perfect Notification
    For Payment Terms for Business Partner----
    IF (@transaction_type = 'A' Or @transaction_type = 'U')  AND @object_type = '17'
    BEGIN
    Declare @GroupNum as Nvarchar(20)
    Declare @OCRDGroupNum as Nvarchar(20)
    Declare @PaymentTermCode as Nvarchar(20)
    Declare @PaymentTermName as Nvarchar(20)
    Set @PaymentTermCode = (Select GroupNum from OCRD where CardCode = (Select CardCode from ORDR where DocEntry =@list_of_cols_val_tab_del))
    Set @PaymentTermName = (Select PymntGroup from OCTG where GroupNum = @PaymentTermCode )
    Set @GroupNum = (select GroupNum from ORDR where DocEntry =@list_of_cols_val_tab_del)
    Set @OCRDGroupNum =(Select GroupNum from OCRD where CardCode = (Select CardCode from ORDR where DocEntry =@list_of_cols_val_tab_del))
    If @GroupNum != @OCRDGroupNum
         begin
              SET @error = 10
              SET @error_message = N'Payment Terms Should be  ' + '   ' + @PaymentTermName + ' ' +' For this Business Partner'
         end
    END
    End----
    It will Definatillly Help You.
    Thanks
    Manvendra Singh Niranjan

  • Baseline Date for Due Date Calculation required for S/L indicators

    Hello,
    Iu2019m facing the following problem
    Iu2019m trying to insert an invoice (using a customer master record) but the system blocks me because the field ZFBDT (Baseline Date for Due Date Calculation) is a Required entry.
    The strange thing is  that if I use a S/L indicators the field is mandatory, if not the date may be defaulted.
    I checked in OB41 but there are non differences between Special PK and normal PK.
    Any ideas?
    Thanks in advance
    Alberto

    Dear Alberto,
    the field "Due On (BSEG-ZFBDT)" cannot be controlled with field status.
    It is controlled by field attribute of screen painter (Tcd: SE51).  If
    you look at element attribute for "Due On" field, a flag for required
    entry is activated.  In this case, field status has no control over
    the field.
    As of release 3.1G, field BSEG-ZFBDT is hardcoded in most FI screens
    to be mandatory and cannot be influenced by any field status
    changes. This situation is only valid when posting with special G/L
    indicator (ie PK 29/39).
    SAP development team has determined that this is a critical field.  The
    reason behind this is that this special GL screen and the data entered
    here are very important to many other programs. This data affects
    liabilities and receivables where due date is necessary almost
    everytime. Thus, we changed this field in this screen in order to
    prevent problems in many other areas. The reason is explained further
    in note 95079.
    I hope this helps You.
    mauri

  • Ageing calculation in vendor ageing report (urgent)

    hi everybody
    see i have to calucalate ageing of a vendor depending on following formula , can any one there can help me to achieve this. the formula is as follows--
    1. To get the output for ageing---
    AGEING = Current Date - Bline date
    suppose current date is 18th sep & Bline date is 18th aug then ageing should be 30 days.
    so plz specify that how toachieve this.
    2. in the same way i want also DUE ON Date
    which is nothing but
    Due On = BLINE DATE + NO.of days
    so plz give the solution that how to achieve both the above.

    <b>
    [code]
    1)PARAMETER:Curr_Date TYPE dats,
             Bl_date  TYPE dats.
    DATA:lv_diff TYPE i,  
      lv_no_date type i. 
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
      EXPORTING  
    i_datum_bis             = Curr_Date i_datum_von             = Bl_date 
    IMPORTING  
    e_tage                  = lv_diff
    EXCEPTIONS  
    days_method_not_defined = 1
       OTHERS                  = 2.
    Check this thread out
    <a class="jive_macro jive_macro_message" href="" __jive_macro_name="message" modifiedtitle="true" __default_attr="2021335"></a>
    2)
    Check this thread out
    Re: Function module for DATE
    call function 'RP_CALC_DATE_IN_INTERVAL'    
        exporting      
           date      = b_date
         days      = numbe_day          
      months    = 0        
         signum    = '+'     
            years     = 0      
      importing            
    calc_date = wa_date.[/code][/code]</b>

  • Due Date Indicator on vendor line item

    Hi,
    We have raised a credit memo via logistics invoice verification.
    The baseline date is 21/10/2008 and the payment term is 31
    days from month end. That makes the credit memo due in 40 days time. However on the vendor open item list (FBL1N) the due date indicator is set to "DUE". This should be set as "NOT DUE". The payment run (F110) is picking up this line item in the payment run, when infact it should not do so.
    Please help.
    Many Thanks
    Pops Balram
    Toyota SA

    The first answer is the general rule: the due date of a credit memo is the baseline date.
    There are 2 exceptions: if you put the number of an invoice in the field BSEG-REBZG (Number of the Invoice the Transaction Belongs to), the due date of the credit memo is the due date of the invoice.
    2nd exception: if you put the constant 'V' in this field REBZG (you can do it thru a substitution rule), the due date will be calculated the same way as for an invoice.
    You can see this in the documentation of the data element REBZG:
    A special rule applies to credit memos which have a "V" in this field.
    The due date is determined in the same way as for an invoice. If the field is empty (containing neither a document number nor a "V") the due date is the baseline date for payment.

  • How to set the payment Due date calculation as per working days.

    how to make changes in the vendor Payment terms so that while calculating the Payment due date as per Payment terms, system calculates it based on Working Days & not the Calender days ?
    Help is much appriciated.
    Thank you,
    Amit

    Hi,
    This is the standard settings by SAP, normally we couldn't change it to working day.
    Good luck
    Tao

  • Due Date calculation

    Dear Gurus,
    Is there any std report is available which calculates due date for payments considering payment terma maintained in the purchase order . It should calculate due date from the date of GRN.
    Rgds,
    Saurabh

    Hi Saurabh,
    Check the following reports -
    S_ALR_87012078 - Due Date Analysis for Open Items
    S_ALR_87012084 - Open Items - Vendor Due Date Forecast
    Regards,
    Mike

  • Due date on a Vendor Debit Line Item

    Hi,
    We have a debit line item in Vendor Open items. The Baseline date is 09.06.2010 with 30 days net payment terms, but the due date is showing as 09.06.2010 and not 09.07.2010.
    Any idea?
    SAPFICO

    For a credit memo the due date is the baseline date. This is the default rule. If you want that the credit memo is taken in account with payment terms, you must either link it to an invoice by filling the field REBZG with the invoice number either put the constant 'V' in the same field (REBZG). With 'V' in REBZG, the credit memo is taken in F110 according to its payment term.
    see documentation of data element REBZG.

  • Recurring document - FBD1 with incorrect due-date calculation for AP

    Hi Gurus,
    in our ECC 6.0 system we are creating with F.14 FI-documents (SAPF120) based on recurring documents (created with FBD1) for various purposes (e.g. Recurring entries for IC-business).
    Therefore it's important that the system provides in the final processing of the recurring documents the correct net-due-date in the AP-document based on the document date and the payment term included in the AP-masterdata (LFB1-ZTERM).
    Problem:
    The processed FI-document contains the correct payment term but the calculated net-due-date with regards to the document date (BKPF-BLDAT) isn't correct. A Dummy-Update of the FI-document with FB02 on field BSEG-ZTERM provides finally the correct net due date but this a not recommended solution.
    Any ideas how to solve that issue???
    Thanks for replies.
    BR, Bernd

    Hi Vishnu,
    the defined payment term is
    fix day: 15
    additional month: 1.
    Default for baseline date is posting date
    Therefore the expectation is that net due date is calculated for posting date
    e.g. : 01.02.2012 to 15.03.2012.
    The line item after processing in FI-document shows :
    Posting Date : 01.02.2012
    Bline Date:   01.02.2012
    Days/percent: 35
    Net due date: 07.03.2012 (dd.mm.yyyy)
    That's wrong according to my understanding of the payment term definition.
    BR, Bernd

  • Net due date calculation

    in vendor invoice, how system calculate the net due date, I enter document date is July.1.2010, payment term is Z001, system automatically update the field  cash discount days 1, INVFO-ZBD1T, but this from structure. may I know which table we can use? thanks

    Hi,
    The system calculates the Net due date based on the 'Payment Term' settings. The details of the payment terms are stored in table T052.
    The system calculates the date based on the 'Baseline date' and the number of days term period.
    If you can list the settings of your payment term Z001 from t-code OBB8, I can explain you with an example.
    Regards,
    Mike

  • Invoice-wie Due Date List for Vendors

    Hi,
    Please inform me, if there is an report for vendor informing exact the Due Date for each Invoice Drawn for that Vendor
    Regards
    Ashwin

    Use Transaction Code FBL1N & EXECUTE,  then  you go for
    change layout button,
    select "Net due date" field & activate(means get the field  from right side to left side).
    System will give the due date each invoice wise.
    chandra

  • Include Document Date & Doc Due Date in SAP B1 Aging Details Report

    We are not able to view the actual document date and document due date from the Aging details report, it should be an essential information that should be show in the aging report. It make no sense that user still have to manually drill into each document to just read the document date/ due date for their aging analysis!!!
    Try to imaging that how important this information to a business, for instance, to age the invoice which due for 1 - 30 days, the document date which due for 1 days is categorise into 1-30days aged, the documents due for 30days also categorise into 1-30days aged, however it bring the different meanings to user and user need these information to take the action decision! How useful for an aging report which could not equip user with these basic information to provide user with efficiency to make effective decision???
    I think it is necessary to incorporate this level of details to the SAP B1 Aging Report.

    Hi Theerawat,
    You may check these threads first:
    Document Date
    Posting / Due / Document date trouble
    Re: Posting Date
    Re: Difference between posting & system date in Inventory Audit Report
    Thanks,
    Gordon

  • Letter of Credit in Payment Due Date Calculation

    Dear All,
    I meet a case as following:
    Sales Order A with 80% Letter of Credit
    (L/C) payment (set in header condition) and 20% downpayment, with Payment Terms: L/C payment due
    date is before a special date.
    Question 1: If downpayment has cleared, whether user can see that a
    record of downpayment paid in a Sales Order under SAP standard design?
    Question 2: whether SAP standard desgin/configuration can set L/C
    payment due date by a payment term? note: L/C is flexible depends on
    different Sales Order?
    Thanks for all your helps!

    Did you find a solution to this?
    Is it possible to separate down-payment from rest of sales order - so Letter of Credit is only for the sales value minus down- payment?
    SO value 1 Mio USD
    Down-payment .2 Mio USD
    LOC value >> .8 Mio USD?
    Cheers
    Hein

Maybe you are looking for

  • Exporting data from text file to a table using utl_file

    Dear all, I have a text file as below and i have a table having 12 columns. Now i need to insert this text file into the table story_books. CREATE TABLE story_books book_id NUMBER, Category VARCHAR2(100 BYTE), Book_type VARCHAR2(100 BYTE), Name VARCH

  • Logic Pro 8 won't allow me to select Novation nio 2/4 as input device...

    Hi Can someone please advise about this problem? It used to work fine a while back, but I don't know what's happened since then - under Preferences > Audio > Devices > Core Audio the nio 2/4 shows up, but when I try to select it as my input device fo

  • ThinkVanta​ge Button doesn't work on Windows 7 64 bit

    Hi all, Please, i nedd this software for my x201i with windows 7 64 bit https://dl.dropbox.com/u/74808799/access_ibm.JPG Someone can help me? Tnks

  • Pls help solve

    i have this: int maxNum, len;           String stringMax, res;                     try{                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");                Connection con = DriverManager.getConnection("jdbc:odbc:RezSystem","user9","");      

  • I can not read swedish letters, Ö, Ä, Å.

    Hi, I'm having a problem in my mailbox, I can't read or write the special swedish letters, Ö, Ä, Å. I entered the text encoding tab, it's checked on automatic. Can anyone be helpful? Thank you.