Problem in making logic for customer balance report

Hi,
I am working on a customer balance report in which i am picking the data from BSAD and BSID tables. I am facing a problem that i am able to calculate the opening balance in it but not able to calculate  closing balance. I am comparing the data with tcode FBL5N for opening and closing  balances for a given date range.  Kindly help me out where i am getting wrong:-
Here the link to the code :-
http://docs.google.com/View?id=dfxswwff_11fdktr7ct
Edited by: nav009 on Feb 6, 2010 9:30 AM

Hi Nikhil,
Thanks for you response but i had developed the report and  i am able to pick the correct data but i am facing the problem in displaying the NETAMT which is displaying the data using this formula :-
1.) NETAMT = NETAMT +  W_TAB1-DR + W_TAB1-CR.
so that the last value matches with the closing balance.
When i am using this formula i am not able to display the correct data of deducting or addition of the opening balance in it but the value matches with closing balance .
2.) NETAMT = NETAMT + W_OPBAL-OPBAL +  W_TAB1-DR + W_TAB1-CR.
When i am using this formula it is showing the first value correctly but not the last one which will be displayed in the closing balance.
I want to have desired output to display the first value to be displayed as it is showing in the (2) and last value to be displayed as  it is showing in (1) last value.
How can i achieve this  functionality? i really want to know...
Edited by: nav009 on Feb 10, 2010 6:29 AM

Similar Messages

  • Hi masters, want bapi for customer balance report

    HI Masters,
                   please can any one give reply about bapi whch one is using for developing customer balance report in webdynpro java
    I want to see the customer balance report in portal through developing webdynpro java application only. for developing , i need bapi regarding customer balance report. Customer when he login the portal he has to view his ledger balance in portal.please  give reply about the bapi to see customer ledger balance . we can do by transactional iview. but i need only through webndynpro java application
    reply will appreciated.

    Hi surya,
    The tcode for customer balance report is FBL5N
    BAPI_AR_ACC_GETKEYDATEBALANCE -
    >Customer account balance at a key date .
    Regards,
    srikanth

  • Problem in Logic for Customer Ageing Report

    Hi,
    I am developing a Customer Ageing Report in which i am facing a problem i.e. i am taking tables BSID,BSAD in which i ham taking the open items first and then i am using for all entries in it on the open items and i had debugged it and data picking is correct .
    But the MAJOR problem comes when the data is stored in the respective coloumns i.e. 0-30 ,31-60-61-90 etc.. Currently i am comparing the code with the Standard Report i.e.S_ALR_87012126 it is not coming accurate...
    Is there any way to solve this problem ....
    Edited by: nav009 on Jan 8, 2010 11:39 AM

    Hi,
    First you need to calculate the Due date of the Transaction with the help of FM 'NET_DUE_DATE_GET'.
    Once you get the Due date calculate the value wf_nod  as wf_nod = p_budat - wf_due_date where p_budat is the date on which you want to run the ageing report and wf_due_date  is due date of the transaction.
    once you get this wf_nod write the following logic :
          IF wf_nod < 0.
            wa_tab-ndue = wa_data-dmbtr.
          ELSE.
            IF wf_nod <= pnod1.
              wa_tab-amt1 = wa_data-dmbtr.
            ELSE.
              IF wf_nod > pnod1 AND wf_nod <= pnod2.
                wa_tab-amt2 = wa_data-dmbtr.
              ELSE.
                IF wf_nod > pnod2 AND wf_nod <= pnod3.
                  wa_tab-amt3 = wa_data-dmbtr.
                ELSE.
                  IF wf_nod > pnod3 AND wf_nod <= pnod4.
                    wa_tab-amt4 = wa_data-dmbtr.
                  ELSE.
                    IF wf_nod > pnod4 AND wf_nod <= pnod5.
                      wa_tab-amt5 = wa_data-dmbtr.
                    ELSE.
                      IF wf_nod > pnod5.
                        wa_tab-amt6 = wa_data-dmbtr.
                      ENDIF.
                    ENDIF.
                  ENDIF.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
    Collect wa_tab into it_tab.
    where pnod1.......pnod5 are the aging period as 30,60,90,180,365 etc.
    by this you will get correct results.
    Please get back to me if you need some more help on this.
    Regards,
    Nikhil

  • Customer Balance Report throught Abap

    Hi,
    I want to develop a report Customer Balance Report in which along with details i have to display the closing and opening balance of it. As per search through SDN i come to know that BSAD,BSID tables to be used so that data can reterived and for cross checking the out put Standard Report named S_ALR_87012172 and the Tcode FBL5N ..
    I want to know is this data is sufficient to start this report and the data for displaying the closing and the opening balance of the customer?

    Hi  ,
    To derive an opening balance, you need to decide on key date. The date one which you want to see an opening balance.
    Suppose that date is wf_keydt . Then your logic for calculating opening balance should be as folloes :
      SELECT kunnr bukrs belnr gjahr buzei blart shkzg dmbtr
               INTO TABLE it_data
      FROM bsid
      WHERE bukrs = p_bukrs
      AND   kunnr IN s_kunnr
      AND   budat <= wf_keydt
      AND   hkont = p_hkont
      AND   gsber = p_gsber
      AND   bstat = space
      AND   umskz = space.
      SELECT kunnr bukrs belnr gjahr buzei blart shkzg dmbtr
               APPENDING TABLE it_data
      FROM bsad
      WHERE bukrs = p_bukrs
      AND   kunnr IN s_kunnr
      AND   budat <= wf_keydt
      AND   augdt > wf_keydt
      AND   hkont = p_hkont
      AND   gsber = p_gsber
      AND   bstat = space
      AND   umskz = space.
      LOOP AT it_data INTO wa_data.
        CLEAR wa_tab.
        wa_tab-kunnr = wa_data-kunnr.
       wa_tab-dmbtr = wa_data-dmbtr. "+nvj15102007 security deposit added in output
        IF wa_data-shkzg = 'S'.
          wa_tab-opbal =  wa_data-dmbtr.
        ELSE.
          wa_tab-opbal =  wa_data-dmbtr * -1.
        ENDIF.
        COLLECT wa_tab INTO it_tab.
      ENDLOOP.
      REFRESH it_data.
    Hope this helps to you.
    Btw I am leaving for the day now. Any thing else do reply to me. I will revert to you tomorrow.
    Regards,
    Nikhil

  • Please update the functional specifications for Vendor Balance Report

    Dear All,
    Please update the functional specifications for Vendor Balance Report with
    proper descriptions.
    Please include
    1. How your selection screen should look like..
    2. Output format ( in an excel sheet)
    3. Logic for every field in the output format (viz. .. how do link the
    vendors from the selection screen to the BKPf and BSEG tables, how do you
    find open and closed items in BSEG , etc.)
    Please avoid statements like 'The total value of all the break-up should
    tally with the balance as shown in FBL1N for a given vendor for the given
    day.'
    You need to give the logic for the FBL1N, in that case.
    Regards
    Rama Mohan

    Hello again,
    Regarding having them update the specs, one can dream. Dreams are free. LOL. Hopefully the memory makers will update their specs as more makers start supporting a large memory configuration.
    The 4GB sticks I am using are http://shop.kingston.com/partsinfo.asp?ktcpartno=KTL-TP667/4G
    I did not do an extended test of the sticks in my MBP. Their home is in the ThinkPad I have because it is running Windows Server 2008 with Hyper-V.
    As you can see from the link above, these little suckers are pricey. But consider the price of 2GB SoDIMMs were $950 when they entered the market a couple of years ago. The price will drop.
    I asked the Kingston rep that sent these to me if online sites like newegg.com would have them soon. She indicated no, but the corporate buying sites like CDW and Zone would. So check around. They just started shipped a couple of weeks ago so be patient.
    If you have any other questions, please stop by http://blogs.technet.com/keithcombs/archive/2008/07/05/testing-my-apple-macbook- pro-with-8gb-of-ram.aspx and ask there. I'll see them much more quickly.
    Cheers,
    Keith Combs
    Microsoft

  • How can i have customer balance report at Ship to Party Level

    HI All
    My client want to have a report for  customer balances  at ship to party level
    For example for a customer ABC has 4 ship to party and they want to track Sales at each ship to party level for Customer ABC
    Regards
    Sandip

    Thanks Buddi,
    Partner function SB works the way we wanted it to.
    Regards

  • How to get Daily Customer Balance Report?

    Hi
    I have received a requirement from the user where he has to send the Daily Customer balance report currently he is using the T.Code S_ALR_87012172 Customer Balances in Local Currency for fetching the monthly data.
    I want to know what are the ways to make the report and what is the best way out of them to do it. Can it be done through user Exit, BADI, query or we have to get the Z report made by the apaber.
    Also, if it is possible please tell me the way step by step for user exit, badi or query if that is to be used.
    Please help
    Thanks in advance
    Pankaj

    Thanks for your reply Aleksey...
    We are using the report S_ALR_87012172 - Customer Balances in Local Currency and user want the same report on daily basis like Total Debit/Credit, Balance carryforward and the Accumulated balance. I have checked but unable to find out any such output.
    Please suggest what to do whether to make chnges in report painter or have to write a query. If I write a query then plz suggest me the tables as I am trying to do that but unable to link the Balance carryforward and accumulated balance.
    Regards
    Pankaj

  • Problem in Web adi for custom integrator.

    Hi All,
    I never used Web ADI. i read some document and feel that it is easy... but facing problem while developing.
    The basic requirement as follows -
    1. There is a custom database, say XXA.
    2. A staging table (xxa_table) for upload data from csv files to base table.
    3. Data upload using concurrent program from xxa_table to base table is working fine; but now I need to upload csv file from user desktop and load the csv data into staging table (xxa_table).
    After applying below scripts I got some permission access error.
    Please guide me to setup for upload csv data in to staging table using web adi.
    So I run below scripts -
    DECLARE
    P_INTEGRATOR_CODE      VARCHAR2(30);
    P_INTERFACE_CODE      VARCHAR2(30);
    P_LAYOUT_CODE           VARCHAR2(30);
    P_APPLICATION_ID      NUMBER(15);
    P_OBJECT_CODE           VARCHAR2(20);
    P_INTEGRATOR_USER_NAME      VARCHAR2(240);
    P_LANGUAGE           VARCHAR2(4);
    P_SOURCE_LANGUAGE      VARCHAR2(4);
    P_USER_ID           NUMBER(15);
    P_INTERFACE_TABLE_NAME      VARCHAR2(50);
    P_INTERFACE_USER_NAME      VARCHAR2(240);
    P_FORCE           BOOLEAN;
    P_ALL_COLUMNS           BOOLEAN :=FALSE;
    BEGIN
    -- Define Constants
    -- Application ID of the product that will own this Integrator
    P_APPLICATION_ID      := 510;
    P_LANGUAGE           := 'US';
    P_SOURCE_LANGUAGE      := 'US';
    -- Applications Database User ID that owns this Integrator
    P_USER_ID           := 410;
    P_OBJECT_CODE           := PLAN_607';
    ---ADI details
    P_INTEGRATOR_USER_NAME      := 'Plan_7';
    P_INTERFACE_TABLE_NAME      := 'xxa_table'; -- Name of the Database staging table.
    P_INTERFACE_USER_NAME      := 'XXA_7 PLAN'; -- Name of the table that will be displayed in
    P_FORCE           := FALSE;
    P_ALL_COLUMNS           := FALSE;
    BNE_INTEGRATOR_UTILS.CREATE_INTEGRATOR (P_APPLICATION_ID,
                             P_OBJECT_CODE,
                             P_INTEGRATOR_USER_NAME,
                             P_LANGUAGE,
                             P_SOURCE_LANGUAGE,
                             P_USER_ID,
                             P_INTEGRATOR_CODE);
    BNE_INTEGRATOR_UTILS.CREATE_INTERFACE_FOR_TABLE (P_APPLICATION_ID,
                             P_OBJECT_CODE,
                                  P_INTEGRATOR_CODE,
                                  P_INTERFACE_TABLE_NAME,
                                  P_INTERFACE_USER_NAME, P_LANGUAGE,
                                  P_SOURCE_LANGUAGE, P_USER_ID,
                                  P_INTERFACE_CODE);
    BNE_INTEGRATOR_UTILS.CREATE_DEFAULT_LAYOUT(P_APPLICATION_ID,
                             P_OBJECT_CODE,
                             P_INTEGRATOR_CODE,
                             P_INTERFACE_CODE,
                        P_USER_ID,
                        P_FORCE,
                        P_ALL_COLUMNS,
                             P_LAYOUT_CODE);
    COMMIT;
    END;
    --------------------

    Duplicate thread (please post only once):
    Problem in Web adi for custom integrator
    Re: Problem in Web adi for custom integrator

  • Customer Balances Report problem?

    Hi,
    I am facing some problem it may have been discussed before but it is urgent so I am posting it.
    1) User wants to see the S_ALR_87012172 - Customer Balances in Local Currency on daily basis or any report which is similar to that.
    As far as I know he can't have this report on date wise for that we may have to go for the customization.
    Please suggest any other T. code or way out if we have in SAP.
    2) I have checked the records and I am confused as when I am running the FBL5N then I can see the balances for a customer
    1660000056 DR 31.03.2010 50,000.00
    5432402564 GL 31.03.2008 56,545.00-
    1900005638 AB 30.06.2007 56,545.00
    50,000.00
    which is fine as all are open items and due but when I run S_ALR_87012168 - Due Date Analysis for Open Items
    Due -                        Total OI                                      Total OI - Total OI
    NAZIMA STORES     10,681.45                                    23,809.50
    Please suggest me why is it so.
    Thanks and Regards
    Nitin

    Hi,
    Thanks for your reply PPIO_ENTRY....
    The customer does not want the report that is in FD10N and FD11 he wants the report based on the T. code S_ALR_87012172 - Customer Balances in Local Currency or something related to that.
    Please suggest...
    Thanks and Regards
    Nitin

  • Customer balance report - S_ALR_87012172

    Hi sap gurus, I searched forum but I couldn't get enough knowledge. how does S_ALR_87012172 calculate customer's balance value? based on posting date, clearing date, document date or other date? I'm checking with fbl5n but balances are different.as I understand, other sap users have same problem but there isn't clear information.
    difference between the balance of FBL5N and the balance of S_ALR_87012172
    Difference between FBL5N & S_ALR_87012172
    S_ALR_87012172 when compared with FBL5N does not reconcile
    diff in customer balance in the report S_ALR_87012172 & fbl5n

    Hello,
    You don't need to check clearing date.
    Please select data from BSID and BSAD less equal to key date. Is it equal to total balance report?
    You can balance report per each customer, I think you can check it for wrong balance's customer.
    Please share result to me.
    Regards,
    Burak

  • Vendor *** customer balance report

    hi friends
    i would like to know the balance outstanding ,at any point of time, of a vendor who is customer and
    also that of customer who is vendor . Do we have any system defined deports for this.
    thanq

    Hi Leo,
    For this scenario:
    you need to change your customer master data as well as vendor master data.
    In customer master data you give your vendor name and tick clearing with vendor in company code data of customer master.
    same with vendor master data, you need ot give your customer number in genral data and tick clearing with customer master data.
    Then you can use reports like FBL1N & FBL5N for net balance display.
    you need to tick vedor items/Customer item while executing reports.
    Best Regards
    Ashish Jain

  • Transaction code thro' SAP Query for customer spefific report

    hi experts,
    how to create transaction code (using SE43-) for the sap query created on own??
    I have created the following required for a customer specific report
    1.Infoset thro sq02
    2.user group thro sq03 and assigned it to infoset
    3.query thro sq01 and saved it with text
    earlier i have used logical database PNPCE ( relevant for PA and payroll modules reports)
    using sq01 , go to basic list , selected required infotypes and fields and
    then selected, SAP List viewer for viewing and i get the report.
    Now my question is how to create a separate transaction code for this sap query which i created
    should i use SE43( area menu maintenance and area class???_)
    should i create a variant and go to SE43??
    advice solicited
    snr

    Hello
    when you excecute the query in right han side corner  you can get the program name
    go to se80 select program & type this name and then you can create a tcode for that prog in SE80
    reward points if helpful.
    the prog name will be something like : AQZZ/SAPQUERY/* " ur query name
    you can search for the name also in this manner

  • Monitoring not possible for custom layout reports

    It seems that the monitor log doesn't track hits for reports created with the report wizard where "Custom" is chosen as the style in the "Report Layout" step of the wizard (for editing the HTML manually). If I choose "Tabular" or "Form" everything seems to work fine.
    The "Log activity" option is checked for all mentioned reports.

    Hello, I have the same problem to register in log the customized reports that I have created. How I can do this?
    Thanks

  • Processing Logic for custom fields to CRMD_OPPORT_H

    Hi all,
    I have a requirement to add two new custom fields to the Opportunity Table in CRM. I was able to successfully add these fields using EEWB and the fields are displayed in the corresponding PC-UI in the portal.
    I have an additional requirement of performing a  calculation based on these new added fields and updating or refreshing the "Expected Sales Vol" field in the Forecast tab on "Opportunity" Business Transaction
    Can anyone provide some inputs on how we can add the processing logic for acheiving? Is this possible via the BADI? Or Do we require to modify the BSP?
    Thanks

    Thanks for providing the solution. I have awarded you the points as it helped me to solve my problem. thanks once again.
    I have implemented the BADI and the corresponding PCUI displays the calculated amount when i enter values in the custom fields and hit ENTER.
    I just wanted to understand why we require to use function module CRM_ORDER_MAINTAIN_SINGLE_OW?. In my BADI implementation i did not have to use it so additional details would be useful for me to determine if i am missing anything.
    implemented BADI code:
    method IF_EX_CRM_OPPORT_H_BADI~CRM_OPPORT_H_MERGE .
    Constant Declarations
      CONSTANTS :
        c_BOX      TYPE CRMC_OPPT_TYPE-TYPE             VALUE '0001'.
    Processing Logic
      IF IS_OPPORT_H_WRK-TYPE EQ c_BOX.
    Perform the calculations for the Expected Sales Volume field
        CS_OPPORT_H_BADI-EXP_REVENUE = IS_OPPORT_H_WRK-ZZNOOFUNITS *
                                       IS_OPPORT_H_WRK-ZZPRICE .
      ENDIF.
    endmethod.

  • Help on report writer for Trial balance report

    Hi
    client is using report writer report for TB report say report ZTB.Now problem is when new financial year started on 1/4/2007 it is not carrying opening balances from previous financial year.
    Existing report writer report is linked to Macros developed for complete financial reporting.So existing format can't be changed i.e addition of new columns etc.
    Is there any place staright away I can make a change so that previous year balances can be added as of 1/4/2007?
    I am new to report writer.
    Can some one please help me how resolve this!!
    If any one has documentation with step by step report writer please send me to [email protected]
    regards

    Hi
    look here
    http://help.sap.com/saphelp_erp2005/helpdata/en/5b/d22db643c611d182b30000e829fbfe/frameset.htm
    assign points as a way of thanking
    Regards,
    Zaid

Maybe you are looking for

  • Security issues, System hangs and screen sharing listed in my logs

    Should i be worry about this, i can not even force quit any applications when my system hangs, basically every app is un responsive, and i can only just force restart my MBP *5/22/09 7:31:02 PM com.apple.launchd[1] (com.apple.ScreenSharing.server[414

  • Who should do  rgb-CMYK conversion - designers or printers?

    I have been having a very interesting discussion on a previous thread in response to problems with the colour conversion from rgb to CMYK using InDesign and the resulting unsatisfactory colours in the final magazine delivered by my printers. This has

  • I am trying to download the new adobe update for Mac OSX 10.9.5,without success.

    I will begin the download and it gets hung up on 25% and eventually the installer will just close itself.  I have checked all of the recommendations, i.e. the browser preferences and deleting the filing and starting over.  Help?

  • Need help with CFSTOREDPROC

    I am having problems with using a cfstoredproc. I am trying to pass a character chain (cf_sql_varchar) but it gives me an error message. It doesn't like that I am passing a varchar. When I pass a numeric value, it works. I used to have the same code

  • How to get a movie from itunes to my ipod touch?

    i recently downloaded a digital HD copy of Frozen. It made it into my itunes library but I can't get it to load on my ipod touch. I've tried transferring purchases and syncing to no avail.