Open Balance of Invoice

Dear All,
I need to list down the Invoices which are open and as well as their open amount but the condition is that it should be based on  a date condition. Example would be
Suppose there is a Invoice which was created in the month of June with an amount $1000.00. A payment against the same invoice was created in the month of July. So if I run the report let say 1st of July to 31st of July, the invoice should appear with the payment transaction. But if i run the report with a date selection 1st of August till 31st of August, the invoice and the payment should not be listed in the report.
Please can anyone tell me how should i achieve this?
Regards,
Gary

Thanks Gordon
I am facing problem in showing the open balance against the Invoice. The report should show the Invoice with the original amount i.e the doctotal and also the balance. In the balance due field for the invoice is 0 no matter what day i run the report. I am trying to achieve the history of open balances of the invoices.
Regards,
Gary

Similar Messages

  • Import GL opening balance,AR and AP aging with each open invoice data

    We tried to use Data Transfer Workbench to import GL opening balance back to 2007 year end but got an error "can not post to Control Account". 
    In Admin>Sys Init> Opening Balances> GL opening, Businesss Partner, 1099 opening balance can import all opening balance with AR, AP. But, can not import for each open invoice amount, invoice number, invoice date information. 
    If we entered those GL, AR, AP opening balance those won't affect the GL F/S, right?
    We will need to close year 2007 then import each period Trial Balance Debit and Credit amount for each account then close each period to have all 2008 each account period data until May 2009. 
    Would like to know which is the best way to do this?
    Edited by: Lily Chien on Jun 4, 2009 11:21 PM

    Hi,
    Please, use oInvoice and oPurchaseInvoice templates (as service type and offset account is opening balance account) to import opening balance. This don't affect to inventory, P/L account.
    Hope this helps,
    Son.

  • How can i import Customer/Vendor  Opening Balances - Invoice wise

    I am going on a parallel run from next week onwards and the Client want to import all Customer/Vendor Opening Balances invoice wise , so that they can get the Aging Analysis report the no of days Outstanding as well as they can enter payment invoice wise.

    Sanjay,
    To import BP Opening Invoices or Credit Memo's,
    Use the template inside DTW folder
    \Templates\oInvoices for AR Invoices
    \Templates\oPurchaseInvoices for AP Invoices
    and so on
    I presume you would want to import them as Service Invoice so
    In the Document template
    Set
    DocNum....................................DocType......................HandWritten
    original Invoice number...............dDocument_Service..............tYes
    Document_lines
    AccountCode
    Opening Balance Account Code (Opening Balance Account is generally created in the Equity drawer and is used purely for all Opening trasactions and will balance out to zero (0) once all opening data from legacy system has been brought over)
    Let me know if you need further direction
    Suda

  • A/R invoice was closed even there are open balance

    Hi,
    I had a situation here.
    An invoice with amount due of US 1,000.
    Create an incoming payment  > payment mean > cash paid US 600,
    The incoming payment indicate an open balance of US -400.
    However, when I check back the invoice, the status is closed and the applied amount is US 1,000, the balance due is 0.
    Isn't the balance due should be 400?
    I cannot find the invoice in the incoming payments anymore
    Thanks

    Hi,
    For example, you want to receive partial payment  from customer and AR invoice amount is 200.
    1. Open incoming payment window
    2. select customer code
    3. List of AR invoice will appear.
    4. Select that invoice to be paid partially and change amount in "Total payment" column. For example 200 to 100.
    5. Choose payment means and add amount 100.
    6. After adding payment, check AR invoice status, sure it will show open status with applied amount and balance amount.
    If do not change total payment column, balance amount will posted to payment of account and AR invoice will be closed.
    Thanks & Regards,
    Nagarajan

  • Opening balance against multiple invoices

    Hello Experts
                       How can we enter opening balances of business partners invoice wise ?there may be lackhs outtsanding against each partner.How can we map payment against a particular invoice included in opening balance ?
    regards
    Manoj

    Hi Manoj,
    I Hope this Thread will help you
    [Opening Balance;
    Thanks
    Balaji

  • To display the opening balances of the customer in detail and A/R invoice open status document

    hi every one
    i want a report
    for the below code i am getting only the documents that are posted from 01/04/2014. But for some customers and vendors i have entered opening balances using J/E so in this report i want to display the detailed split of the BP Account Balance which i have entered in J/E
    SELECT
    T0.[CardName][Customer Name],
    T0.[DocNum][Document Number],
    T0.[DocStatus][Status],
    T0.[DocDate][PostingDate],
    T0.[DocDueDate][DueDate],
    T0.[DocTotal][Total],
    t1.SlpName,
    DATEDIFF(DAY, T0.DocDueDate, GETDATE( )) AS 'Days Over Due'
    FROM dbo.OINV T0 INNER JOIN OSLP T1 ON T0.[SlpCode] = T1.[SlpCode]
    WHERE DocStatus = 'o'

    I'm not sure if this will work but you can have a try good luck
    select TOP 100 convert(nvarchar(10),j.refdate,101) [Posting Date] ,(case j.transtype  when 24 then 'RC'  when 13 then 'IN'  when 14 then 'CN'  when 30 then 'JE'  when 321 then 'JR' else j.transtype end) Origin ,convert(nvarchar(max),j.baseref) [Origin No.] ,j.contraAct [Offset Account] ,convert(nvarchar(max),j.LineMemo) [Details] ,OJ.loctotal [C/D(LC)] ,(j.BalDueDeb - j.BalDueCred) [Balance Due(LC)]
    ,'' [C/D(FC)]
    ,'' [Balance Due(FC)]
    ,j.Debit [Debit(LC)]
    ,j.Credit [Credit(LC)]
    FROM jdt1 j
    left join ORCT R on j.baseref = R.docnum
    left join OINV I on j.baseref = I.docnum
    left join ORIN C on j.baseref = C.docnum
    left join OJDT OJ on j.transid = OJ.transid
    where  j.shortname in (Select CardCode FROM OCRD) and i.DocStatus = 'O'
    order by j.transid DESC
    Note: you can removed the TOP 100 to show all the transactions.
    to show only the invoice transaction you may want to add the filtering for J.TransType = 13
    Regards,
    Jim

  • FBL5N Review Open and Cleared Invoices per Customer

    WHen one of our users goes into FBL5N to review open and cleared invoices he adds the WBS and the Profit Center. When the report runs it is blank. I looked at the invoice itself and the WBS and Profit center is on the invoice but I don't know why it doesn't show up on the report. Can anyone tell me why this happens? Do I need to make any kind of adjustment before running the report?
    Thanks

    I looked at the VF03 and there is a WBS and Profit Center on the Invoice. If this report shows Open and Cleared invoices then it should bring what is on the invoice in the report but doesn't.
    I had someone email me this response"
    Hi linda,
    For your info, The reason why profit center and WBS element blank in report FBL5N is, this report purposely used to display subledger account.When me made a posting, balance sheet account is not require
    cost object.Only PNL account require cost object.
    Regards,
    Abdul
    I would like to know what other report in SAP shows open and cleared invoices with the Profit Center and WBS?

  • Importing Opening Balances from Legacy System

    Hi All,
    I am trying to import opeing balances for Items, Vendors and Customers and GL a/c from legacy system to SAP B1.
    Can anay one of you suggest the process involved at SAP B1 end for importing the balances?
    I know DTW can be used, but can anyone explain the process for SAP B1?
    I would appriciate your time spent on answering this.

    G/L A/c Balances have to brought in as the last step.  You can use the Journal Entry to enter the opening balances or Administration > System Initialization > Opening Balance
    BP Balances can be imported using DTW templates for Invoices, Credit Memo's etc.  There are examples in the DTW folder.
    Inventory Balances can be imported using the Stock taking template and the Cost of the Items can be imported as a price list and the Inventory > Inventory Transactions > Initial Quantities, Inventory Tracking and Stock Posting.
    Using the stock posting tab you can reconcile the inventory based on the pricelist to which you had imported the Inventory costs.
    If you need more details pls let me know
    Suda

  • Customer Open Balance

    Can we get Customer open balance based on inventory organization
    I need to customize Report customer open Balance Report to drill down
    open balaces based on inventory organization instead of operating UNit
    Thanks
    Sankuratri

    When you post the partial payment, the system marks the document number of the original open item in the line item for the partial payment. The original open item and the partial payment remain open.
    The system stores the document number, fiscal year and number of the invoice item in the partial payment. <b>You can find this information in the 'Payment for' field.</b> Thus you can refer to the original open item from the partial payment. When you post the remaining amount for the invoice, both the partial payment and the invoice are cleared.
    This is per documentation for <a href="http://help.sap.com/erp2005_ehp_02/helpdata/en/01/a9bb94455711d182b40000e829fbfe/content.htm">partial payments</a> , you may want to test it out. Hope a similar feature is available for credit memos.

  • Opening  Balance by open AR and open AP

    HI Expert ,
    Can you provide me step by Step for this type of transfer .
    What I did :
    1. Create a service invoice for all AR
    - Account receivables Dr -   3000
                        Opening Balnce   Cr                 3000
    2. Create  service invoice for all AP
        Account payables Cr  --1500
                       Opening balance    Dr               1500
    3.All Open SO and PO is entered already
    4. Inventory  balance is transferred
    Now what is my next step : I am trying to explain these procedures to ..can you give me detail step by step in Journal entry
    I really want to give me step by step instruction
    Thank you
    Bishal

    Hi Gordon ,
    As you know this is process of go live . I have done all the step as mentioned .
    I am stuck after this process , what needs to be done as well as to make sure everythign is correct with legacy system and opening balance account becomes zero afterwards ......
    Hope you got the point
    Thank you
    Bishal

  • Customer open balance analysis question

    Question: How do you easily track open balance of an invoice without using residuals?
    Scenario:
    Create invoice using transaction FB70
    Apply a partial payment to the invoice or apply a credit memo to reduce the invoice balance. We do not want to use residual items as this closes the original item and reopens an item with a new reference number.
    How can we easily and quickly tell the remaining open balance on the Invoice?
    Example:
    Invoice 1800000000 is created for $150
    Credit Memo 1600000000 is created for $50 and applied to above invoice as a partial clearing.
    When the Customer Line Items are displayed, the Original Invoice, 1800000000, still shows the full amount of $150 and a partial payment of document of <$50> also shows but with no link to the original invoice. Short of using the Text Fields, is there any way to display the remaining open balance of an invoice?
    Calculating the open balance is easy when the customer only has a few open items; however, this is a nightmare when the customer has more than a screen full of open records.
    Any suggestions would be greatly appreciated.
    Greg Brown

    When you post the partial payment, the system marks the document number of the original open item in the line item for the partial payment. The original open item and the partial payment remain open.
    The system stores the document number, fiscal year and number of the invoice item in the partial payment. <b>You can find this information in the 'Payment for' field.</b> Thus you can refer to the original open item from the partial payment. When you post the remaining amount for the invoice, both the partial payment and the invoice are cleared.
    This is per documentation for <a href="http://help.sap.com/erp2005_ehp_02/helpdata/en/01/a9bb94455711d182b40000e829fbfe/content.htm">partial payments</a> , you may want to test it out. Hope a similar feature is available for credit memos.

  • OPENING BALANCE IN ANNEXURE10

    Hi Experts,
    In my RG23A AND RG23C ANNEXURE10 report opening balance is not coming. Herewith i am sending the code of the report. Kindly do the needful.
    Regards,
    Shankar
    CODING:
    REPORT YMS_ANNEXURE10NEW NO STANDARD PAGE HEADING LINE-SIZE 255
                                                           LINE-COUNT 60.
    *REPORT  ZKVB_CENVAT_CREDIT_LEDGER_NEW
    DICTIONARY STRUCTURES USED                                           *
    TABLES: J_1IPART2 , J_1IEXCHDR , J_1IEXCDTL , GLT0 .
    INTERNAL TABLES USED                                                 *
    DATA : BEGIN OF ITAB_EXCISE OCCURS 0    ,
            SERIALNO LIKE J_1IPART2-SERIALNO ,     "SERIAL NUMBER
            BUDAT LIKE J_1IPART2-BUDAT ,           "DATE
            TRNTYP LIKE J_1IPART2-TRNTYP ,         "TRANSACTION TYPE
            EXNUM LIKE J_1IEXCHDR-EXNUM ,          "EXCISE INVOICE NUMBER
            EXDAT LIKE J_1IEXCHDR-EXDAT ,          "EXCISE INVOICE DATE
            EXBED LIKE J_1IEXCHDR-EXBED ,          "CENVAT
            EXSED LIKE J_1IEXCHDR-EXSED ,          "SED
            CVDIND LIKE J_1IEXCHDR-CVDIND ,
            RDOC3 LIKE J_1IEXCDTL-RDOC3 ,
            ECS LIKE J_1IPART2-ECS,
            ECS1 LIKE J_1IPART2-ECS,
            OCT_ECS LIKE J_1IPART2-ECS,
           END OF ITAB_EXCISE.
    DATA : BEGIN OF ITAB_EXCISE1 OCCURS 0 ,
            SERIALNO LIKE J_1IPART2-SERIALNO ,     "SERIAL NUMBER
            SERIALNO_C LIKE J_1IPART2-SERIALNO ,
            BUDAT LIKE J_1IPART2-BUDAT ,           "DATE
            TRNTYP LIKE J_1IPART2-TRNTYP ,         "TRANSACTION TYPE
            EXNUM LIKE J_1IEXCHDR-EXNUM ,          "EXCISE INVOICE NUMBER
            EXDAT LIKE J_1IEXCHDR-EXDAT ,          "EXCISE INVOICE DATE
            EXBED LIKE J_1IEXCHDR-EXBED ,          "CENVAT
            EXSED LIKE J_1IEXCHDR-EXSED ,          "SED
            CVDIND LIKE J_1IEXCHDR-CVDIND ,
            RDOC3 LIKE J_1IEXCDTL-RDOC3 ,
            SERIALNO1 LIKE J_1IPART2-SERIALNO ,
            EXBED1 LIKE J_1IPART2-EXBED,
            EXSED1 LIKE J_1IPART2-EXSED,
            ECS LIKE J_1IPART2-ECS,
            ECS1 LIKE J_1IPART2-ECS,
            OCT_ECS LIKE J_1IPART2-ECS,
           END OF ITAB_EXCISE1.
    *DATA : ITAB1 LIKE ZEXCISE_SED_BED OCCURS 0 WITH HEADER LINE .
    DATA : ITAB_EXCISE2 LIKE ITAB_EXCISE1 OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF ITAB_DISPLAY OCCURS 0,
              SERIALNO LIKE J_1IPART2-SERIALNO ,     "SERAIL NUMBER
              BUDAT LIKE J_1IPART2-BUDAT ,           "DATE
              CENVAT_OPG type p decimals 3,          "OPENING CENVAT
              SED_OPG LIKE J_1IPART2-EXSED ,         "OPENING SED
              ECS LIKE J_1IPART2-ECS ,               "OPENING ECS
              EXNUM_CR LIKE J_1IEXCHDR-EXNUM ,       "CERDIT EXC INV NUMBER
              EXDAT_CR LIKE J_1IEXCHDR-EXDAT ,       "CREDIT EXC INV DATE
              CENVAT_CR type p decimals 3,            "CREDIT CENVAT
              ADDL_DTY type p decimals 2,
              SED_CR LIKE J_1IEXCHDR-EXSED ,         "CREDIT SED
              TOT_CENVAT_CR type p decimals 3,
              TOT_CENVAT_CESS type p decimals 3,
              TOT_SED_CR LIKE J_1IEXCHDR-EXSED ,
              EXNUM_DB LIKE J_1IEXCHDR-EXNUM ,
              EXDAT_DB LIKE J_1IEXCHDR-EXDAT ,
              CENVAT_DB type p decimals 3,
              SED_DB LIKE J_1IEXCHDR-EXSED ,
              CENVAT_CLS type p decimals 3,
              SED_CLS LIKE J_1IPART2-EXSED ,
              total_ecs like J_1IPART2-ECS,
              ECS1 LIKE J_1IPART2-ECS,
              CNT TYPE P,
              OCT_ECS LIKE J_1IPART2-ECS,
            END OF ITAB_DISPLAY.
    DATA : BEGIN OF ITAB_EXNUM OCCURS 0 ,
            EXNUM LIKE J_1IEXCHDR-EXNUM ,
            EXDAT LIKE J_1IEXCHDR-EXDAT ,
            CENVAT like J_1IEXCHDR-exbed,
            ADDL_DTY like J_1IEXCHDR-exbed,
            SED LIKE J_1IEXCHDR-EXSED ,
            CNT TYPE P,
           END OF ITAB_EXNUM.
    DATA : BEGIN OF ITAB_EXNUM1 OCCURS 0 ,
              EXNUM LIKE J_1IEXCHDR-EXNUM ,
              EXDAT LIKE J_1IEXCHDR-EXDAT ,
              CENVAT LIKE J_1IEXCHDR-EXBED ,
              SED LIKE J_1IEXCHDR-EXSED ,
              CNT TYPE P,
           END OF ITAB_EXNUM1.
    DATA: BEGIN OF ITAB_GLT0 OCCURS   0,
            RACCT LIKE GLT0-RACCT,
            TSLVT LIKE GLT0-TSLVT,
            TSL01 LIKE GLT0-TSL01,
            TSL02 LIKE GLT0-TSL02,
            TSL03 LIKE GLT0-TSL03,
            TSL04 LIKE GLT0-TSL04,
            TSL05 LIKE GLT0-TSL05,
            TSL06 LIKE GLT0-TSL06,
            TSL07 LIKE GLT0-TSL07,
            TSL08 LIKE GLT0-TSL08,
            TSL09 LIKE GLT0-TSL09,
            TSL10 LIKE GLT0-TSL10,
            TSL11 LIKE GLT0-TSL11,
            TSL12 LIKE GLT0-TSL12,
          END OF ITAB_GLT0.
    DATA : BEGIN OF OPEN_BAL_OCT OCCURS 0,
               ECS LIKE J_1IPART2-ECS,
           END OF OPEN_BAL_OCT.
    DATA : BEGIN OF ITAB_CESSCO OCCURS 0,
               ECS LIKE J_1IPART2-ECS,
               TRNTYP LIKE J_1IPART2-TRNTYP ,
           END OF ITAB_CESSCO.
    DATA : MM(2) TYPE C ,
          GR_TOTAL_CESS_SEPT LIKE J_1IPART2-ECS,
           GR_TOTAL_CESS_OCT LIKE J_1IPART2-ECS,
           GR_TOTAL_CESS_NOV LIKE J_1IPART2-ECS,
           GR_TOTAL_CESS_DEC LIKE J_1IPART2-ECS,
           GR_TOTAL_CESS_JAN LIKE J_1IPART2-ECS,
           GR_TOTAL_CESS_FEB LIKE J_1IPART2-ECS,
           GR_TOTAL_CESS_MAR LIKE J_1IPART2-ECS,
           GR_TOTAL_CESS_APR LIKE J_1IPART2-ECS,
           GR_TOTAL_CESS_MAY LIKE J_1IPART2-ECS, " FOR JUNE OPENING BALANCE
           GR_TOTAL_CESS_JUN LIKE J_1IPART2-ECS, " FOR JULY OPENING BALANCE
           GR_TOTAL_CESS_JUL LIKE J_1IPART2-ECS, " FOR AUGUST OPENINGBALANCE
           GR_TOTAL_CESS_AUG LIKE J_1IPART2-ECS, " FOR SEPT OPENING BALANCE
           GR_TOTAL_CESS_SEP LIKE J_1IPART2-ECS,
           GR_TOTAL_CESS_CO LIKE J_1IPART2-ECS,
           CREDIT_ECS LIKE J_1IPART2-ECS,
           DEBIT_ECS LIKE J_1IPART2-ECS ,
           CREDIT_ECS1 LIKE J_1IPART2-ECS,
           DEBIT_ECS1 LIKE J_1IPART2-ECS ,
           CREDIT_ECS2 LIKE J_1IPART2-ECS,
           DEBIT_ECS2 LIKE J_1IPART2-ECS ,
           CREDIT_ECS3 LIKE J_1IPART2-ECS,
           DEBIT_ECS3 LIKE J_1IPART2-ECS ,
           CREDIT_ECS4 LIKE J_1IPART2-ECS,
           DEBIT_ECS4 LIKE J_1IPART2-ECS ,
           CREDIT_ECS5 LIKE J_1IPART2-ECS,
           DEBIT_ECS5 LIKE J_1IPART2-ECS ,
           CREDIT_ECS6 LIKE J_1IPART2-ECS,
           DEBIT_ECS6 LIKE J_1IPART2-ECS,
           CREDIT_ECS7 LIKE J_1IPART2-ECS, " FOR JUNE OPENING BALANCE
           DEBIT_ECS7 LIKE J_1IPART2-ECS,
           CREDIT_ECS8 LIKE J_1IPART2-ECS, " FOR JULY OPENING BALANCE
           DEBIT_ECS8 LIKE J_1IPART2-ECS,
           CREDIT_ECS9 LIKE J_1IPART2-ECS, " FOR AUGUST OPENING BALANCE
           DEBIT_ECS9 LIKE J_1IPART2-ECS,
           CREDIT_ECS10 LIKE J_1IPART2-ECS, " FOR SEPT OPENING BALANCE
           DEBIT_ECS10 LIKE J_1IPART2-ECS,
           CREDIT_ECS11 LIKE J_1IPART2-ECS, " FOR OCT OPENING BALANCE
           DEBIT_ECS11 LIKE J_1IPART2-ECS,
           CREDIT_ECSCO LIKE J_1IPART2-ECS,
           DEBIT_ECSCO LIKE J_1IPART2-ECS.
    DATA : ITAB_GLT0_1 LIKE ITAB_GLT0 OCCURS 0 WITH HEADER LINE.
    SELECT OPTION INTERNAL TABLE DEFINATIONS                             *
    RANGES : R_TRNTYP FOR J_1IPART2-TRNTYP.
            R_BUDAT FOR J_1IPART2-BUDAT.
    DATA VARIABLES USED                                                  *
    DATA: V_LIN LIKE SY-TABIX .
    DATA : V_OPENING_BED LIKE ITAB_DISPLAY-CENVAT_OPG.
    DATA : V_OPENING_SED LIKE ITAB_DISPLAY-SED_OPG.
    DATA : OCT_ECS LIKE J_1IPART2-ECS.
    DATA : TOTAL_ECS LIKE J_1IPART2-ECS.
    DATA : TOTAL_ECS_1 LIKE J_1IPART2-ECS.
    DATA : GR_TOTAL_ECS LIKE J_1IPART2-ECS.
    DATA : INIT_ECS LIKE J_1IPART2-ECS.
    DATA : GR_TOTAL_CREDIT_CESS LIKE J_1IPART2-ECS.
    DATA : GR_TOTAL_DEBIT_CESS LIKE J_1IPART2-ECS.
    DATA : GR_CLOSE_BAL_CESS LIKE J_1IPART2-ECS.
    SELECTION SCREEN                                                     *
    SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME.
    PARAMETERs : P_WERKS LIKE J_1IEXCDTL-WERKS MEMORY ID WRK.
    SELECT-OPTIONS : S_BUDAT FOR J_1IPART2-BUDAT,
                     S_REGTYP FOR J_1IPART2-REGTYP.
    SELECTION-SCREEN END OF BLOCK BLK1  .
    *RANGES R_BUDAT FOR J_1IPART2-BUDAT.
    EVENT ----> TOP OF PAGE                                              *
    TOP-OF-PAGE.
      PERFORM F_003_TOPI_PEHNAO.
    EVENT ----> AT SELECTION SCREEN                                      *
    *t selection-screen.
    perform f_006_check_karo.
    EVENT ----> START OF SELECTION                                       *
    START-OF-SELECTION.
      PERFORM F_001_SERIAL_NOS_UTHAO.
      PERFORM F_002_DISPLAY_TABLE_BHARO.
      PERFORM F_005_CREDIT_SUBTOTAL.
    EVENT ----> END OF SELECTION                                         *
    END-OF-SELECTION.
      PERFORM F_004_DIKHAO.
    *&      Form  F_001_SERIAL_NOS_UTHAO
          text
    -->  p1        text
    <--  p2        text
    FORM F_001_SERIAL_NOS_UTHAO.
      PERFORM F_002_TRNTYP_CHUNO.
      DATA :  BEGIN OF OPEN_BAL_OCT OCCURS 0,
                  ECS LIKE J_1IPART2-ECS,
                  TOTAL_ECS LIKE J_1IPART2-ECS,
              END OF OPEN_BAL_OCT.
      DATA : LOWMM(2) TYPE N.
      DATA : LOWYR(4) TYPE N.
      DATA : LOWDT(2) TYPE N.
      DATA : L1 LIKE J_1IPART2-BUDAT.
      DATA : L2 LIKE J_1IPART2-BUDAT.
      LOWMM = S_BUDAT-LOW+4(2).
      IF LOWMM = '01'.
        LOWMM = '12'.
      ELSE.
        LOWMM = LOWMM - 1.
      ENDIF.
      IF LOWMM = '12'.
        LOWYR = S_BUDAT-LOW+0(4) - 1.
      ELSE.
        LOWYR = S_BUDAT-LOW+0(4).
      ENDIF.
      LOWDT = S_BUDAT-LOW+6(2).
      CONCATENATE LOWYR LOWMM LOWDT INTO L1.
      CALL FUNCTION 'LAST_DAY_OF_MONTHS'
        EXPORTING
          DAY_IN            = L1
        IMPORTING
          LAST_DAY_OF_MONTH = L2
        EXCEPTIONS
          DAY_IN_NO_DATE    = 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.
      RANGES CO_BUDAT FOR J_1IPART2-BUDAT.
      IF P_WERKS = '1000'.
        CO_BUDAT-LOW =  '20041001'.
      ELSEIF P_WERKS = '3000'.
        CO_BUDAT-LOW =  '20041201'.
      ELSEIF P_WERKS = '4000'.
        CO_BUDAT-LOW =  '20041201'.
      ELSEIF P_WERKS = '2000'.
        CO_BUDAT-LOW =  '20041201'.
      ELSEIF P_WERKS = '5000'.
        CO_BUDAT-LOW =  '20041201'.
      ENDIF.
      CO_BUDAT-HIGH =  L2.
      CO_BUDAT-SIGN = 'I'.
      CO_BUDAT-OPTION = 'BT'.
      APPEND CO_BUDAT.
      CLEAR CO_BUDAT.
      SELECT J_1IEXCDTL1RG23ASER J_1IEXCDTL1RG23CSER
                                  J_1IPART21BUDAT J_1IPART21TRNTYP
             J_1IEXCHDR1EXNUM J_1IEXCHDR1EXDAT J_1IEXCDTL1~EXBED
             J_1IEXCDTL1EXSED J_1IEXCHDR1CVDIND J_1IEXCDTL1~RDOC3
         J_1IPART21SERIALNO J_1IPART21EXBED J_1IPART21~EXSED
    J_1IPART21~ECS
                                        INTO TABLE ITAB_EXCISE1 FROM
           ( J_1IPART2 AS J_1IPART21 INNER JOIN J_1IEXCHDR AS J_1IEXCHDR1 ON
                J_1IPART21TRNTYP EQ J_1IEXCHDR1TRNTYP AND
                J_1IPART21DOCYR  EQ J_1IEXCHDR1DOCYR  AND
                J_1IPART21DOCNO  EQ J_1IEXCHDR1DOCNO )
             LEFT OUTER JOIN J_1IEXCDTL AS J_1IEXCDTL1 ON
                J_1IPART21TRNTYP EQ J_1IEXCDTL1TRNTYP AND
                J_1IPART21DOCYR  EQ J_1IEXCDTL1DOCYR  AND
                J_1IPART21DOCNO  EQ J_1IEXCDTL1DOCNO
          WHERE J_1IPART21~REGTYP IN S_REGTYP AND
                    J_1IPART21~BUDAT IN S_BUDAT AND
                    J_1IEXCHDR1~WERKS EQ P_WERKS AND
                    J_1IEXCHDR1~STATUS NE 'D'.
      IF P_WERKS = '1000'.
        SELECT  ECS TRNTYP  FROM J_1IPART2 INTO TABLE  ITAB_CESSCO  WHERE
                                        EXGRP EQ '01' AND
                                        REGTYP = 'A' AND
                                        BUDAT IN CO_BUDAT.
      ELSEIF P_WERKS = '2000'.
        SELECT  ECS TRNTYP  FROM J_1IPART2 INTO TABLE  ITAB_CESSCO  WHERE
                                        EXGRP EQ '81' AND
                                        REGTYP = 'A' AND
                                        BUDAT IN CO_BUDAT.
      ELSEIF P_WERKS = '3000'.
        SELECT  ECS TRNTYP  FROM J_1IPART2 INTO TABLE  ITAB_CESSCO  WHERE
                                        EXGRP EQ '31' AND
                                        REGTYP = 'A' AND
                                        BUDAT IN CO_BUDAT.
      ELSEIF P_WERKS = '4000'.
        SELECT  ECS TRNTYP  FROM J_1IPART2 INTO TABLE  ITAB_CESSCO  WHERE
                                        EXGRP EQ '41' AND
                                        REGTYP = 'A' AND
                                        BUDAT IN CO_BUDAT.
      ELSEIF P_WERKS = '5000'.
        SELECT  ECS TRNTYP  FROM J_1IPART2 INTO TABLE  ITAB_CESSCO  WHERE
                                        EXGRP EQ '55' AND
                                        REGTYP = 'A' AND
                                        BUDAT IN CO_BUDAT.
      ENDIF.
      LOOP AT ITAB_CESSCO.
        CASE ITAB_CESSCO-TRNTYP.
          WHEN 'GRPO' OR 'DIEX' OR 'EWPO'.
            CREDIT_ECSCO = CREDIT_ECSCO + ITAB_CESSCO-ECS.
          WHEN 'MRDY'.
            DEBIT_ECSCO  = DEBIT_ECSCO + ITAB_CESSCO-ECS.
        ENDCASE.
      ENDLOOP.
      MM = S_BUDAT-LOW+4(2).
      GR_TOTAL_CESS_CO  = CREDIT_ECSCO - DEBIT_ECSCO.
      LOOP AT ITAB_EXCISE1.
        ITAB_EXCISE1-OCT_ECS = OCT_ECS.
        MODIFY ITAB_EXCISE1.
      ENDLOOP.
      DELETE ITAB_EXCISE1 WHERE NOT TRNTYP IN R_TRNTYP .
      SORT ITAB_EXCISE1 BY SERIALNO BUDAT.
      DELETE ADJACENT DUPLICATES FROM ITAB_EXCISE1 COMPARING SERIALNO
                                                             BUDAT
                                                             SERIALNO1
                                                             EXBED1.
      APPEND LINES OF ITAB_EXCISE1 TO ITAB_EXCISE2.
      DELETE ITAB_EXCISE2 WHERE NOT SERIALNO IS INITIAL.
      DELETE ITAB_EXCISE1 WHERE SERIALNO IS INITIAL.
      SORT ITAB_EXCISE2 BY SERIALNO BUDAT SERIALNO1 EXBED1.
      DELETE ADJACENT DUPLICATES FROM ITAB_EXCISE2 COMPARING SERIALNO
                                                             BUDAT
                                                             SERIALNO1
                                                             EXBED1.
      APPEND LINES OF ITAB_EXCISE2 TO ITAB_EXCISE1.
      SORT ITAB_EXCISE1 BY SERIALNO BUDAT.
      LOOP AT ITAB_EXCISE1.
        MOVE-CORRESPONDING ITAB_EXCISE1 TO ITAB_EXCISE .
        IF ITAB_EXCISE1-SERIALNO IS INITIAL.
          MOVE : ITAB_EXCISE1-SERIALNO1 TO ITAB_EXCISE-SERIALNO.
          MOVE : ITAB_EXCISE1-EXBED1 TO ITAB_EXCISE-EXBED.
          MOVE : ITAB_EXCISE1-EXSED1 TO ITAB_EXCISE-EXSED.
          MOVE : ITAB_EXCISE1-OCT_ECS TO ITAB_EXCISE-OCT_ECS.
          MOVE : ITAB_EXCISE1-ECS TO ITAB_EXCISE-ECS.
        ENDIF.
        COLLECT ITAB_EXCISE .
      ENDLOOP.
      CLEAR ITAB_EXCISE1.REFRESH ITAB_EXCISE1.FREE ITAB_EXCISE1.
      DELETE ADJACENT DUPLICATES FROM ITAB_EXCISE COMPARING SERIALNO.
      DESCRIBE TABLE ITAB_EXCISE LINES V_LIN.
      IF V_LIN LE 0.
        MESSAGE E000(8I) WITH 'No Records Found'.
      ENDIF.
      PERFORM F_005_DIEX_DTL_SE_UTHAO.
    ENDFORM.                               " F_001_SERIAL_NOS_UTHAO
    *&      Form  F_002_TRNTYP_CHUNO
          text
    -->  p1        text
    <--  p2        text
    FORM F_002_TRNTYP_CHUNO.
      MOVE : 'I' TO R_TRNTYP-SIGN.
      MOVE : 'EQ' TO R_TRNTYP-OPTION.
      MOVE : 'GRPO' TO R_TRNTYP-LOW.
      APPEND R_TRNTYP.
      MOVE : 'DIEX' TO R_TRNTYP-LOW.
      APPEND R_TRNTYP.
      MOVE : 'MRDY' TO R_TRNTYP-LOW.
      APPEND R_TRNTYP.
      MOVE : 'EWPO' TO R_TRNTYP-LOW.
      APPEND R_TRNTYP.
    ENDFORM.                               " F_002_TRNTYP_CHUNO
    *&      Form  F_002_DISPLAY_TABLE_BHARO
          text
    -->  p1        text
    <--  p2        text
    FORM F_002_DISPLAY_TABLE_BHARO.
      DATA : V_CNT TYPE I.
      DATA : V_PREV_EXDAT LIKE J_1IEXCHDR-EXDAT ,
             V_PREV_EXNUM LIKE J_1IEXCHDR-EXNUM .
      DATA : V_DATE LIKE SY-DATUM.
      DATA : V_YYYY(4) , V_MM(2) , V_DD(2).
      PERFORM F_006_KHOL_BUND.
      SORT ITAB_EXCISE BY SERIALNO.
      LOOP AT ITAB_EXCISE.
        MOVE : ITAB_EXCISE-SERIALNO TO ITAB_DISPLAY-SERIALNO.
        MOVE : ITAB_EXCISE-BUDAT TO ITAB_DISPLAY-BUDAT.
        MOVE : V_OPENING_BED TO ITAB_DISPLAY-CENVAT_OPG.
        MOVE : V_OPENING_SED TO ITAB_DISPLAY-SED_OPG.
        MOVE : ITAB_EXCISE-OCT_ECS TO ITAB_DISPLAY-OCT_ECS.
        CASE ITAB_EXCISE-TRNTYP.
          WHEN 'GRPO' OR 'DIEX' OR 'EWPO'.
    To pick up RDOC3 as date for transaction type DIEX
            IF ITAB_EXCISE-TRNTYP EQ 'DIEX'.
              IF ITAB_EXCISE-RDOC3 CA '.'.
                SPLIT ITAB_EXCISE-RDOC3 AT '.' INTO V_DD V_MM V_YYYY.
                CONCATENATE V_YYYY V_MM V_DD INTO ITAB_DISPLAY-EXDAT_CR.
              ELSE.
                CONCATENATE ITAB_EXCISE-RDOC34(4) ITAB_EXCISE-RDOC32(2)
                          ITAB_EXCISE-RDOC3+0(2) INTO ITAB_DISPLAY-EXDAT_CR
              ENDIF.
            ELSE.
              MOVE : ITAB_EXCISE-EXDAT TO ITAB_DISPLAY-EXDAT_CR.
            ENDIF.
            MOVE : ITAB_EXCISE-EXNUM TO ITAB_DISPLAY-EXNUM_CR.
    Checking for Addl Duty of customs
            IF ITAB_EXCISE-CVDIND EQ 'X'.
              MOVE : ITAB_EXCISE-EXBED TO ITAB_DISPLAY-ADDL_DTY.
            ELSE.
              MOVE : ITAB_EXCISE-EXBED TO ITAB_DISPLAY-CENVAT_CR.
            ENDIF.
            MOVE : ITAB_EXCISE-EXSED TO ITAB_DISPLAY-SED_CR.
            MOVE : ITAB_EXCISE-ECS TO ITAB_DISPLAY-ECS.
    Getting the count of EXNUM
            IF V_PREV_EXDAT EQ ITAB_EXCISE-EXDAT AND
               V_PREV_EXNUM EQ ITAB_EXCISE-EXNUM.
              V_CNT = V_CNT + 1.
            ELSE.
              V_CNT = 1.
            ENDIF.
            MOVE : V_CNT TO ITAB_DISPLAY-CNT.
            MOVE : ITAB_EXCISE-EXNUM TO V_PREV_EXNUM.
            MOVE : ITAB_EXCISE-EXDAT TO V_PREV_EXDAT.
    Debits
          WHEN 'MRDY'.
            MOVE : ITAB_EXCISE-EXNUM TO ITAB_DISPLAY-EXNUM_DB.
            MOVE : ITAB_EXCISE-EXDAT TO ITAB_DISPLAY-EXDAT_DB.
            MOVE : ITAB_EXCISE-EXBED TO ITAB_DISPLAY-CENVAT_DB.
            MOVE : ITAB_EXCISE-EXSED TO ITAB_DISPLAY-SED_DB.
            MOVE : ITAB_EXCISE-ECS TO ITAB_DISPLAY-ECS1.
        ENDCASE.
    Total Credits
        ITAB_DISPLAY-TOT_CENVAT_CR = ITAB_DISPLAY-CENVAT_OPG +
                                     ITAB_DISPLAY-CENVAT_CR +
                                     ITAB_DISPLAY-ADDL_DTY .
        ITAB_DISPLAY-TOT_SED_CR = ITAB_DISPLAY-SED_OPG +
                                  ITAB_DISPLAY-SED_CR .
    Closing Balance
        ITAB_DISPLAY-CENVAT_CLS = ITAB_DISPLAY-TOT_CENVAT_CR -
                                  ITAB_DISPLAY-CENVAT_DB.
        ITAB_DISPLAY-SED_CLS = ITAB_DISPLAY-TOT_SED_CR -
                                  ITAB_DISPLAY-SED_DB.
        APPEND ITAB_DISPLAY.
        MOVE : ITAB_DISPLAY-CENVAT_CLS TO V_OPENING_BED.
        MOVE : ITAB_DISPLAY-SED_CLS TO V_OPENING_SED.
        CLEAR : ITAB_DISPLAY .
      ENDLOOP.
    ENDFORM.                               " F_002_DISPLAY_TABLE_BHARO
    *&      Form  F_003_TOPI_PEHNAO
          text
    -->  p1        text
    <--  p2        text
    FORM F_003_TOPI_PEHNAO.
      WRITE:/70 'CENVAT CREDIT LEDGER FOR PERIOD:' , (12) S_BUDAT-LOW ,
                 'to' , (12) S_BUDAT-HIGH , 180 'Page :' , SY-PAGNO .
      SKIP 3.
      WRITE :/25(30) 'OPENING BALANCE' CENTERED ,
              66(50) 'CREDIT' CENTERED ,
             118(28) 'CREDIT SUBTOTAL' CENTERED ,
             150(28) 'TOTAL CREDIT' CENTERED ,
             182(36) 'DEBIT' CENTERED ,
             225(28) 'BALANCE OF CREDIT' CENTERED .
      WRITE:/1 TEXT-001 ,
            12 TEXT-002 ,
            24(12) TEXT-003 CENTERED,
            40(12) TEXT-004 CENTERED,
            56 TEXT-005 ,
            66(12) TEXT-003 CENTERED,
            81(12) TEXT-006 CENTERED,
           102(12) TEXT-004 CENTERED,
           118(12) TEXT-003 CENTERED,
           134(12) TEXT-004 CENTERED,
           150(12) TEXT-003 CENTERED,
           166(12) TEXT-004 CENTERED,
           182 TEXT-007 ,                  "Doc no
           194(12) TEXT-003 CENTERED,
           210(12) TEXT-004 CENTERED,
           225(12) TEXT-003 CENTERED,
           240(12) TEXT-004 CENTERED.                           "(255)
      WRITE:/56 TEXT-008 , 81 TEXT-009 CENTERED
                                       , 182 TEXT-002.
      WRITE:/56 TEXT-002 , 81 TEXT-010 CENTERED .
      WRITE:/1(11) '1' CENTERED  ,
            12(11) '2' CENTERED ,
            24(12) '3' CENTERED ,
            40(12) '4' CENTERED ,
            55(11) '5' CENTERED ,
            66(12) '8a' CENTERED ,
            81(12) '8b' CENTERED ,
           102(12) '8c' CENTERED ,
           150(12) '9' CENTERED ,
           166(12) '10' CENTERED ,
           182(11) '11' CENTERED ,         "Doc no
           194(12) '12a' CENTERED ,
           210(12) '12B' CENTERED ,
           225(12) '13' CENTERED ,
           240(12) '14' CENTERED .                              "(255)
      WRITE :/
    ENDFORM.                               " F_003_TOPI_PEHNAO
    *&      Form  F_004_DIKHAO
          text
    -->  p1        text
    <--  p2        text
    FORM F_004_DIKHAO.
      DATA : V_FIRST , V_PREV_EXNUM LIKE J_1IEXCHDR-EXNUM .
      DATA : V_PREV_EXDAT LIKE J_1IEXCHDR-EXDAT , V_CNT TYPE I .
      SORT ITAB_DISPLAY BY SERIALNO BUDAT EXNUM_CR.
      LOOP AT ITAB_DISPLAY.
        IF SY-TABIX = 1.
          TOTAL_ECS = GR_TOTAL_CESS_CO .
          TOTAL_ECS_1 = GR_TOTAL_CESS_CO .
        ENDIF.
        WRITE:/1 ITAB_DISPLAY-SERIALNO ,
              12 ITAB_DISPLAY-BUDAT ,
              24(15) ITAB_DISPLAY-CENVAT_OPG .
        WRITE: 40(14) TOTAL_ECS.
        IF NOT ITAB_DISPLAY-EXNUM_CR IS INITIAL.
          WRITE : 55 ITAB_DISPLAY-EXNUM_CR ,
                  66(15) ITAB_DISPLAY-CENVAT_CR ,
                  82(14) ITAB_DISPLAY-ADDL_DTY .
       ---------------------INCLUDING CESS CREDIT VALUE---------
          IF NOT ITAB_DISPLAY-ECS IS INITIAL.
            WRITE : 102(14) ITAB_DISPLAY-ECS.
          ENDIF.
          READ TABLE ITAB_EXNUM1 WITH KEY EXNUM = ITAB_DISPLAY-EXNUM_CR
                                          EXDAT = ITAB_DISPLAY-EXDAT_CR
                                          CNT = ITAB_DISPLAY-CNT .
          IF SY-SUBRC EQ 0.
            WRITE : 118(15) ITAB_EXNUM1-CENVAT.
            IF NOT ITAB_EXNUM1-SED IS INITIAL.
              WRITE : 134(14) ITAB_EXNUM1-SED.
            ENDIF.
          ENDIF.
        ENDIF.
        WRITE : 150(15) ITAB_DISPLAY-TOT_CENVAT_CR.
       IF NOT ITAB_DISPLAY-TOT_SED_CR IS INITIAL.
         WRITE : 166(14) ITAB_DISPLAY-TOT_SED_CR.
       ENDIF.
        WRITE : 166(14) TOTAL_ECS.
        IF NOT ITAB_DISPLAY-EXNUM_DB IS INITIAL.
          WRITE : 182 ITAB_DISPLAY-EXNUM_DB ,
                  194(15) ITAB_DISPLAY-CENVAT_DB .
    *--GETTING CESS VALUE FOR DEBIT--
          IF NOT ITAB_DISPLAY-ECS1 IS INITIAL.
            WRITE : 210(14)  ITAB_DISPLAY-ECS1.
          ENDIF.
        ENDIF.
        WRITE : 225(15) ITAB_DISPLAY-CENVAT_CLS.
    RECENT CHANGES -
        IF NOT ITAB_DISPLAY-ECS IS  INITIAL.
          TOTAL_ECS = ITAB_DISPLAY-ECS + TOTAL_ECS.
        ENDIF.
        IF NOT ITAB_DISPLAY-ECS1 IS  INITIAL.
          TOTAL_ECS = TOTAL_ECS - ITAB_DISPLAY-ECS1 .
        ENDIF.
        WRITE : 240(13) TOTAL_ECS.
    RECENT CHANGES -
        IF NOT ITAB_DISPLAY-EXNUM_CR IS INITIAL.
          WRITE :/55 ITAB_DISPLAY-EXDAT_CR.
        ENDIF.
        IF NOT ITAB_DISPLAY-EXNUM_DB IS INITIAL.
          WRITE :/182 ITAB_DISPLAY-EXDAT_DB.
        ENDIF.
        GR_TOTAL_ECS = GR_TOTAL_ECS + TOTAL_ECS.
        COMPUTE  GR_TOTAL_CREDIT_CESS = GR_TOTAL_CREDIT_CESS +
    ITAB_DISPLAY-ECS .
        COMPUTE  GR_TOTAL_DEBIT_CESS = GR_TOTAL_DEBIT_CESS +
    ITAB_DISPLAY-ECS1 .
        COMPUTE  GR_CLOSE_BAL_CESS = ( TOTAL_ECS_1 + GR_TOTAL_CREDIT_CESS )
    - GR_TOTAL_DEBIT_CESS.
        AT LAST.
          IF NOT ITAB_DISPLAY-ECS IS  INITIAL.
            TOTAL_ECS = ITAB_DISPLAY-ECS + TOTAL_ECS.
          ENDIF.
          IF NOT ITAB_DISPLAY-ECS1 IS  INITIAL.
            TOTAL_ECS = TOTAL_ECS - ITAB_DISPLAY-ECS1 .
          ENDIF.
          WRITE:/(255) SY-ULINE.
          WRITE:/212(12) GR_TOTAL_DEBIT_CESS.
          SUM.
         WRITE:/(255) SY-ULINE.
         WRITE:/40(12) GR_TOTAL_ECS ,
          WRITE:  66 ITAB_DISPLAY-CENVAT_CR ,
                82 ITAB_DISPLAY-ADDL_DTY ,
               102 ITAB_DISPLAY-SED_CR ,
               102(12) GR_TOTAL_CREDIT_CESS,
               168(12) GR_TOTAL_CREDIT_CESS,
               194 ITAB_DISPLAY-CENVAT_DB .
               210 ITAB_DISPLAY-SED_DB.
          WRITE : 240(13) GR_CLOSE_BAL_CESS.
          WRITE:/(255) SY-ULINE.
        ENDAT.
        MOVE : ITAB_DISPLAY-EXNUM_CR TO V_PREV_EXNUM.
        MOVE : ITAB_DISPLAY-EXDAT_CR TO V_PREV_EXDAT.
       IF NOT ITAB_DISPLAY-ECS IS  INITIAL.
        TOTAL_ECS = ITAB_DISPLAY-ECS + total_ecs.
       ENDIF.
       IF NOT ITAB_DISPLAY-ECS1 IS  INITIAL.
        TOTAL_ECS = TOTAL_ECS - ITAB_DISPLAY-ECS1 .
       ENDIF.
       GR_TOTAL_ECS = GR_TOTAL_ECS + TOTAL_ECS.
      ENDLOOP.
    ENDFORM.                               " F_004_DIKHAO
    *&      Form  F_005_CREDIT_SUBTOTAL
          text
    -->  p1        text
    <--  p2        text
    FORM F_005_CREDIT_SUBTOTAL.
      DATA : V_CENVAT LIKE J_1IEXCHDR-EXBED , V_SED LIKE J_1IEXCHDR-EXSED.
      DATA : V_CNT TYPE I.
      LOOP AT ITAB_DISPLAY WHERE EXNUM_CR NE SPACE.
        MOVE : ITAB_DISPLAY-EXNUM_CR TO ITAB_EXNUM-EXNUM.
        MOVE : ITAB_DISPLAY-EXDAT_CR TO ITAB_EXNUM-EXDAT.
        MOVE : ITAB_DISPLAY-CENVAT_CR TO ITAB_EXNUM-CENVAT.
        MOVE : ITAB_DISPLAY-ADDL_DTY TO ITAB_EXNUM-ADDL_DTY.
        MOVE : ITAB_DISPLAY-SED_CR TO ITAB_EXNUM-SED.
        APPEND ITAB_EXNUM.
      ENDLOOP.
      SORT ITAB_EXNUM BY EXNUM EXDAT.
      LOOP AT ITAB_EXNUM.
        AT NEW EXDAT.
          MOVE : ITAB_EXNUM-EXNUM TO ITAB_EXNUM1-EXNUM.
          CLEAR : V_CNT , V_CENVAT , V_SED.
        ENDAT.
        V_CNT = V_CNT + 1.
        V_CENVAT = V_CENVAT + ITAB_EXNUM-CENVAT + ITAB_EXNUM-ADDL_DTY.
        V_SED = V_SED + ITAB_EXNUM-SED.
        AT END OF EXDAT.
          MOVE : ITAB_EXNUM-EXDAT TO ITAB_EXNUM1-EXDAT.
          MOVE : V_CENVAT TO ITAB_EXNUM1-CENVAT.
          MOVE : V_SED TO ITAB_EXNUM1-SED.
          MOVE : V_CNT TO ITAB_EXNUM1-CNT.
          APPEND ITAB_EXNUM1.
        ENDAT.
      ENDLOOP.
      DELETE ITAB_EXNUM1 WHERE CNT EQ 1.
    ENDFORM.                               " F_005_CREDIT_SUBTOTAL
    *&      Form  F_006_CHECK_KARO
          text
    -->  p1        text
    <--  p2        text
    *FORM F_006_CHECK_KARO.
    DATA : ITAB_CHECK LIKE ZEXCISE_SED_BED OCCURS 0 WITH HEADER LINE.
    SELECT * FROM ZEXCISE_SED_BED INTO TABLE ITAB_CHECK WHERE
                                                          ZDATE IN S_BUDAT
    DESCRIBE TABLE ITAB_CHECK LINES V_LIN.
    IF V_LIN GT 0.
       SORT ITAB_CHECK BY ZDATE DESCENDING.
       READ TABLE ITAB_CHECK INDEX 1.
       MESSAGE E000(8I) WITH 'Please execute the report for date after'
                              ITAB_CHECK-ZDATE.
    ENDIF.
    *ENDFORM.                               " F_006_CHECK_KARO
    *&      Form  F_006_KHOL_BUND
          text
    -->  p1        text
    <--  p2        text
    FORM F_006_KHOL_BUND.
      TABLES : MARD .
      DATA : MM LIKE MARD-LFMON , YYYY LIKE MARD-LFGJA.
    CALL FUNCTION 'Z_GET_FINANCIAL_YEAR'
       EXPORTING
         DATE     = S_BUDAT-LOW
       IMPORTING
         F_PERIOD = MM
         F_YEAR   = YYYY
       EXCEPTIONS
         OTHERS   = 1.
    ****KANS INSERT
      IF P_WERKS EQ '1000'.
        SELECT * FROM GLT0 WHERE BUKRS EQ '1000' AND
                                           RYEAR EQ YYYY AND
                                           RACCT EQ '0000155110' .
          MOVE-CORRESPONDING GLT0 TO ITAB_GLT0.
          COLLECT ITAB_GLT0.
        ENDSELECT.
        SELECT * FROM GLT0 WHERE BUKRS EQ '1000' AND
                                           RYEAR EQ YYYY AND
                                           RACCT EQ '0000155130' .
          MOVE-CORRESPONDING GLT0 TO ITAB_GLT0_1.
          COLLECT ITAB_GLT0_1.
        ENDSELECT.
      ELSEIF P_WERKS EQ '3000'.
        SELECT * FROM GLT0 WHERE BUKRS EQ '1000' AND
                                           RYEAR EQ YYYY AND
                                           RACCT EQ '0000157110' .
          MOVE-CORRESPONDING GLT0 TO ITAB_GLT0.
          COLLECT ITAB_GLT0.
        ENDSELECT.
        SELECT * FROM GLT0 WHERE BUKRS EQ '1000' AND
                                           RYEAR EQ YYYY AND
                                           RACCT EQ '0000157130' .
          MOVE-CORRESPONDING GLT0 TO ITAB_GLT0_1.
          COLLECT ITAB_GLT0_1.
        ENDSELECT.
    Begin of corrections
      ELSEIF P_WERKS EQ '4000'.
        SELECT * FROM GLT0 WHERE BUKRS EQ '1000' AND
                                           RYEAR EQ YYYY AND
                                           RACCT EQ '0000158110' .
          MOVE-CORRESPONDING GLT0 TO ITAB_GLT0.
          COLLECT ITAB_GLT0.
        ENDSELECT.
        SELECT * FROM GLT0 WHERE BUKRS EQ '1000' AND
                                           RYEAR EQ YYYY AND
                                           RACCT EQ '0000158130' .
          MOVE-CORRESPONDING GLT0 TO ITAB_GLT0_1.
          COLLECT ITAB_GLT0_1.
        ENDSELECT.
      ELSEIF P_WERKS EQ '2000'.
        SELECT * FROM GLT0 WHERE BUKRS EQ '1000' AND
                                           RYEAR EQ YYYY AND
                                           RACCT EQ '0000156110' .
          MOVE-CORRESPONDING GLT0 TO ITAB_GLT0.
          COLLECT ITAB_GLT0.
        ENDSELECT.
        SELECT * FROM GLT0 WHERE BUKRS EQ '1000' AND
                                           RYEAR EQ YYYY AND
                                           RACCT EQ '0000156130' .
          MOVE-CORRESPONDING GLT0 TO ITAB_GLT0_1.
          COLLECT ITAB_GLT0_1.
        ENDSELECT.
      ELSEIF P_WERKS EQ '5000'.
        SELECT * FROM GLT0 WHERE BUKRS EQ '1000' AND
                                           RYEAR EQ YYYY AND
                                           RACCT EQ '0000159110' .
          MOVE-CORRESPONDING GLT0 TO ITAB_GLT0.
          COLLECT ITAB_GLT0.
        ENDSELECT.
        SELECT * FROM GLT0 WHERE BUKRS EQ '1000' AND
                                           RYEAR EQ YYYY AND
                                           RACCT EQ '0000159130' .
          MOVE-CORRESPONDING GLT0 TO ITAB_GLT0_1.
          COLLECT ITAB_GLT0_1.
        ENDSELECT.
    ****End of corrections (20.04.2002 for Plant 4000)
      ENDIF.
      READ TABLE ITAB_GLT0 INDEX 1.
      READ TABLE ITAB_GLT0_1 INDEX 1.
      CASE MM.
        WHEN '01'.
          MOVE : ITAB_GLT0-TSLVT TO V_OPENING_BED.
          MOVE : ITAB_GLT0_1-TSLVT TO V_OPENING_SED.
        WHEN '02'.
          V_OPENING_BED = ITAB_GLT0-TSLVT + ITAB_GLT0-TSL01.
          V_OPENING_SED = ITAB_GLT0_1-TSLVT + ITAB_GLT0_1-TSL01.
        WHEN '03'.
          V_OPENING_BED = ITAB_GLT0-TSLVT + ITAB_GLT0-TSL01 +
                          ITAB_GLT0-TSL02 .
          V_OPENING_SED = ITAB_GLT0_1-TSLVT + ITAB_GLT0_1-TSL01 +
                          ITAB_GLT0_1-TSL02.
        WHEN '04'.
          V_OPENING_BED = ITAB_GLT0-TSLVT + ITAB_GLT0-TSL01 +
                          ITAB_GLT0-TSL02 + ITAB_GLT0-TSL03 .
          V_OPENING_SED = ITAB_GLT0_1-TSLVT + ITAB_GLT0_1-TSL01 +
                          ITAB_GLT0_1-TSL02 + ITAB_GLT0_1-TSL03 .
        WHEN '05'.
          V_OPENING_BED = ITAB_GLT0-TSLVT + ITAB_GLT0-TSL01 +
                          ITAB_GLT0-TSL02 + ITAB_GLT0-TSL03 +
                          ITAB_GLT0-TSL04 .
          V_OPENING_SED = ITAB_GLT0_1-TSLVT + ITAB_GLT0_1-TSL01 +
                          ITAB_GLT0_1-TSL02 + ITAB_GLT0_1-TSL03 +
                          ITAB_GLT0_1-TSL04 .
        WHEN '06'.
          V_OPENING_BED = ITAB_GLT0-TSLVT + ITAB_GLT0-TSL01 +
                          ITAB_GLT0-TSL02 + ITAB_GLT0-TSL03 +
                          ITAB_GLT0-TSL04 + ITAB_GLT0-TSL05 .
          V_OPENING_SED = ITAB_GLT0_1-TSLVT + ITAB_GLT0_1-TSL01 +
                          ITAB_GLT0_1-TSL02 + ITAB_GLT0_1-TSL03 +
                          ITAB_GLT0_1-TSL04 + ITAB_GLT0_1-TSL05 .
        WHEN '07'.
          V_OPENING_BED = ITAB_GLT0-TSLVT + ITAB_GLT0-TSL01 +
                          ITAB_GLT0-TSL02 + ITAB_GLT0-TSL03 +
                          ITAB_GLT0-TSL04 + ITAB_GLT0-TSL05 +
                          ITAB_GLT0-TSL06 .
          V_OPENING_SED = ITAB_GLT0_1-TSLVT + ITAB_GLT0_1-TSL01 +
                          ITAB_GLT0_1-TSL02 + ITAB_GLT0_1-TSL03 +
                          ITAB_GLT0_1-TSL04 + ITAB_GLT0_1-TSL05 +
                          ITAB_GLT0_1-TSL06 .
        WHEN '08'.
          V_OPENING_BED = ITAB_GLT0-TSLVT + ITAB_GLT0-TSL01 +
                          ITAB_GLT0-TSL02 + ITAB_GLT0-TSL03 +
                          ITAB_GLT0-TSL04 + ITAB_GLT0-TSL05 +
                          ITAB_GLT0-TSL06 + ITAB_GLT0-TSL07 .
          V_OPENING_SED = ITAB_GLT0_1-TSLVT + ITAB_GLT0_1-TSL01 +
                          ITAB_GLT0_1-TSL02 + ITAB_GLT0_1-TSL03 +
                          ITAB_GLT0_1-TSL04 + ITAB_GLT0_1-TSL05 +
                          ITAB_GLT0_1-TSL06 + ITAB_GLT0_1-TSL07 .
        WHEN '09'.
          V_OPENING_BED = ITAB_GLT0-TSLVT + ITAB_GLT0-TSL01 +
                          ITAB_GLT0-TSL02 + ITAB_GLT0-TSL03 +
                          ITAB_GLT0-TSL04 + ITAB_GLT0-TSL05 +
                          ITAB_GLT0-TSL06 + ITAB_GLT0-TSL07 +
                          ITAB_GLT0-TSL08 .
          V_OPENING_SED = ITAB_GLT0_1-TSLVT + ITAB_GLT0_1-TSL01 +
                          ITAB_GLT0_1-TSL02 + ITAB_GLT0_1-TSL03 +
                          ITAB_GLT0_1-TSL04 + ITAB_GLT0_1-TSL05 +
                          ITAB_GLT0_1-TSL06 + ITAB_GLT0_1-TSL07 +
                          ITAB_GLT0_1-TSL08 .
        WHEN '10'.
          V_OPENING_BED = ITAB_GLT0-TSLVT + ITAB_GLT0-TSL01 +
                          ITAB_GLT0-TSL02 + ITAB_GLT0-TSL03 +
                          ITAB_GLT0-TSL04 + ITAB_GLT0-TSL05 +
                          ITAB_GLT0-TSL06 + ITAB_GLT0-TSL07 +
                          ITAB_GLT0-TSL08 + ITAB_GLT0-TSL09 .
          V_OPENING_SED = ITAB_GLT0_1-TSLVT + ITAB_GLT0_1-TSL01 +
                          ITAB_GLT0_1-TSL02 + ITAB_GLT0_1-TSL03 +
                          ITAB_GLT0_1-TSL04 + ITAB_GLT0_1-TSL05 +
                          ITAB_GLT0_1-TSL06 + ITAB_GLT0_1-TSL07 +
                          ITAB_GLT0_1-TSL08 + ITAB_GLT0_1-TSL09 .
        WHEN '11'.
          V_OPENING_BED = ITAB_GLT0-TSLVT + ITAB_GLT0-TSL01 +
                          ITAB_GLT0-TSL02 + ITAB_GLT0-TSL03 +
                          ITAB_GLT0-TSL04 + ITAB_GLT0-TSL05 +
                          ITAB_GLT0-TSL06 + ITAB_GLT0-TSL07 +
                          ITAB_GLT0-TSL08 + ITAB_GLT0-TSL09 +
                          ITAB_GLT0-TSL10 .
          V_OPENING_SED = ITAB_GLT0_1-TSLVT + ITAB_GLT0_1-TSL01 +
                          ITAB_GLT0_1-TSL02 + ITAB_GLT0_1-TSL03 +
                          ITAB_GLT0_1-TSL04 + ITAB_GLT0_1-TSL05 +
                          ITAB_GLT0_1-TSL06 + ITAB_GLT0_1-TSL07 +
                          ITAB_GLT0_1-TSL08 + ITAB_GLT0_1-TSL09 +
                          ITAB_GLT0_1-TSL10 .
        WHEN '12'.
          V_OPENING_BED = ITAB_GLT0-TSLVT + ITAB_GLT0-TSL01 +
                          ITAB_GLT0-TSL02 + ITAB_GLT0-TSL03 +
                          ITAB_GLT0-TSL04 + ITAB_GLT0-TSL05 +
                          ITAB_GLT0-TSL06 + ITAB_GLT0-TSL07 +
                          ITAB_GLT0-TSL08 + ITAB_GLT0-TSL09 +
                          ITAB_GLT0-TSL10 + ITAB_GLT0-TSL11 .
          V_OPENING_SED = ITAB_GLT0_1-TSLVT + ITAB_GLT0_1-TSL01 +
                          ITAB_GLT0_1-TSL02 + ITAB_GLT0_1-TSL03 +
                          ITAB_GLT0_1-TSL04 + ITAB_GLT0_1-TSL05 +
                          ITAB_GLT0_1-TSL06 + ITAB_GLT0_1-TSL07 +
                          ITAB_GLT0_1-TSL08 + ITAB_GLT0_1-TSL09 +
                          ITAB_GLT0_1-TSL10 + ITAB_GLT0_1-TSL11 .
      ENDCASE.
    ENDFORM.                               " F_006_KHOL_BUND
    *&      Form  F_005_DIEX_DTL_SE_UTHAO
          text
    -->  p1        text
    <--  p2        text
    FORM F_005_DIEX_DTL_SE_UTHAO.
    *ppend lines of itab_excise to itab_excise1.
    *elete itab_excise where trntyp eq 'DIEX'.
    *elete itab_excise1 where trntyp ne 'DIEX'.
    ENDFORM.                               " F_005_DIEX_DTL_SE_UTHAO

    Star ,
    Tell me how u are calc.Opening Balance?
    Regards
    Prabhu

  • BP Opening Balance & It's Adjustment.

    Hi Freinds,
    I have a scenario where client had posted Business Partner - Customer opening balance from system initialization screen. Subsequent to that Customer had made partial payment against old oustanding AR invoices.
    eg. Customer A's opening balance posted for Rs.80000/- 01.04.08
          On 20.04.08 Customer A had made a payment to the tune of Rs. 50,000/-. After posting this particular incoming payment Customer A's outstanding/aging report should show the balance of Rs.30,000/-.
    Where as at present I can see both Dr. 80,000/- as well Cr. 50,000/- as independent transactions and not able to knock off against opening balance.
    Request your valuable inputs/suggestions/advises on this.
    Regards
    N.Narayana Swamy

    This is better handled in 2007B but for your current scenario, if you really want to see only 30,000 on BP account and not the transactions, you will need to process an Internal Reconciliation, Select the Debit and Credit and click Reconcile and in the JE window for the Balancing entry, you will see
    BP  Cr 30,000
    you will need to enter the BP Code again on the second row by pressing control tab on BP/Account column.
    This way the JE would post a Credit and equivalent debit reconiciling the transaction at the same time retaining the 30,000 the customer owes
    This is the best you can do
    Suda

  • Not able to pick Opening Balance in Ageing Report

    Hi
    I have made an query for customer ageing report based on our requirement, but am not able to fetch the OB (Opening Balance) in that.  If i generate Customer ageing report from B1, its showing the OB in the first line, then it showing the open invoices on the corresponding ageing days.
    Can anyone help me to fetch the opening balance in ageing report.  Below is the query i have given for ageing.
    SELECT     NNM1.Remark AS Branch, OINV.DocNum, OINV.NumAtCard AS VendorRef, OINV.DocType AS Type, OINV.DocStatus AS Status, OINV.DocDate,
                          OINV.DocDueDate, OINV.CardCode, OINV.CardName, OINV.DocTotal, OINV.PaidToDate AS [Paid/Credited],
                          OINV.DocTotal - OINV.PaidToDate AS [Balance Due], (CASE WHEN DateDiff(dd, OINV.DocDate, getdate()) BETWEEN - 120 AND
                          0 THEN (OINV.DocTotal - OINV.PaidToDate) END) AS 'Less then Due Date', (CASE WHEN DateDiff(dd, OINV.DocDate, getdate()) BETWEEN 0 AND
                          30 THEN (OINV.DocTotal - OINV.PaidToDate) END) AS '0 - 30', (CASE WHEN DateDiff(dd, OINV.DocDate, getdate()) BETWEEN 31 AND
                          45 THEN (OINV.DocTotal - OINV.PaidToDate) END) AS '30 - 45', (CASE WHEN DateDiff(dd, OINV.DocDate, getdate()) BETWEEN 46 AND
                          60 THEN (OINV.DocTotal - OINV.PaidToDate) END) AS '45 - 60', (CASE WHEN DateDiff(dd, OINV.DocDate, getdate()) BETWEEN 61 AND
                          90 THEN (OINV.DocTotal - OINV.PaidToDate) END) AS '60-90', (CASE WHEN DateDiff(dd, OINV.DocDate, getdate()) BETWEEN 91 AND
                          120 THEN (OINV.DocTotal - OINV.PaidToDate) END) AS '90-120', (CASE WHEN DateDiff(dd, OINV.DocDate, getdate())
                          > 120 THEN (OINV.DocTotal - OINV.PaidToDate) END) AS '120 +', OSLP.SlpName, OUBR.Name
    FROM         OINV AS OINV INNER JOIN
                          NNM1 AS NNM1 ON OINV.Series = NNM1.Series INNER JOIN
                          OSLP ON OINV.SlpCode = OSLP.SlpCode INNER JOIN
                          OHEM ON OSLP.SlpCode = OHEM.salesPrson INNER JOIN
                          OUBR ON OHEM.branch = OUBR.Code
    WHERE     (OINV.DocStatus = 'O') AND (OUBR.Code IN (@Branch)) AND (OSLP.SlpCode IN (@SalesEmployee))
    ORDER BY OINV.CardName, OSLP.SlpName
    How to add the OB in the above query.

    Check note 1023083 and for information about the expected release date of the patch please view note 578944.this problem is related to the new  SAP GUI 7 patch-level 0. There is something wrong with  the GUI function to get information from the local registry (CL_GUI_FRONTEND_SERVICES=>REGISTRY_GET_VALUE).
    We had the same issue sometime back and we applied the patch. I have the patch but it will be a huge file to send over internet. See the above notes and you should be able to apply the required patch.
    Also check Note
    Note 696069 below:
    Summary
    Symptom
    No Data is displayed when View is changed from ALV to Excel Inplace on
    ALV Grid. This Happens with Office XP/2003/2007.
    Other terms
    Excel inplace, Excel, ALV, Office 2003, Office XP, office 2007
    Reason and Prerequisites
    With newer release of MS Office (XP/2003/2007) Microsoft added new security settings/options for Visual Basic project and Macros. Excel Inplace uses Visual Basic Project and macro functionality of MS Office. If the setting for Macro security is High (which automatically disables macro or if access to Visual Basic Project is suppressed then Excel Inplace doesn't show any Data in Excel.
    Solution
    Required settings in MS office XP and MS Office 2003:
    To use the Excel Inplace functionality make sure the security settings for Macro is set to Medium and the option "Trust access to Visual Basic Project" must be checked on Tools->Macro->Security->Trusted Sources tab.
    Required settings in Office 2007:
    Please see the video file in attachments of this note.
    This is required with MS Office XP, MS Office 2003, MS Office 2007.
    Header Data
    Release Status: Released for Customer
    Released on: 22.12.2006  14:47:01
    Priority: Recommendations/additional info
    Category: Consulting
    Primary Component: BC-FES-OFFI SAP Desktop Office Integration
    Secondary Components: BC-FES-XXL XXL List Viewer/Lotus Connections
    Reward points if this help
    Sanghamitra
    Message was edited by:
            Sanghamitra11

  • Problem in opening balance

    I have imported opening balance for customer.I have used Suspence account as offset account for opening balance.But some account heads are considered by default.
    For eg,
    AVANTI PROTECTIVE SERVICE                Db-1200
    Suspense Account                                     Cr-0
    Miscellaneous Expenses                            Cr-1200
    Here Cr is credit and Db is debit.Miscellaneuos account is not considered in opening balance.Still it is shown in the journal entry.

    I am presuming that you are importing all the Invoice as Service Invoices.  You will need to Complete the OInvoices template
    RecordKey  CardCode DocDate     DocDueDate  DocNum DocType     
    1       C1234       20070901 20070915          123455      dDocument_Service
    HandWritten  NumAtCard   SalesPersonCode
    tYES         CUST PO #                     8
    NOTE: If you going to import the document with their Original numbers then you have to specify HandWritten as tYES.  If you miss this SAP will start with the numbering set for this document in the document numbering. NumatCard is Cust PO number and SalesPersonCode is optional, I have shown it for your info.  You have to specify the internal number from the OSLP table (SLPCODE for the Sales Person)
    DocumentLines template
    RecordKey    AccountCode                       LineTotal                  TaxCode
    1                  _SYS00000000225                   1200                     Exempt or 0
    NOTE:  The _SYSxxxxx number should be obtained from the OACT table.  Use you Suspense Account number itself if you are not using Segmented Accounts.
    Let me know if you need further assistance
    Suda
    1

Maybe you are looking for

  • 1st Generation iPod Touch & Smart Playlists

    My 1st Generation iPod Touch will not sync my Smart Playlists. After syncing, the Playlists appear under my iPod touch in the iTunes 11 sidebar. On my iPod Touch all songs/tracks for the playlists load into the iPod's library and can be accessed. Pla

  • Error in query(on 29th by Naren)

    Hi all, I have the following query. SELECT S.SCHOOLNAME, CASE WHEN SUM(SUM(DISTINCT L.WORK_SPACE))/5*100/COUNT(DISTINCT L.QUESTION_ID)<50 THEN COUNT(DISTINCT L.RESPONSER_ID) END AS RSCORE, CASE WHEN SUM(SUM(DISTINCT L.WORK_SPACE))/5*100/COUNT(DISTINC

  • Duplicate photos from root Picture folder

    As a result of upgrading versions of LR from 1.0 to now, and not knowing how to do that properly, I've got nested Lightroom and Pictures sub folders in my root Pictures on my Mac system.  Is there a way to illiminate duplicate photos, without breakin

  • Using iiTunes Store in Mexico

    I am frustrated to this day that I can´t buy music and videos via itunes just becuse I live in México City.

  • PDF Form to Smartform

    Hi Friends, Is there any FM for converting PDF form to Smartform? Thanks, Sagar