Function module usage in vendor ageing report for ageing calculation

hi everybody there
as i have to calculate the vendor ageing
which is nothing but
AGEING = Currentdate - BLINE date
so for this i have coded as follows and use the function module but couldn't get the result .it is alwayas showing 0 means ageing  is o but it is not like that
parameter:p_date1 type dats.
call function 'days_between_two_dates'
exporting
i_datum_bis = p_date1
i_datum_von = itab-zfbdt
importing
e_tag = itab-ageing
exceptions
days_method_not_defined =1
others = 2.
so what is the bug in it.

hi,
<b>declare ur internal table field , of type BSIK-ZFBDT or sy-datum
thats the only thing u want to do.
the other parameter is sy-datum</b>
<b>data: field like BSIK-ZFBDT.</b>
DATA:lv_diff TYPE i.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
<b>i_datum_bis = sy-datum
i_datum_von =  field</b>
IMPORTING
e_tage = <b>lv_diff</b>
EXCEPTIONS
days_method_not_defined = 1
OTHERS = 2.
IF sy-subrc = 0.
WRITE:/ <b>lv_diff</b>.
ENDIF.
nw it will work.
rgds'

Similar Messages

  • Function module to get vendor-CNPJ by vendor number

    Hello SAP Experts,
    Is there any function module to get vendor CNPJ number (For Brazil) by vendor number? If not, is there any alternative to get the CNPJ by vendor number?
    Thank you,
    Magesh.

    Can you check below FM
    J_1B_NFE_IN                    NF-e incoming
    J_1BNFE_GET_CUSTOMER_FROM_CNPJ Derive vendor from CNPJ
    J_1BNFE_GET_ORGDATA_FROM_CNPJ  Derive company / plant from CNPJ
    J_1BNFE_GET_VENDOR_FROM_CNPJ   Derive vendor from CNPJ

  • Vendor ageing report for down payment bucketwise

    Hi
    I have paid many downpayment to various vendors. Now i want the ageing report for the same (i.e. bucket wise i.e. 0-30 days, 31-60 days and so on).
    This i am getting for vendor invoices in TCode: S_ALR_87012085 (Vendor payment history with OI sorted list).
    Please let me know if the bucketwise report is possible for the downpayment too.

    Hi,
    Vendor ageing for down payments as well as invoice i use to see from T.code FBL1N by creating layouts.
    Choose Arreas after net due date from layout and for that column you can apply a rule that from 0 to Lessthan or equal to 30.
    Like that you can create the layouts. In FBL1N you can give this layout (down) so information come in that format.
    The one disadvantage is that you have to select manually the layouts and you can see only one ageing information at a time.
    Regards,
    Sankar

  • Aging Report for consolidating Business Partners

    I have a customer that is using consolidation functionality for its vendors. The BP parent it is set as multicurrency, the childrenu2019s for this parent are set with a different currency (USD, CAD, RMB etc).  My question is how I can obtain a proper aging report for this consolidated BP (by BP children currency) as for now all the transactions are automatically converted in local currency even when Iu2019m selecting the BP currency to display.
    Thank you,
    Alex Corbu

    Hi Alex
    The best would be a query on JDT1 table linked to OINV for example. The problem as you mentioned is that although the document is against the sub account, it is automatically posted against the head account for balance and payment purposes. In the journal file it only keeps the Head account and not the sub accounts. In OINV (and other marketing documents) you can use the FatherCard field to identify the Head account and the CardCode the sub account. These will of course be linked by the Document number from OINV and the Ref1 from JDT1.
    The above is assuming you need the information exactly the same as the ageing, as the ageing is by default pulled from the Journal tables. You could simplify this by using just the OINV table. Remember that the balance is made up of Invoices less Credit Notes, so in this instance it would be OINV minus ORIN entries.
    Hope the above all makes sense, if not just ask.
    Kind regards
    Peter Juby

  • Any Standard Aging report for MM

    Hello All,
    I am looking a standard aging report for Materials on my storage location.
    We are following batch.
    Please help
    Regards
    Lal

    Hi ,
    I hope for your new requirement this might help you .
    If you want to perform an analysis based on the key figure dead stock, proceed as follows:
    From the Inventory Controlling menu, select Environment -> Document evaluations-> Dead stock.
    1. The selection screen appears.
    2. Specify the desired analysis criterion and selection parameters.
    You can carry out the analysis for all plants, that is, for each material, data from all plants are grouped together or only for certain plants, that is, the analysis is created for every designated plant. Any period can be selected for the analysis. The system suggests 90 days as the period to analyze, the calculation starting from the current date.
    The following functions can be used to process the material list.
    Detailed Display
    By using the function Detailed display, you can call up in a table or graph form detailed data for a material including the respective material document. You can analyze all material documents that are related to the evaluated stock of a material.
    If you want to view detailed information for a certain material, proceed as follows:
    Position the cursor on the desired material in the results list and select Edit ->Detailed display.
    A dialog box appears in which you can choose either a graph or table display.
    If you select the graphic, you can display the latest information on:
    •     Cumulative receipts/issues
    •     Warehouse issues
    •     Warehouse receipts
    •     Stock level
    If you select the table, you can display the following information:
    •     Stock movements
    •     Cumulative stock movements
    •     Current stock level
    From the stock movement table you can drill down as far as the material document level to see detailed information. To display stock movements on a particular day, position the cursor on the relevant line and select the Choose function. A popup window appears which displays all the movements on the selected day. The individual movements for a selected date are displayed in a dialog box.
    To display the document for a particular movement, position the cursor on the relevant line and select the Choose function. A popup window appears which displays the document.
    Similarly you can try for the slow moving also .please let me know wether you were able to find what you were looking for .
    source: SAP
    cheers
    KP

  • Aging Report for A/p

    I mean is there anyway to user decode for showing sum(amount) for different period of dates
    is there any idea to make faster ageing report for accounts payable module.
    Thanks AHON
    Edited by: [email protected] on Nov 22, 2009 7:09 AM

    plz write more clear requirements...... ur table structures and report output ....
    i have few aging reports and all working without any problem.....it depends on ur table structure also.

  • Aging report for Open Invoice

    Hi All,
    I need to develop an Aging report for open invoice, there is no indication for open invoice or close invoice since we are using customise DS and DS from third party system. only one key flag we have is clearing date. so kindly let me know how to write the logic for this requirement.. can I use Customer exit for this? I have an Idea to do like
    first logic is
    *If Clearing date = blank than invoice is = open (by using of this logic we can get all open invoice).
    second logic
    total number of invoice = current date - document date.
    but I do not know how to implement this logic in BEx hnece kinnly advice me whether this logic can be work or suggest with different solution ples..
    Regards,

    hi,
    You can  check few default PO reports wid proper paramater in it
    or
    Can check table EKBE
    or
    Check PO history in the PO doc
    Or
    Check the ME80FN
    Regards
    Priyanka.P

  • AP Invoice Aging Report for past date

    hi guys,
    I am running R12.
    my requirement is to run AP invoice aging report for past dates (same like AP Trial Balance Report), but the seeded invoice aging report has no option to do so.
    would appreciate some help
    thanks in advance
    Ravi

    Hi Senthil,
    I am running R12.
    my requirement is to run AP invoice aging report for past dates (same like AP Trial Balance Report
    if u have any solution to this , please suggest me how to resolve this requierement.
    thanks in advance
    Ravi
    mail:[email protected]

  • Can using query create aging report for GL Account

    Hi all expert,
    I have a challenge scenario which customer request print out aging report for the following GL Account.
    This is not a business partner account. However, customer want display like aging report.
    30 days aging report for the following GL accounts by projects:-
         i)     WIP (Work In Progress) account
         ii)     Accrued Revenue account
         iii)     Accrued Cost account
    Examples:
                            Current Balance       30 day   60 day  90 day   120 day
    Account  WIP         10000               2000        3000      5000     0
    Any idea or example given? If yes, can you provide a query here?
    Regards,
    Eric Tan

    Hi Eric
    In standard SAP Business One this is difficult as the reports are 2 dimensional. To achieve this you will need to write multiple select statements into a temporary table and then select the final result from the temp table. Here is a sample for you to test:
    USE [*DATABASE_NAME*]
    GO
    /****** Object:  StoredProcedure [dbo].[REPORT_NAME]    Script Date: 04/24/2009 13:17:21 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE proc [dbo].[*REPORT_NAME*]
    as
    set nocount on
    begin
    DECLARE @Day_no varchar(2)
    DECLARE @Month_no varchar(2)
    DECLARE @Year_no varchar(4)
    DECLARE @Start_Date Datetime
    SET @Day_no = DAY(GetDate())
    SET @Month_no = MONTH(GetDate())
    SET @Year_no = YEAR(GetDate())
    SET @Start_Date = @Year_No + '/' + @Month_no + '/' + @Day_no --  + '/' + @Year_No
    IF OBJECT_ID(N'tempdb..#CRDAGEING', N'U') IS NOT NULL
    drop table #CRDAGEING
    SELECT T0.[CardCode] AS [CardCode], T0.[CardName] AS [CardName], -T0.[Balance] AS [Balance], CAST(0 AS MONEY) AS [Current], CAST(0 AS MONEY) AS [1Week], CAST(0 AS MONEY) AS [2Weeks], CAST(0 AS MONEY) AS [3Weeks], CAST(0 AS MONEY) AS [4Weeks], CAST(0 AS MONEY) AS [5Weeks], CAST(0 AS MONEY) AS [6Weeks], CAST(0 AS MONEY) AS [Over6Weeks], CAST(0 AS MONEY) AS [Avg3Months], CAST (0 AS MONEY) AS [Onhand] INTO #CRDAGEING FROM OCRD T0 WHERE T0.[CardType] = 'S' -- and T0.[CardCode] <> '' --and T0.[DocDate] >= @FromDate AND T0.[DocDate] <= @ToDate
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] <= @Start_Date GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] >= DATEADD(DAY,1,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,8,@Start_Date) GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,8,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,15,@Start_Date) GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,15,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,22,@Start_Date) GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,22,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,29,@Start_Date) GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,29,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,36,@Start_Date) GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,36,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,43,@Start_Date) GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,43,@Start_Date)  GROUP BY T1.[ShortName]
    SELECT SR.[CardCode], MAX(SR.[CardName]), SUM(SR.[Balance]) AS [BalanceOwing], SUM(SR.[Current]) AS [Current], SUM(SR.[1Week]) AS [1Week], SUM(SR.[2Weeks]) AS [2Weeks], SUM(SR.[3Weeks]) AS [3Weeks], SUM(SR.[4Weeks]) AS [4Weeks], SUM(SR.[5Weeks]) AS [5Weeks], SUM(SR.[6Weeks]) AS [6Weeks], SUM(SR.[Over6Weeks]) AS [Over6Weeks] FROM dbo.#CRDAGEING SR GROUP BY SR.[CardCode] ORDER BY SR.[CardCode]
    END
    Go to Microsoft SQL Studio manager and select your company database. Then expand the list and select Programmability > Stored Procedures. Right click on Stored Procedures and select New Stored Procedure. Copy the above code over the code in the edit window and change the database name as well as report name. Then select Execute to create the stored procedure. If you make changes, remember to change the word CREATE to ALTER (with other words CREATE for the first execute, and ALTER thereafter). Then in SAP Business One create a new query and leave everything blank. Click on execute and select the pencil to change to edit mode. Remove the words SELECT and type in EXEC REPORT_NAME (change the REPORT_NAME to the name you used in SQL). Then execute again and the results will be displayed in SAP Business One.
    Let me know if you get stuck. Remember the above is an example and will need to be changed to use your tables and fields as required. The basic idea is to move across by one column with each select statement. So for example the first select statement does the CURRENT column, the second one the 30DAYS column, and so on.
    Kind regards
    Peter Juby

  • Re: Aging Report For GL Accounts

    Hi Friends,
    Is their any report for aging GL Account? Without any conncection to Sub-ledger
    It is not reconciliation account, but open Item is managed.
    Regards,
    vivek

    Use t code ME2N and click 'Account Assignment" from application tool bar or press Shift + F12 to view PO with GL code. If GL code is not showing select from the layout.
    Rgds,
    Vijay

  • Inventory aging report for vehicle parts

    Hello Guys,
    I need to prepare an inventory aging report for Vehicle parts.
    We already have new vehice ad used vehicle's inventory aging reports created by somebody else.
    I am very new to sap-bi.
    I am very confused about designing same cz i checked with the fields ad they are a ittle different from the fields which are there in above two reports.
    I have downloaded 0ic_c03 from business content but do not know how to prepare its datasource......
    Please tell me how should i go about it.
    Thanks & Regards,
    Dolly

    Hi Dolly,
    What is your question? It's almost impossible to provide an answer without any information.
    Perhaps you should try to ask in your company for some help.
    Cheers

  • Aging Report for Inventory

    Dear Brother,
    Is there any standard report for aging purpose for MM inventory.
    Regards

    The following links contain the necesssary info u required..
    [https://forums.sdn.sap.com/click.jspa?searchID=25345713&messageID=7093050]
    [https://forums.sdn.sap.com/click.jspa?searchID=25345713&messageID=7330110]
    [https://forums.sdn.sap.com/click.jspa?searchID=25345713&messageID=7092697]
    karthick

  • Aging Report for AR

    Dear All,
    I have trouble about "Execute Aging Report for AR" (FDI0).
    The aging report from period 3 (march) till period 4 (may) is different from the amount in the Customer Line Item (FBL5N), whereas it should be has the same amount, isn't it?
    Please help me, what should I check first..? its urgent..
    Thanks & regards,
    Vanda

    hi,
    compare with report RFDOPR00
    and have a look on that discussion: AR Credit Concept of Aging
    regards
    Andreas

  • Inventory ageing report for batches

    Hi Experts,
    I am looking for a ageing report for batches. MC46 and MC50 is not displaying the batches which is my main requirement. I learnt that its not available in standard SAP. I am planning to develop a Zreport which is a copy/reference of MC46 and MC50.
    If you ever come across this situation before, which approach you followed? I appreciate if you throw some thoughts on builiding a query or Zreport or any logics.
    Regards,
    R.S

    Hi Shiva,
    Thanks for the information. We are not using SLED for the batches and BMBC is just a **** pit where you can use it as work list when you try to change mass batches. I dont know how BMBC helps in fetching a report for ageing.
    Regards,
    R.S

  • Function Module to get ABAP source code for a specific version

    Hi all
    Is there a function module that I can use to get the source code of another function module at a specific version?
    For example, can I call a function module passing in "FM_NAME" and "FM_VERSION" and have it return the lines of code associated with that object?
    Thanks in advance.
    Stuart

    Thanks guys
    That's incredibly helpful! I have one more question that I just thought of last night...
    Is there a way to hook into the code activation process? I want to be able to take a snapshot of the ABAP source code at each point when it is activated for use in another system, but need to be able to intercept this event and get the source code at that point in time.
    Any ideas?
    Thanks!

Maybe you are looking for

  • If I have a folder within a folder how can I keep both open at the same time?

    I now have IOS 10.10.1 on my iMac and can no longer open a file within a file and have the main file remain open along with the inner file. I used to be able to do this in Lion.

  • How to access another control in a page in another xaml file?

    I have a XAML page name GameMainSP.xaml. Can I access a control in that page from a module in the project? I was only trying to change a text block controls Text property. Is this possible? Once you eliminate the impossible, whatever remains, no matt

  • Offline installer for Adobe Reader

    I'm trying to download offline installer of latest Adobe Reader for bulk installations on PCs in my company. It used to be simple and last version I got was 11.02. Latest version forces me to register for distribution of Adobe software. Fair enough,

  • S.O.S.!!!! Please help with App Error 205

    So yesterday, I was so excited about the release of the Mac Desktop manager. I installed it on my Mac, started running the updates for my 8330 and the usb connector fell out while updating. I re-inserted it but it did not continue the update. Now, my

  • Changing values for EEO Questionnaire Information Fields in E-Recruiting

    We are implementing E-Recruiting 6.0.  I have changed entries for EEO values for Race Category via the IMG SAP E-Recruiting>Recruitment>Applicant Tracking>Questionnaires>Equal Employment Opportunities-->Assign Values to Information Fields.  When I at