How to calculate balance field

hi,
i am using FORM6i and i have made a form which is purely on LEDGER(ACCOUNTS).In this form i have 5 field (date,particular,credit,debit,balance).In the last field "Balance" the user want's the balance which will calculate the amount after transaction must be displayed which i don't know what trriger or coding i can use to get the balance amount.
please help me as soon as possible
Thanks & Regards

Faizan,
IF :LEDGER_ACCOUNTS.BALANCE = NVL(:LEDGER_ACCOUNTS.BALANCE, 0) + NVL(:LEDGER_ACCOUNTS.DEBIT, 0)-NVL(:LEDGER_ACCOUNTS.CREDIT, 0)
THENHow can this condition satisfy if there is any amount in CREDIT or DEBIT field?
Check my post, i wrote,
Initialize a global variable in the PRE-QUERY, and then write the code in the POST-QUERY of the block.
     :GLOBAL.QTYSUM := NVL(:GLOBAL.QTYSUM, 0) + NVL(:LEDGER_ACCOUNTS.DEBIT, 0) - NVL(:LEDGER_ACCOUNTS.CREDIT, 0);
     :LEDGER_ACCOUNTS.BALANCE := NVL(:GLOBAL.QTYSUM, 0);There is no condition in that.
Regards,
Manu.
If this answer is helpful or correct, please mark it. Thanks.
Edited by: Manu. on Aug 25, 2009 10:41 AM

Similar Messages

  • How to calculate KBETR field in SD pricing

    Hi Experts,
    I have one Alterante calculation routine to calculate KWERT field in SD pricing
    FORM FRM_KONDI_WERT_700.
    *{ INSERT LEDK900048 1
    if xworkd ne 0.
    xkwert = xworkd - komp-wavwr .
    endif.
    *} INSERT
    ENDFORM.
    My problem is, that after this calculation, I need to change KBETR field in the same condition as percetage: calculated value / net price.
    But KBETR field cannot be changed in the routine above. Is there any other choice how to do it?
    Thanks&regards,
    Jirka Faltin

    its a  perfect code.
    refer this
    IT_KONV-kbetr = abs( IT_KONV-kbetr ).
          if IT_KONV-kbetr > 0.
            IT_KONV-kbetr = ( IT_KONV-kbetr / 10 ).
          ENDIF.
          IT_REPORT-LV_SHARE2 = IT_KONV-KBETR .
    u will get kbetr in percentage.

  • How to calculate Opening balance for a customer?

    Hi Experts,
    How to calculate Opening balance for a customer? I am trying to develop a report where in i have to get opening AR balance,current sales,adjustments etc of a customer. Please let me know how can i do this. I have some tables with me KNC1, BSAD, BSID.
    Thanks in Advance.
    Sharat Chandra.

    Say for example ..
    Get the opening bal for Customer 'K' in CCode 'C1' in 2008 ..
    First get all items from BSEG ..
    Select * from BSEG where KUNNR eq 'K'
                                     and BUKRS eq 'C1'
                                     and GJAHR eq '2008' .
    Sum all the DMBTR values (This is the total value).
    Second get the cleared items form BSAD for the above entries;
    Select * from BSAD for all entries in BSEG where KUNNR and BUKRS and XBLNR eq BSEG-XBLNR.
    Sum all DMBTR values ( this is cleared value).
    Third substract the cleared value from total to get Open value.
    This is a overview .. you should go to the tables and look for fields and etc.. and then define the logic meeeting your requirements .... this is a genric undersatnding ....
    Thanks,
    Aditya. V

  • How to Calculate Opening balance

    Hi BW Gurus,
    How to calculate Opening balance for previous period using variables in Reports using debit and credit.
    Example:
    Opening balance is the balance for an account for the previous period. In other words, if the user is running a report for Period 1, 2006, the opening balance is actually the ending balance from Period 12, 2005 (December 31st, 2005).
    Thanks in advance
    DJ

    Hi Friend,
    If Your Prob is solve then tell me how to find perticular month balance amount.
    i m create cash book report for perticuler GL Account , i use BKPF + BSEG for this
    i found all entries,
    But at last i want to Opening Balance for perticuler date.
    like     01/05/2007 opening balance = 10000 as per tcode FS10N
    and in 26/05/2007 ??????
    how to find exact date opening balance is there any function for same
    or any procedure..
    Thanks
    From
    Gaurav

  • HOW TO CALCULATE OPENNING BALANCE

    HI Experts..
    How to calculate Opening balance for previous period using variables in Reports using debit and credit.
    Example:
    Opening balance is the balance for an account for the previous period. In other words, if the user is running a report for Period 1, 2006, the opening balance is actually the ending balance from Period 12, 2005 (December 31st, 2005).
    I am Using 0FIAR_O03 ODS ..
    Very Urgent Issue..
    If Possible Stp by Step..
    Cheers
    Purushottam
    09891683828
    [email protected]

    Hi Saloni,
    to get the debit and credit you would be using a variable 0I_FPER(Fiscal year / period), which is a user entry interval variable.
    now to get the opening balance you will have to create a customer exit valiable and the low value of 0I_FPER will have to popuplated by writied the code for the customer exit valiable. you will have to restrict the key figure DEB_CRE_LC for this customer exit variable with the operand as less than(< Fiscal Year /Period from 0I_FPER)).
    If the above was useful please assign reward points.
    Regards
    Venkata Devaraj

  • How to calculate Average balance for an account

    Hi,
    How to calculate average balance for an account for a particular period say for JAN-12 period and after the end of that period for another two days 01-feb-12 and 01-feb-12 ?
    I'm using the following query :
    SELECT cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6 "Account_XX",
    nvl(sum(l.accounted_dr - l.accounted_cr),0) "Balance"
    FROM gl_code_combinations cc,
    gl_je_lines l
    WHERE cc.code_combination_id = l.code_combination_id
    AND l.set_of_books_id ='XX'
    and code_combination_id = replace it with code combination_id for account_xx
    AND l.effective_date <= '31-Jan-12' (january period end ??)
    GROUP BY cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6
    There are some discrepancies in "average balance" after end of month (Jan-12)?
    How to calculate average balances for a particular account (Account_XX above)from end of month of Jan to first two days of february?
    Thanks,
    Kiran

    Kiran,
    Please let me know first, is Average Balancing feature enabled in your GL Ledger?
    Regards
    Muhammad Ayaz

  • How to calculate Opening Balance / How to Enhance 0FI_AR_6 DS

    Hi FI Experts,
    I need Opening Balance in my BI report,
    I am using 0FI_AR_6 DS , I have loaded data to CUBE, loaded Successfully.
    In this Data Source I need G/L Account Number and Terms of Payment (Payment Terms)
    I wrote the User Exit for this , then I check in RSA3, data is populating for those two fields.
    When I Try to load the data in to BI, it is not loading , it is showing Request is still Running  , records it is showing zero ‘0’.
    If I remove the user exit , data is loading fine.
    My requirement is to calculate Opening Balance,
    First I used 0FI_AR_4 DS , but I am not getting Accumulated Balance here, then I use the DS 0FI_AR_6 it have Accumulated Balance field but in this DS I don’t have G/L Account Number and Terms of Payment (Payment Terms)
    Its very urgent , we are in UAT stage…
    Need some inputs to resolve this..
    Thanks & Regards,
    SHAIK
    Edited by: shaik on Jan 16, 2008 10:55 AM

    Hey Shaik,
    Why you are using AR extractors to get the G/L account opening balance ? As i understand the AR accounts post to a limited G/L account (known as the recon accounts) and it will not extract all the G/L accounts in the first place. So even if you manage to get the opening balance, AR extractors will not give you all the G/L accounts opening balance. If you need to get the opening balance for the G/L accounts then you need to look at G/L extractors.
    For the AR extractors what is your extraction period range ? Have you included period '000' for your extraction ?
    Hope it helps.
    Thanks,
    Soumya

  • How to Calculate AGE by getting difference between two Date Fields

    HI Gems
    I need to calculate AGE from getting difference from two date fields. But when i am trying to wrte fromula as Current date - date1(some date field) then it is showing error.
    How can i get values.
    Thanks
    Manu

    You already asked this question:
    How to calculate AGE from two different date fields

  • How to calculate sum of the fields in adobeforms

    Hello Experts
    can  i know how to calculate sum of fields in the adobe form.  I have few fields to be summed in total field.
    Regards

    Hello Surendra,
         Suppose you are having 4 fields and the 4th field is the TOTAL field.
         Write the below Javascript on the Initialize event of TOTAL field as shown below.
    Remember that if you use just "+" sign without Number() or ParseInt() function it acts like String Concatenation.
    this.rawvalue = Number( this.parent.field1.rawvalue ) +
                          Number( this.parent.field2.rawvalue ) +
                          Number( this.parent.field3.rawvalue ) ;
    You can also write is as shown below.
    this.rawvalue = parseInt( this.parent.field1.rawvalue ) +
                             parseInt( this.parent.field2.rawvalue ) +
                             parseInt( this.parent.field3.rawvalue ) ;

  • How to calculate total for field for particular day. in smart forms

    hi,
             pls help in this problem,
    how to calculate cumulative totals for the particular field in samrtforms

    Hi ,
    Either you can calculate the sum in driver program with
    Loop at where Condition .
    Sum the required field .
    endloop .
    Then pass it to smartforms
    Or
    Double Click on table node .
    In the conditions tab give the required condition .
    select calculation tab.
    In operation select Total , in field name give the name of the field you want to sum
    and in targer field name specify the name of the field that should contain the result .
    To convert the total in to words use the function module in program lines
    CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
    EXPORTING
    amt_in_num = w_total
    IMPORTING
    AMT_IN_WORDS = w_total_words
    EXCEPTIONS
    DATA_TYPE_MISMATCH = 1
    OTHERS = 2
    Regards

  • How to calculate commodity code  using Tabe MARC and field STAWN.

    Hi All,
    how to calculate commodity code
    This attribute is stored at the Material/Plant level.  For each material, this attribute must be evaluated at all applicable plants. 
    u2022     If ALL values are the same, output the value to the report
    u2022     If all values are NOT the same, output u201CNot Consistentu201D in the column for the material
    The table to be used is MARC
    and the SAP technical field name is STAWN

    Hi Debrup,
    try this ... i have put down code here ... test it and make changes as needed.
    data:
    t_marc type standard table of marc with header line,
    lv_matnr like marc-matnr,
    lv_same type c.
    select MATNR WERKS STAWN
    from MARC
    into corresponding fields of table t_marc.
    sort t_marc by matnr werks stawn.
    loop at t_marc.
    at new matnr.
    clear lv_same.
    lv_matnr = t_marc-matnr.
    endat.
    at new stwan.
    * material is same but STWAN changed so flag change
    if lv_matnr = t_marc-matnr.
    lv_same = 'F'. " False.
    endif.
    endat.
    at end of matnr.
    if lv_same is intial.
    write : t_marc-matnr,t_marc-stwan.
    else.
    write : t_marc-matnr, 'Not Consistent'.
    endif.
    endat.
    endloop.
    hope this helps.
    Franc

  • How to calculate the previous year YTD balance in profit & loss statement

    Dear all,
    I would like to seek for advice on how to calculate the previous year YTD (Year to date) balance in profit & loss statement
    For example, if I enter May 2009, the YTD value should be a sum up of value from Jan to May.
    I have tried the current year YTD could be set in column selection dimension "financial period"
    FACT PER( Code = YearFirst(@Per):@Per )  Order By PER.Code Descending
    Then, I tried the previous year YTD in another column using
    FACT PER( Code = YearFirst(@Per-12):@Per-12 )  Order By PER.Code Descending
    But it failed -> Abnormally display three column, while the financial period I enter 200903 in parameter @Per
    Would anyone kindly help me on that?
    Regards,
    Simon Chiu

    Dear Jim,
    Thanks for your reply.
    However, the problems still cannot be solved.
    My expected output is 1 column listing the YTD value from previous year.
    I have tried two times using both the Code = YTD(@Per-12) and Code = YearFirst(@Per)-12:@Per respectively. However, the Excel display various column.
    I am using Financial Period 200903. In the last three column, it display the data in Financial Period 200901, 200902 and 200903 respectively.
    For the current year, the YTD is correct and show 1 column listing the sum of account in the Financial Period 200901, 200902 and 200903
    Would you kindly advice the code setting and how to set? Also, how I can access the syntax builder?
    Regards,
    Simon Chiu

  • How to calculate Beginning , Current & To date opening Balances

    Hi to all
    Anybody know that How to calculate Beginning , Current & To date opening Balances in Oracle Payable
    Thanks
    Zulqarnain

    sorry igonore above one
    i don't want last day of the month
    i want last working day of the current month
    please solve this
    urgent

  • SSRS - How to calculate porcent on the same fields

    Hi,
    I have a problem with my Report 
    I have a table like this:
    Description | Mounth
    [Description] | Sum(Valeur
    Pourcent | WHAT I NEED
    When i execute this on my web portal, i have this result:
    Description | January | February | March ...
    Desc 1        | 400       |   500       |   700 ...
    Desc 2        | 325      |   452        | 658
    Porcent       |              |                |
    I don't now how to calculate %. 
    For January i want to do 474/413, for february 1534/1457.
    But i dont know what i need to do in my tablix, in the cell "[WHAT I NEED]" to do this...
    Can you help me.
    SOrry for my bad english.
    Thanks for your help.
    Flo

    Hi sbenett,
    According to your description, you have  two rows in your matrix. Now you want the value in the second row divide the value in the first row. Right?
    In this scenario, since you only have tow rows in your matrix, we just need use the last value divide the previous values in the column group. So we can insert a row outside of group (row group), try the following expression in the cell: =last(Fields!column.Value)/first(Fields!column.Value)
    We have test this scenario in our local environment. Here are screenshots for your reference:
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How to Add parameter fields in BI publisher fields

    Hi,
    I'm creating xml report for Apps standard Trial Balance Summary, here i cant able to run the .rdf locally due to SRW.UserExit .
    So i got the XML file from output of the report.
    Then i added the xml data in BI publisher and then i have created the .rtf for that.
    Here i need to add some fields which is not available in fields list (in BI Publisher).
    How to add that fields, or is possible to add fields manually.
    That fields are given as parameters while running the .rdf file.
    Please tell me how to solve this problem.
    Is possible to add fields manually means tell me how to do that.

    If those fields are input parameters to the concurrent program then you can display them in RTF by declaring and printing it as
    <?param@begin:P_CONC_PARAM?>
    and display it as <?$P_CONC_PARAM?> - Note P_CONC_PARAM should match your parameter token

Maybe you are looking for