Opening and closing of year end

Dear all,
Pl what are the transaction code used for the opening and closing of year end activities. in fico module . what process we have to take for open and close the period open .
girija

hi
Year End Process
All the Month end Activities should be Carried Out.
Balance Carried Forwarded to next year(F.16)
PCA Balance Carried Forward(2KES).
Carry forward the Vendor,Customer and Asset Balances
(Unless Dep is posted for all the months the assets can not be Closed)
Copy the No Ranges to new year
Open the Next year period(OB52)
asset accounting
oaar
ajab
ajrw
material management
omsy
mmpv
Thanks & Regards
phaneendra

Similar Messages

  • Opening and closing balance difference is showing from 2010 to 2011 F.year

    Dear All,
    Opening and closing balance difference is showing for Main Cash(Cash in h)
    End of fiscal year 2010 closing Balance 85,451,909.70
    Opening Balance 2011 is showing as 85,450,909.70  
    Rs 1000 difference is coming.
    Please suggest if any Note is there?

    Hi,
    Somes after year end for audit / management adjustment entries postings done with previous year.
    Execute N no of times Balance carry forward T.Code: FAGLGVTR  until you get your closing balances & opening balances are the same. it is not harm to execute again & again.
    up to 4.7EE for balance transfer you can use T.Code:F.16 from ECC 5 / 6 use tcode for balance transfer FAGLGVTR
    Regards,
    Viswa
    Edited by: viswanatha s on Nov 4, 2011 12:54 PM

  • Query For Finding Yearly Opening and Closing Balance for All the Items

    Hi Experts,
    I am working on Query Based Report for finding the Yearly Opening and Closing Stock for all the Items
    i will give yearwise selection and I want opening and closing stock in between that years
    Warm Regards,
    Sandip Kokate
    Edited by: Sandipk on May 20, 2011 1:58 PM

    Hi,
    Declare @SDate DateTime
    Declare @EDate DateTime
    Declare @Whse nvarchar(10)
    Set @SDate= (SELECT min(F_RefDate)  FROM  OFPR T1 where  T1.[Name] ='[1%]' )
    Set @EDate= (SELECT max(T_RefDate)  FROM  OFPR T1 where  T1.[Name] ='[%1]' )
    Set @Whse=(Select Max(s2.Warehouse) from OINM S2 Where S2.Warehouse = '[%2]')
    BEGIN
    Select @Whse as 'Warehouse', a.Itemcode, max(a.Dscription) as ItemName,
    sum(a.OpeningBalance) as OpeningBalance, sum(a.INq) as 'IN', sum(a.OUT) as OUT,
    ((sum(a.OpeningBalance) + sum(a.INq)) - Sum(a.OUT)) as Closing ,
    (Select i.InvntryUom from OITM i where i.ItemCode=a.Itemcode) as UOM
    from( Select N1.Warehouse, N1.Itemcode, N1.Dscription, (sum(N1.inqty)-sum(n1.outqty))
    as OpeningBalance, 0 as INq, 0 as OUT From dbo.OINM N1
    Where N1.DocDate < @SDate and N1.Warehouse = @Whse Group By N1.Warehouse,N1.ItemCode,
    N1.Dscription Union All select N1.Warehouse, N1.Itemcode, N1.Dscription, 0 as OpeningBalance,
    sum(N1.inqty) , 0 as OUT From dbo.OINM N1 Where N1.DocDate >= @SDate and N1.DocDate <= @EDate
    and N1.Inqty >0 and N1.Warehouse = @Whse Group By N1.Warehouse,N1.ItemCode,N1.Dscription
    Union All select N1.Warehouse, N1.Itemcode, N1.Dscription, 0 as OpeningBalance, 0 , sum(N1.outqty) as OUT
    From dbo.OINM N1 Where N1.DocDate >= @SDate and N1.DocDate <=@EDate and N1.OutQty > 0
    and N1.Warehouse = @Whse Group By N1.Warehouse,N1.ItemCode,N1.Dscription) a, dbo.OITM I1
    where a.ItemCode=I1.ItemCode
    Group By a.Itemcode Having sum(a.OpeningBalance) + sum(a.INq) + sum(a.OUT) > 0 Order By a.Itemcode
    END
    I hope this will work for you.
    In above query you can also user OFPR.Code, OFPR, Category OFPR.Indicator instead of OFPR.Name.
    Regards
    Vaibhav Anharwadkar
    Edited by: Vaibhav Ancharwadkar on May 24, 2011 9:23 AM

  • How to clear all open GRIRs in the year end and maintained as provision  ?

    Hi Friends,
    I would like to clear all open GRIRs in the year end and maintained as provision.
    in the next year next day i would like to show as open items.
    How can do it ?
    I have tried to clear it. I have maintained OBYP settings also. But i am unable see as clear item.
    Could you explain me how it actuallly works ?

    Hi REddy,
    In most of the cases, the GR/IR account will have a credit balance and would be taken as provision for liability during year end activites. So as a standard practise you need to clear them on year end.
    but if you want to clear them, first you need to deselect check box Post automatically only for GR/IR clearing GL's master data.
    Then pass a adjustment entry like
    GR/IR GL Dr
                To Provision for Liabilites GL: Cr
    Above sample entry is true when your GR/IR account has a CR balance at the year end. if not post it in a reversed manner.
    Now with tcode F-03, for GR/IR GL, choose all items and clear them. Now you will get the clearing doc number.
    Now on start of new FY, reverse the above accounting entry with FB08.
    This will meet your requirement.
    Thanks,
    Srinu

  • How to open and closed posting period??

    Dear Gurus,
    Pls help me, how to open and closed posting period.when and how we used special period.
    Regrds
    Mahesh

    HI,
    Tcode is ob52
    here we generally provide the following details
    a/c type from a/c to a/c from period year to period year from period year to period
    +                                    1            2007   12         2007      13       2007   16
    + implies it applicable to all account types
    generally we can have maximum 4 special periods and total no of periods(normal+special) should not exceed 16
    generally we use special periods for year end adjustments like tax adjustments
    if it is useful assign me points

  • Performance Issue For Opening And Closing Balance In FBL1N/3N/5N

    Dear experts,
                        I Am Having Requirement to Bring Opening And Closing Balance In FBL1N, FBL3N, FBL5N.
    For This requirement I Used BADI : FI_ITEMS_CH_DATA~CHANGE_ITEMS, below is my Code For FBL1N, And I've Done the same For 3N/5N...With Related BAPI
    *   IF SY-TCODE = 'FBL1N'.
    *    LOOP AT ct_items INTO gs_items.
    *      CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
    *        EXPORTING
    *          date      = gs_items-budat
    *          days      = '01'
    *          months    = '00'
    *          signum    = '-'
    *          years     = '00'
    *        IMPORTING
    *          calc_date = lv_date.
    *      CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
    *        EXPORTING
    *          companycode        = gs_items-bukrs
    *          vendor             = gs_items-konto
    *          keydate            = lv_date
    **   BALANCESPGLI       = ' '
    **   NOTEDITEMS         = ' '
    ** IMPORTING
    **   RETURN             =
    *        TABLES
    *          keybalance         =  lv_obal.
    *      CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
    *        EXPORTING
    *          companycode        = gs_items-bukrs
    *          vendor             = gs_items-konto
    *          keydate            = gs_items-budat
    **   BALANCESPGLI       = ' '
    **   NOTEDITEMS         = ' '
    ** IMPORTING
    **   RETURN             =
    *        TABLES
    *          keybalance         = lv_cbal
    *      READ TABLE lv_cbal INTO gs_cbal INDEX 1.
    *      gs_items-cbal = gs_cbal-lc_bal.
    *      READ TABLE lv_obal INTO gs_obal INDEX 1.
    *      gs_items-obal = gs_obal-lc_bal.
    *      MODIFY ct_items FROM gs_items TRANSPORTING obal cbal.
    *      CLEAR: gs_items,gs_obal,gs_cbal.
    *    ENDLOOP.
    *   ENDIF.
    So, Above Code Causing Me the Performance Issue, Kindly Suggest Me the Solution..
    Regards,
    uday.

    Hi Uday,
    I am sending you the code i used for the creation a Zreport based on FBL5N. Please check if it can of any help.
    *& Report  ZFBL5N                                                      *
    REPORT  zfbl5n_new  .
    TABLES : bsid,knc1,lfc1.
    TYPE-POOLS: slis.
    TYPES: BEGIN OF ty_bsid,
              bukrs TYPE bsid-bukrs,
              kunnr TYPE bsid-kunnr,
              belnr TYPE bsid-belnr,
              buzei TYPE bsid-buzei,
              bldat TYPE bsid-bldat,
              blart TYPE bsid-blart,
              bschl TYPE bsid-bschl,
              shkzg TYPE bsid-shkzg,
              dmbtr TYPE bsid-dmbtr,
              augdt TYPE bsid-augdt,
              augbl TYPE bsid-augbl,
              zuonr TYPE bsid-zuonr,
              sgtxt TYPE bsid-sgtxt,
              zfbdt TYPE bsid-zfbdt,
              zterm TYPE bsid-zterm,
              zbd1t TYPE bsid-zbd1t,
              zbd2t TYPE bsid-zbd2t,
              zbd3t TYPE bsid-zbd3t,
              kkber TYPE bsid-kkber,
              bstat TYPE bsid-bstat,
              umskz TYPE bsid-umskz,
            END OF ty_bsid.
    TYPES: BEGIN OF ty_bsik,
             bukrs TYPE bsik-bukrs,
              lifnr TYPE bsik-lifnr,
              belnr TYPE bsik-belnr,
              buzei TYPE bsik-buzei,
              bldat TYPE bsik-bldat,
              blart TYPE bsik-blart,
              bschl TYPE bsik-bschl,
              shkzg TYPE bsik-shkzg,
              dmbtr TYPE bsik-dmbtr,
              augdt TYPE bsik-augdt,
              augbl TYPE bsik-augbl,
              zuonr TYPE bsik-zuonr,
              sgtxt TYPE bsik-sgtxt,
               zfbdt TYPE bsik-zfbdt,
    *         KKBER TYPE bsik-kkber,
              zterm TYPE bsik-zterm,
               zbd1t TYPE bsik-zbd1t,
              zbd2t TYPE bsik-zbd2t,
              zbd3t TYPE bsik-zbd3t,
              bstat TYPE bsid-bstat,
              umskz TYPE bsid-umskz,
            END OF ty_bsik.
    TYPES: BEGIN OF ty_final,
              belnr TYPE bsid-belnr,
    *         buzei TYPE bsak-buzei,
              bldat TYPE bsid-bldat,
              blart TYPE bsid-blart,
              chq TYPE bsid-zuonr,
              debit TYPE bsid-dmbtr,
              credit TYPE bsid-dmbtr,
              txt TYPE bsid-sgtxt,
              date TYPE bsid-zfbdt,
              kkber TYPE bsid-kkber,
              zterm TYPE bsid-zterm,
              augbl TYPE bsid-augbl,
              augdt TYPE bsid-augdt,
              flag TYPE c,
            END OF ty_final.
    TYPES : BEGIN OF gs_openbal,
              bukrs TYPE bapi3007_2-comp_code,
              kunnr TYPE bapi3007_2-customer,
              dmbtr TYPE bapi3007_2-lc_amount,
             END OF gs_openbal.
    DATA: it_bsid TYPE STANDARD TABLE OF ty_bsid,
           it_bsik TYPE STANDARD TABLE OF ty_bsik,
           it_final TYPE STANDARD TABLE OF ty_final.
    DATA: wa_bsid TYPE ty_bsid,
           wa_bsik TYPE ty_bsik,
           wa_final TYPE ty_final.
    DATA: w_days TYPE t5a4a-dlydy,
           w_month TYPE t5a4a-dlymo,
           w_year TYPE t5a4a-dlyyr,
           w_date TYPE p0001-begda,
           w_name1 TYPE kna1-name1,
           w_ort01 TYPE kna1-ort01,
           w_lifnr TYPE kna1-lifnr,
           w_dmbtr1 TYPE bsid-dmbtr,
           w_dmbtr2 TYPE bsid-dmbtr,
           w_dmbtr3 TYPE bsad-dmbtr,
           w_dmbtr4 TYPE bsad-dmbtr,
           w_opbal TYPE bsid-dmbtr,
           w_credit TYPE bsik-dmbtr,
           w_debit TYPE bsik-dmbtr,
           w_clobal TYPE bsik-dmbtr,
           w_credit1 TYPE bsik-dmbtr,
           w_debit1 TYPE bsik-dmbtr,
           w_clobal1 TYPE bsik-dmbtr.
    DATA: ld_yrper LIKE rwcoom-fiscper,
           kunnr LIKE kna1-kunnr,
           x_norm TYPE c,
           x_park,
           x_apar,
           x_merk,
           ok_code(4),
           wa_x001 LIKE x001,
           return LIKE bapireturn,
           line_count LIKE sy-loopc,
           number_of_records TYPE i,
           xindex LIKE sy-tabix,
           open LIKE knc1-um01s,
           temp(20),
           close LIKE knc1-um01s,
           gjahr LIKE bsid-gjahr,
           period LIKE bkpf-monat,
           f(1),
           v_char(2),
           closec(20),
           openc(20),
           debit LIKE bapi3007_2-lc_amount,
           credit LIKE debit.
    DATA : v_dmbtr LIKE bsid-dmbtr.
    *DATA : tot_debit LIKE t_ar-debit,
    *       tot_credit LIKE t_ar-credit.
    DATA : t_kna1 LIKE kna1 OCCURS 1  WITH HEADER LINE,
            t_knb1 LIKE knb1 OCCURS 10 WITH HEADER LINE.
    DATA ibsid LIKE bsid OCCURS 0 WITH HEADER LINE.
    DATA ibsad LIKE bsad OCCURS 0 WITH HEADER LINE.
    DATA ibsik LIKE bsik OCCURS 0 WITH HEADER LINE.
    DATA ibsak LIKE bsak OCCURS 0 WITH HEADER LINE.
    DATA : it_fieldcat_alv   TYPE slis_t_fieldcat_alv,
            wa_fieldcat_alv     TYPE slis_fieldcat_alv,
            is_layout_alv  TYPE slis_layout_alv,
            wa_layout_alv  TYPE slis_layout_alv,
            it_list_top_of_page TYPE slis_t_listheader,
            it_events TYPE slis_t_event,
            wa_events TYPE LINE OF slis_t_event.
    DATA : BEGIN OF ibukrs OCCURS 0,
               bukrs LIKE t001-bukrs,
              END OF ibukrs.
    DATA : BEGIN OF ikunnr1 OCCURS 0,
              kunnr LIKE knc1-kunnr,
             END OF ikunnr1.
    DATA : BEGIN OF ikunnr OCCURS 0,
               kunnr LIKE knc1-kunnr,
               bukrs LIKE t001-bukrs,
               lifnr LIKE lfc1-lifnr,
              END OF ikunnr.
    DATA: it_sort TYPE slis_t_sortinfo_alv,
           wa_sort TYPE slis_sortinfo_alv.
    DATA:    r_bschl TYPE RANGE OF bschl,
              wa_bschl LIKE LINE OF r_bschl.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_kunnr TYPE bsid-kunnr OBLIGATORY,
                  p_bukrs TYPE bsid-bukrs OBLIGATORY.
    SELECT-OPTIONS: so_budat FOR bsid-budat .
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS : p_normal AS CHECKBOX,
                  p_spl    AS CHECKBOX,
                  p_vendor AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK b2.
    PERFORM get_data.
    PERFORM process_data.
    *PERFORM calculate_openbal. " Commented by anish
    PERFORM calculate_open_bal.
    PERFORM calculate_closing_bal.
    PERFORM build_catalog_sort USING it_sort.
    PERFORM reuse_alv_events_get .
    PERFORM display_data.
    *&      Form  GET_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_data .
       SELECT bukrs kunnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t kkber
         bstat umskz FROM bsid
         INTO TABLE it_bsid
         WHERE bukrs = p_bukrs
          AND kunnr = p_kunnr
          AND budat IN so_budat.
       SELECT bukrs kunnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t kkber
        bstat umskz FROM bsad
        APPENDING TABLE it_bsid
        WHERE bukrs = p_bukrs
         AND kunnr = p_kunnr
         AND budat IN so_budat.
       SELECT SINGLE name1 ort01 lifnr FROM kna1
         INTO (w_name1 , w_ort01 , w_lifnr)
         WHERE kunnr = p_kunnr.
       IF p_vendor IS NOT INITIAL.
         SELECT bukrs lifnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t
         bstat umskz   FROM bsik
         APPENDING TABLE it_bsik
         WHERE bukrs = p_bukrs
           AND lifnr = w_lifnr
           AND budat IN so_budat.
         SELECT bukrs lifnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t
         bstat umskz  FROM bsak
        APPENDING TABLE it_bsik
        WHERE bukrs = p_bukrs
          AND lifnr = w_lifnr
          AND budat IN so_budat.
       ENDIF.
       SORT it_bsid BY bschl.
       DELETE  it_bsid WHERE bschl = '04'.
       DELETE  it_bsid WHERE bschl = '07'.
       DELETE  it_bsid WHERE bschl = '17'.
       DELETE  it_bsid WHERE bschl = '34'.
       DELETE  it_bsid WHERE bschl = '27'.
       DELETE  it_bsid WHERE bschl = '37'.
       SORT it_bsik BY bschl.
       DELETE  it_bsik WHERE bschl = '04'.
       DELETE  it_bsik WHERE bschl = '07'.
       DELETE  it_bsik WHERE bschl = '17'.
       DELETE  it_bsik WHERE bschl = '34'.
       DELETE  it_bsik WHERE bschl = '27'.
       DELETE  it_bsik WHERE bschl = '37'.
    ENDFORM.                    " GET_DATA
    *&      Form  PROCESS_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM process_data .
       DATA:okay       TYPE c VALUE space.
       w_month = '00'.
       w_year = '00'.
       SORT it_bsid BY bldat .
       LOOP AT it_bsid INTO wa_bsid.
         PERFORM check_item_ok  USING p_normal
                                      p_spl
                                      p_vendor
    *                               x_park
                                      wa_bsid
                                CHANGING okay.
         CHECK okay = 'X'.
         wa_final-belnr = wa_bsid-belnr.
         wa_final-bldat = wa_bsid-bldat.
         wa_final-blart = wa_bsid-blart.
         wa_final-txt = wa_bsid-sgtxt.
         wa_final-kkber = wa_bsid-kkber.
         wa_final-zterm = wa_bsid-zterm.
         wa_final-augbl = wa_bsid-augbl.
         wa_final-augdt = wa_bsid-augdt.
         wa_final-flag = 'C'.
         IF wa_bsid-blart = 'DZ'.
           wa_final-chq = wa_bsid-zuonr.
         ENDIF.
         IF wa_bsid-shkzg = 'S'.
           wa_final-debit = wa_bsid-dmbtr.
         ELSEIF wa_bsid-shkzg = 'H'.
           wa_final-credit = wa_bsid-dmbtr.
         ENDIF.
         w_credit = w_credit + wa_final-credit.
         w_debit = w_debit + wa_final-debit.
    ****** Net due  date
         IF wa_bsid-zbd1t IS NOT INITIAL.
           w_days = wa_bsid-zbd1t.
         ELSEIF wa_bsid-zbd2t IS NOT INITIAL.
           w_days = wa_bsid-zbd2t.
         ELSEIF wa_bsid-zbd3t IS NOT INITIAL.
           w_days = wa_bsid-zbd3t.
         ENDIF.
         IF w_days IS INITIAL.
           wa_final-date = wa_bsid-zfbdt.
         ELSE.
           CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
             EXPORTING
               date      = wa_bsid-zfbdt
               days      = w_days
               months    = w_month
               signum    = '+'
               years     = w_year
             IMPORTING
               calc_date = w_date.
           wa_final-date = w_date.
         ENDIF.
         APPEND wa_final TO it_final.
         CLEAR: w_days , w_date , wa_final .
       ENDLOOP.
       IF it_bsik IS NOT INITIAL.
         CLEAR: w_days , w_date.
         SORT it_bsik BY bldat.
         LOOP AT it_bsik INTO wa_bsik.
           wa_final-belnr = wa_bsik-belnr.
           wa_final-bldat = wa_bsik-bldat.
           wa_final-blart = wa_bsik-blart.
           wa_final-txt = wa_bsik-sgtxt.
    *    wa_final-kkber = wa_bsik-kkber.
           wa_final-zterm = wa_bsik-zterm.
           wa_final-augbl = wa_bsik-augbl.
           wa_final-augdt = wa_bsik-augdt.
           wa_final-flag = 'V'.
           IF wa_bsik-blart = 'DZ'.
             wa_final-chq = wa_bsik-zuonr.
           ENDIF.
           IF wa_bsik-shkzg = 'S'.
             wa_final-debit = wa_bsik-dmbtr.
           ELSEIF wa_bsik-shkzg = 'H'.
             wa_final-credit = wa_bsik-dmbtr.
           ENDIF.
           w_credit1 = w_credit1 + wa_final-credit.
           w_debit1 = w_debit1 + wa_final-debit.
    *******  Net Due date
           IF wa_bsik-zbd1t IS NOT INITIAL.
             w_days = wa_bsik-zbd1t.
           ELSEIF wa_bsik-zbd2t IS NOT INITIAL.
             w_days = wa_bsik-zbd2t.
           ELSEIF wa_bsik-zbd3t IS NOT INITIAL.
             w_days = wa_bsik-zbd3t.
           ENDIF.
           IF w_days IS INITIAL.
             wa_final-date = wa_bsik-zfbdt.
           ELSE.
             CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
               EXPORTING
                 date      = wa_bsik-zfbdt
                 days      = w_days
                 months    = w_month
                 signum    = '+'
                 years     = w_year
               IMPORTING
                 calc_date = w_date.
           ENDIF.
           wa_final-date = w_date.
           APPEND wa_final TO it_final.
           CLEAR: wa_final.
         ENDLOOP.
       ENDIF.
    ENDFORM.                    " PROCESS_DATA
    *&      Form  DISPLAY_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM display_data .
       wa_fieldcat_alv-fieldname = 'BELNR'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-003.
       wa_fieldcat_alv-outputlen = '11'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'BLDAT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-004.
       wa_fieldcat_alv-outputlen = '13'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'BLART'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-005.
       wa_fieldcat_alv-outputlen = '02'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'CHQ'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-006.
       wa_fieldcat_alv-outputlen = '09'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'DEBIT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-007.
       wa_fieldcat_alv-outputlen = '15'.
       wa_fieldcat_alv-do_sum = 'X'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'CREDIT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-008.
       wa_fieldcat_alv-outputlen = '15'.
       wa_fieldcat_alv-do_sum = 'X'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'TXT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-009.
       wa_fieldcat_alv-outputlen = '50'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'DATE'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-010.
       wa_fieldcat_alv-outputlen = '12'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'KKBER'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-011.
       wa_fieldcat_alv-outputlen = '04'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'ZTERM'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-012.
       wa_fieldcat_alv-outputlen = '13'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'AUGBL'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-013.
       wa_fieldcat_alv-outputlen = '15'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'AUGDT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-014.
       wa_fieldcat_alv-outputlen = '17'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'FLAG'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-tech = 'X'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program             = sy-repid
          is_layout                      = wa_layout_alv
          it_fieldcat                    = it_fieldcat_alv
    *   IT_EXCLUDING                   =
    *   IT_SPECIAL_GROUPS              =
          it_sort                        = it_sort
          it_events                      = it_events
          i_save                            = 'A'
         TABLES
           t_outtab                       = it_final
        EXCEPTIONS
          program_error                  = 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.
    *  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    *    EXPORTING
    *      i_callback_program                = sy-repid
    *     i_callback_top_of_page            = 'TOP_OF_PAGE'
    *      is_layout                         = wa_layout_alv
    *      it_fieldcat                       = it_fieldcat_alv
    *      it_sort                           = it_sort
    ***   I_DEFAULT                         = 'X'
    **      i_save                            = 'A'
    ***   IT_EVENTS                         =
    *     TABLES
    *       t_outtab                          = it_final
    *    EXCEPTIONS
    *      program_error                     = 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.
    ENDFORM.                    " DISPLAY_DATA
    *&      Form  TOP_OF_PAGE
    *       Header at top of page.
    FORM top_of_page.
       SKIP 1.
       WRITE: AT 35 'Account Statement from' , so_budat-low , 'to' , so_budat-high.
       SKIP 2.
       WRITE: AT /5 'CUSTOMER:' , p_kunnr.
       WRITE: AT 35 'Name:' , w_name1.
       WRITE: AT /5 'Company:' , p_bukrs.
       WRITE: AT 35 'City:' , w_ort01.
       SKIP 1.
       WRITE: AT /5 'Opening Balance as on' , so_budat-low , '   ' ,  w_opbal LEFT-JUSTIFIED.
       SKIP 2.
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  END_OF_PAGE
    *       Footer at End of page.
    FORM end_of_page.
       SKIP 2.
       IF so_budat-high IS NOT INITIAL.
         WRITE: AT 5 'Closing Balance as on' , so_budat-high , '   ' ,  w_clobal LEFT-JUSTIFIED.
       ELSE.
         WRITE: AT 5 'Closing Balance  ' , w_clobal LEFT-JUSTIFIED.
       ENDIF.
    ENDFORM.                    "end_of_page
    *&      Form  CALCULATE_OPENBAL
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM calculate_openbal .
       DATA:v_gjahr       TYPE bsid-gjahr.
       DATA: v_period LIKE  t009b-poper,v_monat LIKE t001-periv.
       CALL FUNCTION 'FI_PERIOD_DETERMINE'
              EXPORTING
                   i_budat        = so_budat-low
                   i_bukrs        = p_bukrs
    *           I_PERIV        = ' '
    *           I_GJAHR        = 0000
    *           I_MONAT        = 00
    *           X_XMO16        = ' '
              IMPORTING
                   e_gjahr        = v_gjahr
    *            e_monat        = v_monat
                   e_poper        = v_period.
       IF sy-subrc NE 0.
       ENDIF.
       DATA: f_date LIKE sy-datum.
       CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
         EXPORTING
           i_gjahr  = v_gjahr
           i_monmit = 00
           i_periv  = 'V3'
           i_poper  = v_period
         IMPORTING
           e_date   = f_date.
       period = v_period - 1.
       gjahr = v_gjahr.
       DATA wa_kna1 LIKE kna1.
       CALL FUNCTION 'READ_KNA1'
         EXPORTING
           xkunnr         = p_kunnr
         IMPORTING
           xkna1          = wa_kna1
         EXCEPTIONS
           key_incomplete = 1
           not_authorized = 2
           not_found      = 3
           OTHERS         = 4.
       IF sy-subrc <> 0.
         MESSAGE w023(zwww).
         CALL SCREEN 0010.
       ENDIF.
       MOVE-CORRESPONDING wa_kna1 TO t_kna1.
       APPEND t_kna1.
       SELECT kunnr FROM kna1 INTO TABLE ikunnr1
         WHERE kunnr = p_kunnr.
       SELECT bukrs FROM t001 INTO TABLE ibukrs
        FOR ALL ENTRIES IN t_knb1
        WHERE bukrs = t_knb1-bukrs.
       LOOP AT ikunnr1.
         LOOP AT ibukrs.
           ikunnr-kunnr = ikunnr1-kunnr.
           ikunnr-bukrs = ibukrs-bukrs.
           READ TABLE t_kna1 WITH  KEY kunnr = ikunnr1-kunnr.
           ikunnr-lifnr = t_kna1-lifnr.
           APPEND ikunnr.
         ENDLOOP.
       ENDLOOP.
       DELETE ikunnr WHERE bukrs NE p_bukrs.
       LOOP AT ikunnr.
         CLEAR: knc1,lfc1,f.
         IF NOT ( ikunnr-kunnr IS INITIAL ) AND NOT ( p_vendor IS INITIAL ).
           SELECT SINGLE * FROM lfc1
                  WHERE gjahr = gjahr AND bukrs = ikunnr-bukrs
                                      AND lifnr = ikunnr-lifnr.
         ENDIF.
         SELECT SINGLE * FROM knc1
           WHERE gjahr = gjahr AND bukrs = p_bukrs
                 AND kunnr = p_kunnr.
         IF sy-subrc = 0.
           CASE period .
             WHEN 12.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
               knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h +
               knc1-um11s - knc1-um11h + knc1-um12s - knc1-um12h.
               IF NOT ( lfc1 IS INITIAL ).
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
                 lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h +
                 lfc1-um11s - lfc1-um11h + lfc1-um12s - lfc1-um12h.
               ENDIF.
             WHEN 11.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
               knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h +
               knc1-um11s - knc1-um11h.
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
                 lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h +
                 lfc1-um11s - lfc1-um11h.
               ENDIF.
             WHEN 10.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
               knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h .
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
                 lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h.
               ENDIF.
             WHEN 9.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
               knc1-um09s - knc1-um09h .
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
                 lfc1-um09s - lfc1-um09h.
               ENDIF.
             WHEN 8.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h.
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h .
               ENDIF.
             WHEN 7.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h .
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um

  • 7344 servo motion switching between open and closed loop operation

    I have a custom end-of-line test system presently using a 4-axis 7344 servo controller to perform various functional tests on small, brushed DC motors. The system is programmed in C/C++ and uses flex motion functions to control the motor during testing. Motors are coupled to external encoder feedback and third party PWM drives running in closed-loop torque mode from an analog command signal. The system uses all four motion axis channels on the 7344 board to independently and asynchronously test up to four production motors at a time.
    In closed-loop mode, the system runs without issue, satisfying the battery of testing protocols executed by this system. I now have a request to add additional test functionality to the system. This testing must be run in open loop mode. Specifically, I need to use my +/- 10v analog output command to my torque drive to send different DAC output levels to the connected motor.drive while monitoring response.
    I do not believe the flex motion library or 7344 controller includes functions to easily switch between open and closed loop mode without sending a new drive configuration. I am also under the impression that I cannot reconfigure one (or more) servo controller axis channels without disabling the entire drive. As my system runs each axis channel in an asynchronous manner, any requirement to shutdown all drives each time I change modes is an unworkable solution.
    I am open to all ideas that will allow asynchronous operation of my 4 motor testing stations. If the only solution is to add a second 7344 controller and mechanical relays to switch the drive and motor wiring between two separately configured servo channels, so be it. I just want to explore any available avenue before I place a price tag on this new system requirement.
    Bob

    Jochen,
    Thank you for the quick response. The 7344 board does an excellent job running my manufacturing motor assemblies through a custom end-of-line tester in closed loop mode. A portion of the performance history and test result couples the motor through a mechanical load and external shaft. The shaft is in contact with a linear encoder that closes my servo loop.
    My new manufacturing requirement is to also sample/document how the small DC motor behaves in open loop operation. Your solution is exactly what I need to perform the additional functional tests on the product I am manufacturing. I see no reason why this cannot work. I was originally concerned that I would need to reinitialize the 7344 board after changing axis configuration. Initialization is a global event and impacts all four channels on the 7344 board.
    Using flex_config_axis() to change axis configuration on a single channel without disturbing other potentially running axis channels will solve my concern. It will be several weeks before I can return to the manufacturing facility where the 7344-based testing machine is located. I will update this thread once I verify a successful result.
    Bob

  • Open and closed hand cursors

    I have a drag image application and I wanted to use the open and closed hand cursors to move the image about. It seems there is no easy way of accessing these in Java. After searching for cursor names etc.. I decided to hard code the cursors from the .gif image. Also I didn't want the .GIFs as files as this adds to loading problems so I ended up using arrays of pixels that took a little while to enter.
    I'm giving you the code if you ever need to use it as I typed it in and wouldn't want anyone else to have to do the same.
    int curWidth=32;
                   int curHeight=32;
                   int curCol;
                   Image img;
                   int x,y;
                   int closed_black[] = { 6,5,7,5,9,5,10,5,12,5,13,5,5,6,8,6,11,6,14,6,
                             15,6,5,7,14,7,16,7,6,8,16,8,5,9,6,9,16,9,4,10,
                             16,10,4,11,16,11,4,12,15,12,5,13,15,13,6,14,14,14,
                             7,15,14,15,7,16,14,16,0};
                   int closed_white[] = { 6,4,7,4,9,4,10,4,12,4,13,4,5,5,8,5,11,5,14,5,15,5,
                             4,6,6,6,7,6,9,6,10,6,12,6,13,6,16,6,4,7,15,7,17,7,
                             5,8,17,8,4,9,17,9,3,10,5,10,15,10,17,10,3,11,17,11,
                             3,12,16,12,4,13,16,13,5,14,15,14,6,15,15,15,6,16,
                             15,16,7,17,14,17,0};
                   int closed_whiteruns[] = {6,13,7,15,7,15,5,15,5,15,5,14,6,14,7,13,8,13,8,13,0};
                   int open_black[] = { 10,3,11,3,6,4,7,4,9,4,12,4,13,4,14,4,5,5,8,5,9,5,12,5,
                             15,5,5,6,8,6,9,6,12,6,15,6,17,6,6,7,9,7,12,7,15,7,16,7,18,7,
                             6,8,9,8,12,8,15,8,18,8,4,9,5,9,7,9,15,9,18,9,3,10,6,10,7,10,
                             18,10,3,11,7,11,17,11,4,12,17,12,5,13,17,13,5,14,16,14,6,15,
                             16,15,7,16,15,16,8,17,15,17,8,18,15,18,0};
                   int open_white[] = {10,2,11,2,6,3,7,3,9,3,12,3,13,3,5,4,8,4,10,4,11,4,15,4,
                             4,5,6,5,7,5,10,5,11,5,13,5,14,5,16,5,17,5,4,6,6,6,7,6,10,6,
                             11,6,13,6,14,6,16,6,18,6,5,7,7,7,8,7,10,7,11,7,13,7,14,7,17,7,
                             19,7,4,8,5,8,7,8,8,8,10,8,11,8,13,8,14,8,16,8,17,7,19,8,3,9,6,9,
                             16,9,17,9,19,9,2,10,4,10,5,10,19,10,2,11,18,11,3,12,18,12,4,13,
                             18,13,4,14,17,14,5,15,17,15,6,16,16,16,7,17,18,17,7,18,16,18,
                             8,19,15,19,0};
                   int open_whiteruns[] = {9,14,8,17,4,16,5,16,6,16,6,15,7,15,8,14,9,14,9,14,0};                    
                   int pix[] = new int[curWidth*curHeight];
                   for(y=0; y<=curHeight; y++) for(x=0; x<=curWidth; x++) pix[y+x]=0; // all points transparent
                   // black pixels
                   curCol=Color.black.getRGB();
                   int n=0;
                   while(closed_black[n]!=0)
                        pix[closed_black[n++]+closed_black[n++]*curWidth]=curCol;
                   // white pixels
                   curCol=Color.white.getRGB();
                   n=0;
                   while(closed_white[n]!=0)
                        pix[closed_white[n++]+closed_white[n++]*curWidth]=curCol;
                   // white pixel runs
                   n=0;
                   y=7;
                   while(closed_whiteruns[n]!=0) {
                        for(x=closed_whiteruns[n++];x<closed_whiteruns[n];x++)
                             pix[x+y*curWidth]=curCol;
                        n++; y++;
                   img = createImage(new MemoryImageSource(curWidth,curHeight,pix,0,curWidth));
                   closedhandCursor = Toolkit.getDefaultToolkit().createCustomCursor(img,new Point(5,5),"closedhand");
                   for(y=0; y<=curHeight; y++) for(x=0; x<=curWidth; x++) pix[y+x]=0; // all points transparent
                   // black pixels
                   curCol=Color.black.getRGB();
                   n=0;
                   while(open_black[n]!=0)
                        pix[open_black[n++]+open_black[n++]*curWidth]=curCol;
                   // white pixels
                   curCol=Color.white.getRGB();
                   n=0;
                   while(open_white[n]!=0)
                        pix[open_white[n++]+open_white[n++]*curWidth]=curCol;
                   // white pixel runs
                   n=0;
                   y=9;
                   while(open_whiteruns[n]!=0) {
                        for(x=open_whiteruns[n++];x<open_whiteruns[n];x++)
                             pix[x+y*curWidth]=curCol;
                        n++; y++;
                   img = createImage(new MemoryImageSource(curWidth,curHeight,pix,0,curWidth));
                   openhandCursor = Toolkit.getDefaultToolkit().createCustomCursor(img,new Point(5,5),"openhand");
                   setCursor(openhandCursor);you need to define openhandCursor and closedhandCursor with your other cursor definitions (I made them default to start with) and then just use setcursor as normal. There must be an easier way to do this!
    p.s. thanks to Martin Zvarik for the original code here: http://www.jguru.com/faq/view.jsp?EID=9958

    Hi,
    you can use the same query...Also check the new code after the select..
    SELECT BUKRS BELNR GJAHR <b>BSTAT</b>
    FROM BKPF
    INTO TABLE T_BKPF
    WHERE BUKRS = P_BUKRS
    AND BSTAT IN ( ' ' , 'A' ) " ' ' - Normal document, A - Parked doc
    AND BLART = P_BLART
    AND CPUDT IN SO_CPUDT " Selection screen input.
    IF NOT T_BKPF[] IS INITIAL.
    SELECT BUKRS BELNR GJAHR BUZEI EBELN AUGBL AUGBT
    INTO TABLE T_BSEG
    FOR ALL ENTRIES IN T_BKPF
    WHERE BUKRS = T_BKPF-BUKRS
    AND BELNR = T_BKPF-BELNR
    AND GJAHR = T_BKPF-GJAHR
    AND EBELN IN SO_EBELN " selection-screen input
    ENDIF.
    LOOP AT T_BKPF.
    Parked
      IF T_BKPF-BSTAT = 'A'.
        WRITE: / T_BKPF-BELNR , ' - Parked'.
    process the next record.
        CONTINUE.
      ENDIF.
    Check for Open / Closed.
      LOOP AT T_BSEG WHERE BELNR = T_BKPF-BELNR
                                   AND      BUKRS = T_BKPF-BUKRS
                                   AND      GJAHR = T_BKPF-GJAHR
                                   AND      AUGBL <> ' '.
        EXIT.
      ENDLOOP.
    If the return code is 0 then the document is cleared..
      IF sy-subrc = 0.
        WRITE: / T_BKPF-BELNR , ' - Closed'.
    Else the document is not cleared.
      ELSE.
        WRITE: / T_BKPF-BELNR , ' - Open'.
      ENDIF.
    ENDLOOP.
    Thanks,
    Naren

  • Open and closed cursor

    I have some doubts/questions .
    What is the difference between open and closed cursor?
    Are library cache locks same as parse locks?
    What is the difference between latch and mutex?
    I would be grateful if experts could answer these questions.
    Regards

    Almost correct. The terminology is however nor correct.
    Simplistically:
    The SQL engine receives a SQL. It attempts a soft parse first. This means looking for an existing cursor in the Shared Pool with the same SQL. This existing cursor can be in use by other sessions. It does not matter - if that cursor is in used (opend by other sessions), or not. It may not be in use at all and simply sitting there in the cache. If such a cursor is found, it is used for that session's SQL - and that session gets a cursor handle (reference/pointer) to that existing cursor.
    If the SQL engine does not find an existing cursor to use, it needs to create a brand new cursor in the Shared Pool. This is a hard parse. Again, the session receives a cursor handle for that new cursor created.
    And that is it.
    You now need to decide how to use that cursor handle. The cursor itself is a program. You have a handle to execute that cursor program. Via its bind interface you can input data to this cursor program. Then execute it and receive (fetch) output of that cursor program.
    So the ideal is to re-use the cursor handle again and again.
    Basic example: the following is not optimal as the same cursor is opened and closed, opened and closed, for each read from the file. A lot of soft parsing results.
    while not-eof( filehandle )   // read data from a file
      read file data into var1, var2
      open cursor for 'insert into testtab values( :1, :2)'   // create a cursor
      bind cursor :1 = var, :2 = var2  // bind values to cursor (for insert)
      exec cursor // do SQL insert
      close cursor 
    end whileThis is a lot better. A single cursor is used and executed again and again:
    open cursor for 'insert into testtab values( :1, :2)'   // create a cursor
    while not-eof( filehandle )   // read data from a file
      read file data into var1, var2
      bind cursor :1 = var, :2 = var2  // bind values to cursor (for insert)
      exec cursor // do SQL insert
    end while
    close cursor  In this case a single soft/hard parse - and the client uses that cursor handle to execute that cursor (insert data) program again and again.

  • Opening and Closing balance in FBL3N?

    Hi All,
    In other ERP systems, if you browse GL Account, i.e. FBL3N in SAP, you get the list of documents within specified period but in other systems you also get the OPENING balance as well as CLOSING balance and the current postings are in between them. Is there any standard report or report painter is to be used for such requirement.
    Balances can be checked through FS10N and S_ALR_87012301 etc. but requirement is to get the list of documents with opening and closing balance in beginning and end of the report. The best example is of Cash Journal (Txn FBCJ)
    Thanks

    Thank you Will,
    Yes, actually if other system provide such functionality then SAP should be providing that. I searched within table TSTC for such transaction but unable to get. Accountants requirement is when they execute FBL3N within specified period, the cummulative opening balance and closing balance should be provided with report.
    Thanks for your answer!
    Regards,
    Nayab

  • GL a/c opening and closing balances

    Hi All,
    Below is my selection screen:
    select-options : s_bukrs for bkpf-bukrs obligatory.
    parameter      :  p_gjahr like bkpf-gjahr obligatory.
    select-options : s_budat for bkpf-budat,
                           s_monat for bkpf-monat,
                           s_hkont for bseg-hkont.
    I am displaying the data from tables BKPF, BSEG, KNA1-NAME1, LFA1-NAME1, SKAT-TXT50. I have to fetch Opening and Closing balances for GL a/c's. I am fetching data from table GLT0-HSLVT(opening balance). But unable to get the data for closing balance based on the period given on the selection screen. In my report I am looping on table it_bseg to populate the final internal table. How to get the closing balances's total based on the input.
    Please help me.
    Thanks,
    Haritha

    Hello Haritha,
                        Try this code by building a function module. This would cover both opening and closing balance.
    FUNCTION ZGL_OPENING_CLOSING_BAL_KEYDAT.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(COMP) TYPE  BKPF-BUKRS
    *"     REFERENCE(DATE) TYPE  BKPF-BUDAT
    *"     REFERENCE(ACCT) TYPE  BSEG-HKONT
    *"  EXPORTING
    *"     REFERENCE(BALANCE) TYPE  BSEG-DMBTR
    DATA : COMPANYCODEID  LIKE  BAPI0002_2-COMP_CODE     ,
    POSTING_DATE   LIKE  BAPI0002_4-POSTING_DATE  ,
    FISCAL_YEAR    LIKE  BAPI0002_4-FISCAL_YEAR   ,
    FISCAL_PERIOD  LIKE  BAPI0002_4-FISCAL_PERIOD .
    DATA : ACCOUNT_BALANCES  TYPE TABLE OF BAPI3006_4 WITH HEADER LINE.
    DATA : BAL TYPE BSEG-DMBTR.
    DATA : IV_DATE  TYPE  D   ,
    EV_MONTH_BEGIN_DATE  TYPE  D,
    EV_MONTH_END_DATE  TYPE  D .
    DATA : COMPANYCODE  LIKE  BAPI3006_0-COMP_CODE,
    GLACCT  LIKE  BAPI3006_0-GL_ACCOUNT ,
    FISCALYEAR  LIKE  BAPI3006_4-FISC_YEAR,
    CURRENCYTYPE  LIKE  BAPI3006_5-CURR_TYPE VALUE 10.
    DATA : IT_BKPF TYPE TABLE OF BKPF WITH HEADER LINE.
    DATA : BEGIN OF IT_BSEG OCCURS 0,
    BELNR TYPE BSEG-BELNR,
    GJAHR TYPE BSEG-GJAHR,
    SHKZG TYPE BSEG-SHKZG  ,
    DMBTR TYPE BSEG-DMBTR,
    END OF IT_BSEG.
    COMPANYCODEID = COMP.
    POSTING_DATE = DATE.
    IV_DATE  = DATE.
    CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
    EXPORTING
    IV_DATE             = IV_DATE
    IMPORTING
    EV_MONTH_BEGIN_DATE = EV_MONTH_BEGIN_DATE
    EV_MONTH_END_DATE   = EV_MONTH_END_DATE.
    CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
    EXPORTING
    COMPANYCODEID = COMPANYCODEID
    POSTING_DATE  = POSTING_DATE
    IMPORTING
    FISCAL_YEAR   = FISCAL_YEAR
    FISCAL_PERIOD = FISCAL_PERIOD.
    IF EV_MONTH_END_DATE NE DATE.
    IF FISCAL_PERIOD = 1.
    FISCAL_PERIOD = 12              .
    FISCAL_YEAR = FISCAL_YEAR - 1  .
    ELSE.
    FISCAL_PERIOD =  FISCAL_PERIOD - 1.
    ENDIF.
    ENDIF.
    COMPANYCODE  =  COMP.
    GLACCT  = ACCT.
    FISCALYEAR  = FISCAL_YEAR.
    CALL FUNCTION 'BAPI_GL_ACC_GETPERIODBALANCES'
    EXPORTING
    COMPANYCODE      = COMPANYCODE
    GLACCT           = GLACCT
    FISCALYEAR       = FISCALYEAR
    CURRENCYTYPE     = CURRENCYTYPE
    TABLES
    ACCOUNT_BALANCES = ACCOUNT_BALANCES.
    READ TABLE ACCOUNT_BALANCES  WITH KEY FISC_YEAR = FISCALYEAR FIS_PERIOD = FISCAL_PERIOD.
    IF SY-SUBRC = 0.
    BALANCE =  ACCOUNT_BALANCES-BALANCE.
    ENDIF.
    IF EV_MONTH_END_DATE NE DATE.
    SELECT * FROM BKPF INTO TABLE IT_BKPF WHERE BUKRS = COMP AND BUDAT >= EV_MONTH_BEGIN_DATE
    AND BUDAT <= DATE.
    IF IT_BKPF[] IS NOT INITIAL.
    SELECT BELNR GJAHR SHKZG DMBTR
    FROM BSEG INTO CORRESPONDING FIELDS OF TABLE IT_BSEG
    FOR ALL ENTRIES IN IT_BKPF
    WHERE BELNR = IT_BKPF-BELNR AND GJAHR = IT_BKPF-GJAHR AND HKONT = ACCT AND BUKRS = COMP.
    ENDIF.
    LOOP AT IT_BSEG.
    IF IT_BSEG-SHKZG = 'H'.
    BAL = BAL - IT_BSEG-DMBTR.
    ELSEIF IT_BSEG-SHKZG = 'S'.
    BAL = BAL + IT_BSEG-DMBTR.
    ENDIF.
    ENDLOOP.
    BALANCE = BALANCE + BAL.
    ENDIF.
    ENDFUNCTION.
    Raghav

  • Customer Statement with opening and closing balances

    Dear Forum,
    The users want to generate the Customer Statement with opening and closing balances like the traditional one. The statement now generated gives the list of all open items as on date, but the users want the statement with opening balances as on the date of the begining of the range specified and the closing balance at the end of the period for which the statement is generated. Is there a way to generate the same from the system.
    Thanks for the help.
    Regards,

    Hi,
    SPRO> Financial Accounting (New) > Accounts Receivable and Accounts Payable > Customer Accounts > Line Items > Correspondence > Make and Check Settings for Correspondence
    You can use the program RFKORD10 with correspondance type SAP06 for your company code
    This program prints account statements and open items lists for customers and vendors in letter form. For account statements, all postings between two key dates, as well as the opening and closing balance, are listed.
    Regards,
    Gaurav

  • Connection/ResultSets/Prepared Statement opening and closing

    Hi all another question that was sparked by a thread that I recently read. I believe it was duffmo who got the code from jverd. The code I am referring to is to have an open and close connection specified in a Utility or Database class. I wanted to know if there was any issues with having methods that open and close connections/result sets/ preparedStatements. Currently I am putting the finally blocks inside each of my methods. There is obvious benefits to putting the methods in a class on their own (namely code re-use) but I wanted to know if there are any dangers. (This may seem like a dumb question, but I've found from experience it's the things that you don't know that will cost you loads of time).
    thanks again.

    Hi all another question that was sparked by athread
    that I recently read. I believe it was duffmo who
    got the code from jverd. Generally speaking it's fine.
    But as always you may have some long term design
    issues to think about. If you build a simple
    framework that consists of one class and that does
    all that your program does then great.
    Once you start add more complexity though you'll want
    to be careful that you aren't reinventing the Spring
    wheel or even ending up implementing your own
    connection pool. Both of which, judging from posts
    here seem to happen from time to time.
    So I guess all in all, yes it's much better than
    scattering the code all about but depending on what
    you are going to be doing with it you may want to
    look at the various ORM frameworks to see if they are
    really the direction you should be going in.Thanks for the information cotton. I just wanted to make certain that it was a sensible thing to do. When I had first asked about connections I was told they should be opened an closed in the same spot, unfortunately I took that explanation a little too much to heart, and started opening and closing every connection resultset and prepared statement in each of the DAO classes that I was using.
    Guess it's going to be a bit of work to refactor, but worth it for the cleaner code that will result.

  • Opening and Closing Balances -SAP

    Hi experts
    please explain me about the Opening and Closing Balance in SAP? and what is the use of Opening and closing Balance?
    regards
    anand

    Hi Ananda
    opening balance : when  ever u run any financial report for example a  ledger profit and loss account then it has a opening balance and a closing balance
    say for example if we see the balance of our cash account in sap at end of the day today then we can consider the balance as x amount as closing balance and when again tomorrow there is some transaction in the same account than this x Amount is considered as the opening balance for tomorrows date
    Hope this would suffice your Concern
    Regards,
    Manish

  • Opening and closing periods in FI

    Dear FICO experts,
    Just a quick question regarding OB52.
    We have only 1 company code, can we use the same posting period variant in mulitple line items for the combination ALL account types and a range of periods that are open?
    Posting period variant:0000
    Account Type: +
    Period from: 1
    Year:2001
    Period to: 12
    Year: 2011
    Posting period variant:0001 (continue making new posting period variants for all account types as needed)
    Account Type: +
    Period from: 1
    Year:2012
    Period to: 12
    Year: 2012
    OR
    Do we just adjust the one line item: example below
    Posting period variant:0000
    Account Type: +
    Period from: 1
    Year:2001
    Period to: 12
    Year: 2011 (keep ajdusting this one line item whenever we need to open new periods for all account types)
    Thanks, Deb
    Moderator: Company code is assigned to one variant; so the question is irrelevant

    Hi,
    The Posting Period Variant is just defined once and is not year dependent.
    The second option that you maintained is the way how the Posting Periods are maintained.
    Against the Same Posting period variant, you can have your open and closed periods and years maintained year after year.
    Generally, you keep only 1 period in a year open, the current period, and at the most 2-3 periods in some cases, and that you can easily maintain in Range.
    Hope this clarifies..
    Regards,
    SAPFICO

Maybe you are looking for

  • Windows 8 problem with pdf files

    will this version work with windows 8?

  • ADF panelGroup component's background image in CSS does not render

    Hi, I have an issue with the panelGroup component, where a background-image specified in the styleClass DOES NOT RENDER when deployed on the OAS. It works fine when I run the page on my local OC4J. I've verified that the image I use is deployed corre

  • 8530 doesn't connect to MacBook Pro

    When I connect my BB8530 to my MacBook,  Blackberry desktop manager doesn't see it. It seems to be the same whether connecting via bluetooth or by USB Cable. Any suggestions? I've tried a hard reboot

  • For Mac OSX version 10.9.4 looking for the preference tab

    I want to print just a portion of a page but can't find a preference tab. I highlight a section of a page so I can print just that section but I am unable to find a preference tab, I have a HP 6600 all in one and have a new Mac version 10.9.4 Mac OSX

  • Minimal brightness too high on x220

    After installing Windows 8 x64 and latest video drivers from Lenovo, the minimal brightness became much higher then it was in Windows 7. Now at "0" value brightness is the same that it was on "3" or "4" in Win7. Is there any way to fix it?