Display account balances for vendor PO's and GRPO's

In the BP Master, there is a display for customers of the account balance, open orders, deliveries, and opportunities.  But for vendors there is only an account balance.  There should be a similar display for open PO's and GRPO's.

Hello Marcia,
Maybe you can have a try with Drag&Relate function then use Filter to just include Open PO/GRPO only, the total amount will be displayed at the bottom of Drag&Relate result window.
Howeve this is not as convenient as the open balance field directly showed on BP Master Data field.
Regards,
Canna Mu

Similar Messages

  • Check GL(Bank) account balance for banks and stop payment if sufficient

    Hi Experts
    Requirement is to check GL account balance for bank account and check whether enough balance exists for effecting payments. In the absence of insufficient bank balance, payment should not be effected. Balance needs to be check either manual cheque payment or automatic payment program.
    Please provide best solution.
    Regards

    Hi,
    Requirement is very clear,
    this is critical requirement, normal situation nobady update values in Available amount every day in FBZP
    If you want to impliment this reqirement, discuss with technical person (ABAPer) to impliment BADI functionality.
    As a functional consultant you have to tell the technical person,
    1 - Create Z internal maintanance table. for house bank & Company code againest available amount.
    2 - During payment (FB01,F-53,F-48,F-58 & F110) system need to Compare table Vendor open Item (BSIK) and Z teble balances, if Z table balance is less than table (BSIK) value system stop the process else system process for payment.
    for better clarification discuss with technical expert.
    Regards,
    Viswa

  • Auth Group for Accounting Doc and Account authorization for  Vendors

    Hi guys,
    I have question regarding Accounting Doc for Vendor and G/l Account.  I have a security client whree I build my business roles for end user but we we configuration client where all the functional focus wokring and doing configuration.  My questiion when I start creating business roles  and start going  into these authorization objects and filling up the field values (F_BKPF_BEK, F_BKPF_BES,  F_BKPF_BLA).
    I won't  see auth group that will be c reated by functional  cocus because they are working on configuration Client and they probably create auth group for above authorization objects in Config lcient and I'm building Roles in my security client. 
    If it is true what would be the best way to create business role.  I'm in realization face of the project  Should I build my roles in Config client?   Please advise.
    Thanks in advance
    Faisal

    What is the benefit of a "security client" in DEV? I don't get it...
    You anyway need to protect the namespace... and the authorizations for role development (SU24) and admin (PFCG).
    Anyway, you have closed your question so we can only lick our wounds now
    Cheers and good luck on your project (let is know how it goes if you stick around for long enough to experience a release upgrade...
    Julius

  • GL balance for vendor is greater than vendor balance

    Hi,
    I have an intercompany Account. The GL Balance (FS10N) of the intercompany account is greater than the Vendor Balance(Intercompany balance FK10N). Kindly let me know, how should I check the line items in GL Balance. Double clicking the balance cannot display line item.
    Quick reply will be appreciated.
    Thanks & Regards

    Hi
    Inter-company GL account is a reconciliation account and it can be the same GL account for multiple Vendors. Please check the balances of all the inter-company vendors in the company code that has this reconciliation account. You can a list of all such vendors from table LFB1 and Field AKONT (recon Account).
    If there is still an imbalance then please look up for the closing balance for the previous period and the opening balance of the current period in FS10n. There is a slim possibility that items were posted to this account after rolling forward the balance.
    regards

  • Hi, I want to know that standard tables for vendor analasys report and sale

    Hi, I want to know that standard reports for vendor analasys report and sale order and customer order report...? why most probably we use tables and fetch the fields rather than standard reports >

    Hi
    This is the sample report for vendor aging:
    Std reports Tcodes are:
    customer : s_alr_87012178
    vendor : s_alr_87012084
    Custom designed:
    REPORT zfi_customer_ageing
    NO STANDARD PAGE HEADING
    LINE-COUNT 58
    line-size 168
    MESSAGE-ID zh_msg.
    D A T A B A S E T A B L E S D E C L A R A T I O N
    TABLES: kna1, " Customer Master (General)
    t001, " Company Codes
    rfpdo.
    I N T E R N A L T A B L E S D E C L A R A T I O N S *
    Internal Table for Customer Open Items Data
    DATA: BEGIN OF int_bsid OCCURS 0,
    kunnr LIKE bsid-kunnr, " Customer Number
    name1 LIKE kna1-name1, " Customer Name
    shkzg LIKE bsid-shkzg, " Dr/Cr Indicator
    belnr LIKE bsid-belnr, " Document Number
    xblnr LIKE bsid-xblnr, " Ref Doc No
    blart LIKE bsid-blart, " Document Type
    zfbdt LIKE bsid-zfbdt, " Base Line Date
    zbd1t LIKE bsid-zbd1t, " Due date1
    zbd2t LIKE bsid-zbd2t, " Due Date2
    zbd3t LIKE bsid-zbd3t, " Due Date3
    waers LIKE bsid-waers, " Currency
    dmbtr LIKE bsid-dmbtr, " Amount in Local Curr
    END OF int_bsid.
    Internal Table for Amounts Sum Up Data
    DATA: BEGIN OF int_final OCCURS 0,
    kunnr LIKE bsid-kunnr, " Customer Number
    name1 LIKE kna1-name1, " Customer Name
    total1 LIKE bsid-dmbtr, " Amount in Local Curr
    total2 LIKE bsid-dmbtr, " Amount in Local Curr
    total3 LIKE bsid-dmbtr, " Amount in Local Curr
    total4 LIKE bsid-dmbtr, " Amount in Local Curr
    total5 LIKE bsid-dmbtr, " Amount in Local Curr
    total6 LIKE bsid-dmbtr, " Amount in Local Curr
    total LIKE bsid-dmbtr, " Amount in Local Curr
    END OF int_final.
    D A T A D E C L A R A T I O N S
    DATA : v_flag, " Flag
    v_gtotal1 LIKE bsid-dmbtr, " Amount Totals
    v_gtotal2 LIKE bsid-dmbtr, " Amount Totals
    v_gtotal3 LIKE bsid-dmbtr, " Amount Totals
    v_gtotal4 LIKE bsid-dmbtr, " Amount Totals
    v_gtotal5 LIKE bsid-dmbtr, " Amount Totals
    v_gtotal6 LIKE bsid-dmbtr, " Amount Totals
    v_gtotal LIKE bsid-dmbtr, " Amount Totals
    v_subtotal1 LIKE bsid-dmbtr, " Amount Totals
    v_subtotal2 LIKE bsid-dmbtr, " Amount Totals
    v_subtotal3 LIKE bsid-dmbtr, " Amount Totals
    v_subtotal4 LIKE bsid-dmbtr, " Amount Totals
    v_subtotal5 LIKE bsid-dmbtr, " Amount Totals
    v_subtotal6 LIKE bsid-dmbtr, " Amount Totals
    v_subtotal LIKE bsid-dmbtr, " Amount Totals
    v_date LIKE bsid-zfbdt, " Due Date
    v_tage1(4), " Age 30 days
    v_tage2(4), " Age 60 days
    v_tage3(4), " Age 90 days
    v_fir(15), " Column Text1
    v_sec(15), " Column Text2
    v_thir(15), " Column Text3
    v_four(17), " Column Text4
    v_fidd(4), " Days field1
    v_sedd(4), " Days field2
    v_thdd(4), " Days field3
    v_fodd(4), " Days field4
    v_str TYPE SY-LISEL, " String
    v_str1(11), " String
    v_tage(3), " String
    v_date1(10). " Date field
    R A N G E D E C L A R A T I O N S
    RANGES: r_date1 FOR bsid-zfbdt, " Date Range 1
    r_date2 FOR bsid-zfbdt, " Date Range 2
    r_date3 FOR bsid-zfbdt, " Date Range 3
    r_date4 FOR bsid-zfbdt. " Date Range 4
    S E L E C T I O N S C R E E N *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_kunnr FOR kna1-kunnr. "Customer account
    PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
    "Open items at key date
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
    p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
    p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
    p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
    SELECTION-SCREEN END OF BLOCK b3.
    A T S E L E C T I O N S C R E E N *
    AT SELECTION-SCREEN.
    Validate the screen fields
    PERFORM validate_flds.
    S T A R T O F S E L E C T I O N *
    START-OF-SELECTION.
    Fetch main data
    PERFORM fetch_data.
    T O P O F P A G E
    Header
    TOP-OF-PAGE.
    PERFORM header.
    E N D O F P A G E
    Footer
    END-OF-PAGE.
    ULINE.
    T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
    Top of Page in Secondary List
    TOP-OF-PAGE DURING LINE-SELECTION.
    PERFORM header1.
    A T L I N E S E L E C T I O N *
    AT LINE-SELECTION.
    Perform Line Selections
    PERFORM line_selection.
    E N D O F S E L E C T I O N
    END-OF-SELECTION.
    List generation
    PERFORM basic_list.
    *& Form validate_flds
    Validation of Selection Screen fields
    FORM validate_flds .
    Validate Customer Code
    CLEAR kna1-kunnr.
    SELECT kunnr UP TO 1 ROWS
    INTO kna1-kunnr
    FROM kna1
    WHERE kunnr IN s_kunnr AND
    spras = sy-langu.
    ENDSELECT.
    IF sy-subrc <> 0.
    MESSAGE e000 WITH 'Invalid Customer Code range'(023).
    ENDIF.
    Validate Company Code
    CLEAR t001-bukrs.
    SELECT bukrs UP TO 1 ROWS
    INTO t001-bukrs
    FROM t001
    WHERE bukrs = p_bukrs AND
    spras = sy-langu.
    ENDSELECT.
    IF sy-subrc <> 0.
    MESSAGE e021. " Invalid Company Code range
    ENDIF.
    IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
    ( p_tage1 > p_tage4 ).
    MESSAGE e999 WITH 'Column 1 greater'(004)
    'than Column# 2 or 3 or 4'(005).
    ENDIF.
    *column 2
    IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
    MESSAGE e999 WITH 'Column 2 greater'(006)
    'than Column# 3 or 4'(007).
    ENDIF.
    *column3
    IF ( p_tage3 > p_tage4 ).
    MESSAGE e999 WITH 'Column 3 greater'(008)
    'than Column#4'(009).
    ENDIF.
    ENDFORM. " validate_flds
    *& Form fetch_data
    Fetching Data from Database Tables
    FORM fetch_data .
    Date Range Population
    r_date1-sign = 'I'.
    r_date1-option = 'BT'.
    r_date1-low = p_allgst.
    r_date1-high = r_date1-low + p_tage1.
    APPEND r_date1.
    r_date2-sign = 'I'.
    r_date2-option = 'BT'.
    r_date2-low = r_date1-high + 1.
    r_date2-high = r_date1-low + p_tage2.
    APPEND r_date2.
    r_date3-sign = 'I'.
    r_date3-option = 'BT'.
    r_date3-low = r_date2-high + 1.
    r_date3-high = r_date1-low + p_tage3.
    APPEND r_date3.
    r_date4-sign = 'I'.
    r_date4-option = 'BT'.
    r_date4-low = r_date3-high + 1.
    r_date4-high = r_date1-low + p_tage4.
    APPEND r_date4.
    Select the Customer Open Items data from bsid
    SELECT l~kunnr
    l1~name1
    b~waers
    b~dmbtr
    b~zfbdt
    b~zbd1t
    b~zbd2t
    b~zbd3t
    b~belnr
    b~xblnr
    b~shkzg
    b~blart
    INTO CORRESPONDING FIELDS OF TABLE int_bsid
    FROM knb1 AS l INNER JOIN kna1 AS l1
    ON lkunnr = l1kunnr
    INNER JOIN bsid AS b
    ON lkunnr = bkunnr AND
    lbukrs = bbukrs
    WHERE l~kunnr IN s_kunnr AND
    l~bukrs = p_bukrs and
    b~zfbdt le p_allgst.
    IF SY-SUBRC <> 0.
    MESSAGE i000 WITH 'No Data found'(027).
    ENDIF.
    Removing the date limit to get the due items in the past
    DELETE int_bsid WHERE
    ( blart NE 'RE' AND blart NE 'KR' ) OR
    shkzg NE 'H'.
    SORT int_bsid BY kunnr.
    ENDFORM. " fetch_data
    *& Form header
    Display the Report Columns
    FORM header .
    v_tage1 = p_tage1 + 1.
    v_tage2 = p_tage2 + 1.
    v_tage3 = p_tage3 + 1.
    v_fidd = p_tage1.
    v_sedd = p_tage2.
    v_thdd = p_tage3.
    v_fodd = p_tage4.
    MOVE v_fodd0(4) TO v_fodd1(3).
    v_fodd+0(1) = space.
    CONCATENATE '1 to'(010) v_fidd INTO v_fir.
    CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
    CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
    CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
    Standard header
    clear: v_date1, v_str, v_str1, v_tage.
    write p_allgst to v_date1.
    Move p_tage4 to v_tage.
    concatenate '>' v_tage text-025 into v_str1.
    concatenate
    'Summary of Ageing Analysis for Customer Open Invoices as on'(013)
    v_date1 into v_str separated by space.
    CALL FUNCTION 'Z_STANDARD_HEADER'
    EXPORTING
    title1 = 'Saudi International Petrochemical Company'(012)
    title2 = v_str.
    FORMAT COLOR OFF.
    WRITE : /1(168) sy-uline.
    FORMAT COLOR 1 INTENSIFIED.
    WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
    50(101) 'Invoices Due For(In Days)'(014) CENTERED,
    151 sy-vline, 168 sy-vline .
    WRITE :/1 sy-vline, 2(11) 'Customer#'(015) CENTERED,
    13 sy-vline ,14(35) 'Customer Name'(016) CENTERED,
    49 sy-vline,
    50(101) sy-uline,151 sy-vline,
    152(16) 'Total'(017) CENTERED,
    168 sy-vline.
    WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
    50(16) v_fir CENTERED, 66 sy-vline,
    67(16) v_sec CENTERED, 83 sy-vline,
    84(16) v_thir CENTERED, 100 sy-vline,
    101(16) v_four CENTERED, 117 sy-vline,
    118(16) v_str1 centered, 134 sy-vline,
    135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
    168 sy-vline.
    FORMAT COLOR OFF.
    WRITE : /1(168) sy-uline.
    ENDFORM. " header
    *& Form basic_list
    Display the Basic List
    FORM basic_list .
    NEW-PAGE LINE-SIZE 168.
    LOOP AT int_bsid.
    CLEAR v_date.
    IF int_bsid-zbd3t <> ' '.
    v_date = int_bsid-zfbdt + int_bsid-zbd3t.
    ELSE.
    IF int_bsid-zbd2t <> ' '.
    v_date = int_bsid-zfbdt + int_bsid-zbd2t.
    ELSE.
    v_date = int_bsid-zfbdt + int_bsid-zbd1t.
    ENDIF.
    ENDIF.
    IF int_bsid-zbd1t = ' '.
    v_date = int_bsid-zfbdt.
    ENDIF.
    IF v_date IN r_date1.
    int_final-total1 = int_final-total1 + int_bsid-dmbtr.
    ELSEIF v_date IN r_date2.
    int_final-total2 = int_final-total2 + int_bsid-dmbtr.
    ELSEIF v_date IN r_date3.
    int_final-total3 = int_final-total3 + int_bsid-dmbtr.
    ELSEIF v_date IN r_date4.
    int_final-total4 = int_final-total4 + int_bsid-dmbtr.
    ELSEif v_date > r_date4-high.
    int_final-total5 = int_final-total5 + int_bsid-dmbtr.
    ELSEif v_date < p_allgst.
    int_final-total6 = int_final-total6 + int_bsid-dmbtr.
    ENDIF.
    AT END OF kunnr.
    v_flag = 1.
    ENDAT.
    IF v_flag = 1.
    int_final-kunnr = int_bsid-kunnr.
    int_final-name1 = int_bsid-name1.
    int_final-total = int_final-total1 + int_final-total2 +
    int_final-total3 + int_final-total4 + int_final-total5 +
    int_final-total6.
    APPEND int_final.
    v_gtotal1 = v_gtotal1 + int_final-total1.
    v_gtotal2 = v_gtotal2 + int_final-total2.
    v_gtotal3 = v_gtotal3 + int_final-total3.
    v_gtotal4 = v_gtotal4 + int_final-total4.
    v_gtotal5 = v_gtotal5 + int_final-total5.
    v_gtotal6 = v_gtotal6 + int_final-total6.
    v_gtotal = v_gtotal + int_final-total.
    WRITE: /1 sy-vline,
    2 int_final-kunnr COLOR 4 INTENSIFIED ON,
    13 sy-vline,
    14 int_final-name1 COLOR 4 INTENSIFIED ON,
    49 sy-vline.
    DATA : v_rem.
    v_rem = sy-tabix MOD 2.
    IF v_rem NE 0.
    FORMAT COLOR 2 INTENSIFIED.
    WRITE : 50 int_final-total1 CURRENCY int_bsid-waers,
    66 sy-vline,
    67 int_final-total2 CURRENCY int_bsid-waers,
    83 sy-vline,
    84 int_final-total3 CURRENCY int_bsid-waers,
    100 sy-vline,
    101 int_final-total4 CURRENCY int_bsid-waers,
    117 sy-vline,
    118 int_final-total5 CURRENCY int_bsid-waers,
    134 sy-vline,
    135 int_final-total6 CURRENCY int_bsid-waers,
    151 sy-vline,
    152 int_final-total CURRENCY int_bsid-waers,
    168 sy-vline.
    ELSE.
    WRITE : 50 int_final-total1 CURRENCY int_bsid-waers,
    66 sy-vline,
    67 int_final-total2 CURRENCY int_bsid-waers,
    83 sy-vline,
    84 int_final-total3 CURRENCY int_bsid-waers,
    100 sy-vline,
    101 int_final-total4 CURRENCY int_bsid-waers,
    117 sy-vline,
    118 int_final-total5 CURRENCY int_bsid-waers,
    134 sy-vline,
    135 int_final-total6 CURRENCY int_bsid-waers,
    151 sy-vline,
    152 int_final-total CURRENCY int_bsid-waers,
    168 sy-vline.
    ENDIF.
    FORMAT COLOR OFF.
    HIDE int_final.
    CLEAR int_final.
    v_flag = 0.
    ENDIF.
    AT LAST.
    WRITE : /1(168) sy-uline.
    FORMAT COLOR 3 INTENSIFIED.
    WRITE : /1 sy-vline, 2(47) 'GRAND TOTAL'(022) CENTERED,
    49 sy-vline, 50 v_gtotal1 CURRENCY int_bsid-waers,
    66 sy-vline, 67 v_gtotal2 CURRENCY int_bsid-waers,
    83 sy-vline, 84 v_gtotal3 CURRENCY int_bsid-waers,
    100 sy-vline,101 v_gtotal4 CURRENCY int_bsid-waers,
    117 sy-vline,118 v_gtotal5 CURRENCY int_bsid-waers,
    134 sy-vline,135 v_gtotal6 CURRENCY int_bsid-waers,
    151 sy-vline,152 v_gtotal CURRENCY int_bsid-waers,
    168 sy-vline.
    HIDE : v_gtotal1,
    v_gtotal2,
    v_gtotal3,
    v_gtotal4,
    v_gtotal5,
    v_gtotal6,
    v_gtotal.
    ENDAT.
    FORMAT COLOR OFF.
    ENDLOOP.
    WRITE : /1(168) sy-uline.
    ENDFORM. " basic_list
    *& Form line_selection
    When double clicked on the line display the seconday list
    FORM line_selection .
    NEW-PAGE LINE-SIZE 206.
    Sy-lsind = 1.
    DATA : v_rem,v_cnt LIKE sy-tabix.
    v_cnt = 0.
    SORT int_bsid BY belnr zfbdt.
    LOOP AT int_bsid WHERE kunnr EQ int_final-kunnr.
    v_rem = v_cnt MOD 2.
    CLEAR v_date.
    IF int_bsid-zbd3t <> ' '.
    v_date = int_bsid-zfbdt + int_bsid-zbd3t.
    ELSE.
    IF int_bsid-zbd2t <> ' '.
    v_date = int_bsid-zfbdt + int_bsid-zbd2t.
    ELSE.
    v_date = int_bsid-zfbdt + int_bsid-zbd1t.
    ENDIF.
    ENDIF.
    IF int_bsid-zbd1t = ' '.
    v_date = int_bsid-zfbdt.
    ENDIF.
    IF v_rem NE 0.
    format color 2 intensified.
    WRITE :/1 sy-vline, 2 int_bsid-belnr,
    12 sy-vline,13 int_bsid-kunnr,
    23 sy-vline,24 int_bsid-name1,
    59 sy-vline,60 int_bsid-xblnr,
    76 sy-vline,77 int_bsid-zfbdt,
    87 sy-vline.
    WRITE : 104 sy-vline,121 sy-vline,
    138 sy-vline,155 sy-vline,
    172 sy-vline, 189 sy-vline,
    190 int_bsid-dmbtr CURRENCY int_bsid-waers,
    206 sy-vline.
    IF v_date IN r_date1.
    v_subtotal1 = v_subtotal1 + int_bsid-dmbtr.
    WRITE : 88 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEIF v_date IN r_date2.
    v_subtotal2 = v_subtotal2 + int_bsid-dmbtr.
    WRITE : 105 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEIF v_date IN r_date3.
    v_subtotal3 = v_subtotal3 + int_bsid-dmbtr.
    WRITE : 122 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEIF v_date IN r_date4.
    v_subtotal4 = v_subtotal4 + int_bsid-dmbtr.
    WRITE : 139 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEif v_date > r_date4-high.
    v_subtotal5 = v_subtotal5 + int_bsid-dmbtr.
    WRITE : 156 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEif v_date < p_allgst.
    v_subtotal6 = v_subtotal6 + int_bsid-dmbtr.
    WRITE : 173 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ENDIF.
    format color off.
    ELSE.
    WRITE :/1 sy-vline, 2 int_bsid-belnr,
    12 sy-vline,13 int_bsid-kunnr,
    23 sy-vline,24 int_bsid-name1,
    59 sy-vline,60 int_bsid-xblnr,
    76 sy-vline,77 int_bsid-zfbdt,
    87 sy-vline.
    WRITE : 104 sy-vline,121 sy-vline,
    138 sy-vline,155 sy-vline,
    172 sy-vline,189 sy-vline,
    190 int_bsid-dmbtr CURRENCY int_bsid-waers,
    206 sy-vline.
    IF v_date IN r_date1.
    v_subtotal1 = v_subtotal1 + int_bsid-dmbtr.
    WRITE : 88 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEIF v_date IN r_date2.
    v_subtotal2 = v_subtotal2 + int_bsid-dmbtr.
    WRITE : 105 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEIF v_date IN r_date3.
    v_subtotal3 = v_subtotal3 + int_bsid-dmbtr.
    WRITE : 122 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEIF v_date IN r_date4.
    v_subtotal4 = v_subtotal4 + int_bsid-dmbtr.
    WRITE : 139 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEif v_date > r_date4-high.
    v_subtotal5 = v_subtotal5 + int_bsid-dmbtr.
    WRITE : 156 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ELSEif v_date < p_allgst.
    v_subtotal6 = v_subtotal6 + int_bsid-dmbtr.
    WRITE : 173 int_bsid-dmbtr CURRENCY int_bsid-waers.
    ENDIF.
    ENDIF.
    FORMAT COLOR OFF.
    v_cnt = v_cnt + 1.
    ENDLOOP.
    WRITE : /1(206) sy-uline.
    v_subtotal = v_subtotal1 + v_subtotal2 + v_subtotal3
    + v_subtotal4 + v_subtotal5 + v_subtotal6.
    FORMAT COLOR 3 INTENSIFIED.
    WRITE : /1 sy-vline,
    2(85) 'Total'(017) CENTERED CURRENCY int_bsid-waers ,
    87 sy-vline,
    88 v_subtotal1 CURRENCY int_bsid-waers,
    104 sy-vline,
    105 v_subtotal2 CURRENCY int_bsid-waers,
    121 sy-vline,
    122 v_subtotal3 CURRENCY int_bsid-waers,
    138 sy-vline,
    139 v_subtotal4 CURRENCY int_bsid-waers,
    155 sy-vline,
    156 v_subtotal5 CURRENCY int_bsid-waers,
    172 sy-vline,
    173 v_subtotal6 CURRENCY int_bsid-waers,
    189 sy-vline,
    190 v_subtotal CURRENCY int_bsid-waers,
    206 sy-vline.
    FORMAT COLOR OFF.
    WRITE : /1(206) sy-uline.
    CLEAR : v_subtotal,v_subtotal1,v_subtotal2,v_subtotal3,
    v_subtotal4,v_subtotal5,v_gtotal1,v_gtotal2,v_gtotal3,
    v_gtotal4, v_gtotal5,v_gtotal,v_subtotal6,v_gtotal6.
    ENDFORM. " line_selection
    *& Form header1
    Secondary List Header
    FORM header1 .
    Standard header
    clear: v_date1, v_str, v_str1, v_tage.
    write p_allgst to v_date1.
    Move p_tage4 to v_tage.
    concatenate '>' v_tage text-025 into v_str1.
    concatenate
    'Details of Ageing Analysis for Customer Open Invoices as on'(024)
    v_date1 into v_str separated by space.
    CALL FUNCTION 'Z_STANDARD_HEADER'
    EXPORTING
    title1 = 'Saudi International Petrochemical Company'(012)
    title2 = v_str.
    FORMAT COLOR 1 intensified.
    WRITE :/1(206) sy-uline.
    WRITE :/1 sy-vline,12 sy-vline ,
    23 sy-vline,59 sy-vline,76 sy-vline,87 sy-vline,
    88(101) 'Invoices Due For(In Days)'(014) CENTERED,
    189 sy-vline,206 sy-vline.
    WRITE : /1 sy-vline, 2(10) 'Doc Number'(021) CENTERED,
    12 sy-vline, 13(10) 'Customer#'(015) CENTERED,
    23 sy-vline, 24(35) 'Customer Name'(016) CENTERED,
    59 sy-vline, 60(16) 'Ref invoice#'(019) CENTERED,
    76 sy-vline, 77(10) 'Inv dt'(020) CENTERED,
    87 sy-vline, 88(101) sy-uline,
    189 sy-vline,190(16) 'Total'(017) CENTERED,
    206 sy-vline.
    WRITE : /1 sy-vline, 12 sy-vline,
    23 sy-vline,59 sy-vline,
    76 sy-vline,87 sy-vline,
    88(16) v_fir CENTERED, 104 sy-vline,
    105(16) v_sec CENTERED, 121 sy-vline,
    122(16) v_thir CENTERED, 138 sy-vline,
    139(16) v_four CENTERED, 155 sy-vline,
    156(16) v_str1 CENTERED,
    172 sy-vline,
    173(16) 'Already Overdue'(018) CENTERED,
    189 sy-vline,
    206 sy-vline.
    format color off.
    WRITE : /1(206) sy-uline.
    ENDFORM. " header1
    REPORT zfi_vendor_ageing
    NO STANDARD PAGE HEADING
    LINE-COUNT 58
    line-size 168
    MESSAGE-ID zh_msg.
    Report Name : Vendor Open Items Ageing Report
    Purpose : This report displays the Vendor Open Items based on
    different Ageing days (Calculated by taking the Base
    Line date and the days mentioned in Payment Terms)
    M O D I F I C A T I O N L O G
    Date | Change Number | Initials | Description
    30-Aug-2004 | DTSK900**** | Anji Reddy | Initial
    D A T A B A S E T A B L E S D E C L A R A T I O N
    TABLES: lfa1, " Vendor Master (General)
    t001, " Company Codes
    rfpdo.
    I N T E R N A L T A B L E S D E C L A R A T I O N S *
    Internal Table for Vendor Open Items Data
    DATA: BEGIN OF int_bsik OCCURS 0,
    lifnr LIKE bsik-lifnr, " Vendor Number
    name1 LIKE lfa1-name1, " Vendor Name
    shkzg LIKE bsik-shkzg, " Dr/Cr Indicator
    belnr LIKE bsik-belnr, " Document Number
    xblnr LIKE bsik-xblnr, " Ref Doc No
    blart LIKE bsik-blart, " Document Type
    zfbdt LIKE bsik-zfbdt, " Base Line Date
    zbd1t LIKE bsik-zbd1t, " Due date1
    zbd2t LIKE bsik-zbd2t, " Due Date2
    zbd3t LIKE bsik-zbd3t, " Due Date3
    waers LIKE bsik-waers, " Currency
    dmbtr LIKE bsik-dmbtr, " Amount in Local Curr
    END OF int_bsik.
    Internal Table for Amounts Sum Up Data
    DATA: BEGIN OF int_final OCCURS 0,
    lifnr LIKE bsik-lifnr, " Vendor Number
    name1 LIKE lfa1-name1, " Vendor Name
    total1 LIKE bsik-dmbtr, " Amount in Local Curr
    total2 LIKE bsik-dmbtr, " Amount in Local Curr
    total3 LIKE bsik-dmbtr, " Amount in Local Curr
    total4 LIKE bsik-dmbtr, " Amount in Local Curr
    total5 LIKE bsik-dmbtr, " Amount in Local Curr
    total6 LIKE bsik-dmbtr, " Amount in Local Curr
    total LIKE bsik-dmbtr, " Amount in Local Curr
    END OF int_final.
    D A T A D E C L A R A T I O N S
    DATA : v_flag, " Flag
    v_gtotal1 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal2 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal3 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal4 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal5 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal6 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal LIKE bsik-dmbtr, " Amount Totals
    v_subtotal1 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal2 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal3 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal4 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal5 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal6 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal LIKE bsik-dmbtr, " Amount Totals
    v_date LIKE bsik-zfbdt, " Due Date
    v_tage1(4), " Age 30 days
    v_tage2(4), " Age 60 days
    v_tage3(4), " Age 90 days
    v_fir(15), " Column Text1
    v_sec(15), " Column Text2
    v_thir(15), " Column Text3
    v_four(17), " Column Text4
    v_fidd(4), " Days field1
    v_sedd(4), " Days field2
    v_thdd(4), " Days field3
    v_fodd(4), " Days field4
    v_str TYPE SY-LISEL, " String
    v_str1(11), " String
    v_tage(3), " String
    v_date1(10). " Date field
    R A N G E D E C L A R A T I O N S
    RANGES: r_date1 FOR bsik-zfbdt, " Date Range 1
    r_date2 FOR bsik-zfbdt, " Date Range 2
    r_date3 FOR bsik-zfbdt, " Date Range 3
    r_date4 FOR bsik-zfbdt. " Date Range 4
    S E L E C T I O N S C R E E N *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr. "Vendor account
    PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
    "Open items at key date
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
    p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
    p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
    p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
    SELECTION-SCREEN END OF BLOCK b3.
    A T S E L E C T I O N S C R E E N *
    AT SELECTION-SCREEN.
    Validate the screen fields
    PERFORM validate_flds.
    S T A R T O F S E L E C T I O N *
    START-OF-SELECTION.
    Fetch main data
    PERFORM fetch_data.
    T O P O F P A G E
    Header
    TOP-OF-PAGE.
    PERFORM header.
    E N D O F P A G E
    Footer
    END-OF-PAGE.
    ULINE.
    T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
    Top of Page in Secondary List
    TOP-OF-PAGE DURING LINE-SELECTION.
    PERFORM header1.
    A T L I N E S E L E C T I O N *
    AT LINE-SELECTION.
    Perform Line Selections
    PERFORM line_selection.
    E N D O F S E L E C T I O N
    END-OF-SELECTION.
    List generation
    PERFORM basic_list.
    *& Form validate_flds
    Validation of Selection Screen fields
    FORM validate_flds .
    Validate Vendor Code
    CLEAR lfa1-lifnr.
    SELECT lifnr UP TO 1 ROWS
    INTO lfa1-lifnr
    FROM lfa1
    WHERE lifnr IN s_lifnr AND
    spras = sy-langu.
    ENDSELECT.
    IF sy-subrc <> 0.
    MESSAGE e000 WITH 'Invalid Vendor Code range'(023).
    ENDIF.
    Validate Company Code
    CLEAR t001-bukrs.
    SELECT bukrs UP TO 1 ROWS
    INTO t001-bukrs
    FROM t001
    WHERE bukrs = p_bukrs AND
    spras = sy-langu.
    ENDSELECT.
    IF sy-subrc <> 0.
    MESSAGE e021. " Invalid Company Code range
    ENDIF.
    IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
    ( p_tage1 > p_tage4 ).
    MESSAGE e999 WITH 'Column 1 greater'(004)
    'than Column# 2 or 3 or 4'(005).
    ENDIF.
    *column 2
    IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
    MESSAGE e999 WITH 'Column 2 greater'(006)
    'than Column# 3 or 4'(007).
    ENDIF.
    *column3
    IF ( p_tage3 > p_tage4 ).
    MESSAGE e999 WITH 'Column 3 greater'(008)
    'than Column#4'(009).
    ENDIF.
    ENDFORM. " validate_flds
    *& Form fetch_data
    Fetching Data from Database Tables
    FORM fetch_data .
    Date Range Population
    r_date1-sign = 'I'.
    r_date1-option = 'BT'.
    r_date1-low = p_allgst.
    r_date1-high = r_date1-low + p_tage1.
    APPEND r_date1.
    r_date2-sign = 'I'.
    r_date2-option = 'BT'.
    r_date2-low = r_date1-high + 1.
    r_date2-high = r_date1-low + p_tage2.
    APPEND r_date2.
    r_date3-sign = 'I'.
    r_date3-option = 'BT'.
    r_date3-low = r_date2-high + 1.
    r_date3-high = r_date1-low + p_tage3.
    APPEND r_date3.
    r_date4-sign = 'I'.
    r_date4-option = 'BT'.
    r_date4-low = r_date3-high + 1.
    r_date4-high = r_date1-low + p_tage4.
    APPEND r_date4.
    Select the Vendor Open Items data from BSIK
    SELECT l~lifnr
    l1~name1
    b~waers
    b~dmbtr
    b~zfbdt
    b~zbd1t
    b~zbd2t
    b~zbd3t
    b~belnr
    b~xblnr
    b~shkzg
    b~blart
    INTO CORRESPONDING FIELDS OF TABLE int_bsik
    FROM lfb1 AS l INNER JOIN lfa1 AS l1
    ON llifnr = l1lifnr
    INNER JOIN bsik AS b
    ON llifnr = blifnr AND
    lbukrs = bbukrs
    WHERE l~lifnr IN s_lifnr AND
    l~bukrs = p_bukrs and
    b~zfbdt le p_allgst.
    IF SY-SUBRC <> 0.
    MESSAGE i000 WITH 'No Data found'(027).
    ENDIF.
    Removing the date limit to get the due items in the past
    DELETE int_bsik WHERE
    ( blart NE 'RE' AND blart NE 'KR' ) OR
    shkzg NE 'H'.
    SORT int_bsik BY lifnr.
    ENDFORM. " fetch_data
    *& Form header
    Display the Report Columns
    FORM header .
    v_tage1 = p_tage1 + 1.
    v_tage2 = p_tage2 + 1.
    v_tage3 = p_tage3 + 1.
    v_fidd = p_tage1.
    v_sedd = p_tage2.
    v_thdd = p_tage3.
    v_fodd = p_tage4.
    MOVE v_fodd0(4) TO v_fodd1(3).
    v_fodd+0(1) = space.
    CONCATENATE '1 to'(010) v_fidd INTO v_fir.
    CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
    CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
    CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
    Standard header
    clear: v_date1, v_str, v_str1, v_tage.
    write p_allgst to v_date1.
    Move p_tage4 to v_tage.
    concatenate '>' v_tage text-025 into v_str1.
    concatenate
    'Summary of Ageing Analysis for Vendor Open Invoices as on'(013)
    v_date1 into v_str separated by space.
    CALL FUNCTION 'Z_STANDARD_HEADER'
    EXPORTING
    title1 = 'Saudi International Petrochemical Company'(012)
    title2 = v_str.
    FORMAT COLOR OFF.
    WRITE : /1(168) sy-uline.
    FORMAT COLOR 1 INTENSIFIED.
    WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
    50(101) 'Invoices Due For(In Days)'(014) CENTERED,
    151 sy-vline, 168 sy-vline .
    WRITE :/1 sy-vline, 2(11) 'Vendor#'(015) CENTERED,
    13 sy-vline ,14(35) 'Vendor Name'(016) CENTERED,
    49 sy-vline,
    50(101) sy-uline,151 sy-vline,
    152(16) 'Total'(017) CENTERED,
    168 sy-vline.
    WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
    50(16) v_fir CENTERED, 66 sy-vline,
    67(16) v_sec CENTERED, 83 sy-vline,
    84(16) v_thir CENTERED, 100 sy-vline,
    101(16) v_four CENTERED, 117 sy-vline,
    118(16) v_str1 centered, 134 sy-vline,
    135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
    168 sy-vline.
    FORMAT COLOR OFF.
    WRITE : /1(168) sy-uline.
    ENDFORM. " header
    *& Form basic_list
    Display the Basic List
    FORM basic_list .
    NEW-PAGE LINE-SIZE 168.
    LOOP AT int_bsik.
    CLEAR v_date.
    IF int_bsik-zbd3t <> ' '.
    v_date = int_bsik-zfbdt + int_bsik-zbd3t.
    ELSE.
    IF int_bsik-zbd2t <> ' '.
    v_date = int_bsik-zfbdt + int_bsik-zbd2t.
    ELSE.
    v_date = int_bsik-zfbdt + int_bsik-zbd1t.
    ENDIF.
    ENDIF.
    IF int_bsik-zbd1t = ' '.
    v_date = int_bsik-zfbdt.
    ENDIF.
    IF v_date IN r_date1.
    int_final-total1 = int_final-total1 + int_bsik-dmbtr.
    ELSEIF v_date IN r_date2.
    int_final-total2 = int_final-total2 + int_bsik-dmbtr.
    ELSEIF v_date IN r_date3.
    int_final-total3 = int_final-total3 + int_bsik-dmbtr.
    ELSEIF v_date IN r_date4.
    int_final-total4 = int_final-total4 + int_bsik-dmbtr.
    ELSEif v_date > r_date4-high.
    int_final-total5 = int_final-total5 + int_bsik-dmbtr.
    ELSEif v_date < p_allgst.
    int_final-total6 = int_final-total6 + int_bsik-dmbtr.
    ENDIF.
    AT END OF lifnr.
    v_flag = 1.
    ENDAT.
    IF v_flag = 1.
    int_final-lifnr = int_bsik-lifnr.
    int_final-name1 = int_bsik-name1.
    int_final-total = int_final-total1 + int_final-total2 +
    int_final-total3 + int_final-total4 + int_final-total5 +
    int_final-total6.
    APPEND int_final.
    v_gtotal1 = v_gtotal1 + int_final-total1.
    v_gtotal2 = v_gtotal2 + int_final-total2.
    v_gtotal3 = v_gtotal3 + int_final-total3.
    v_gtotal4 = v_gtotal4 + int_final-total4.
    v_gtotal5 = v_gtotal5 + int_final-total5.
    v_gtotal6 = v_gtotal6 + int_final-total6.
    v_gtotal = v_gtotal + int_final-total.
    WRITE: /1 sy-vline,
    2 int_final-lifnr COLOR 4 INTENSIFIED ON,
    13 sy-vline,
    14 int_final-name1 COLOR 4 INTENSIFIED ON,
    49 sy-vline.
    DATA : v_rem.
    v_rem = sy-tabix MOD 2.
    IF v_rem NE 0.
    FORMAT COLOR 2 INTENSIFIED.
    WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
    66 sy-vline,
    67 int_final-total2 CURRENCY int_bsik-waers,
    83 sy-vline,
    84 int_final-total3 CURRENCY int_bsik-waers,
    100 sy-vline,
    101 int_final-total4 CURRENCY int_bsik-waers,
    117 sy-vline,
    118 int_final-total5 CURRENCY int_bsik-waers,
    134 sy-vline,
    135 int_final-total6 CURRENCY int_bsik-waers,
    151 sy-vline,
    152 int_final-total CURRENCY int_bsik-waers,
    168 sy-vline.
    ELSE.
    WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
    66 sy-vline,
    67 int_final-total2 CURRENCY int_bsik-waers,
    83 sy-vline,
    84 int_final-total3 CURRENCY int_bsik-waers,
    100 sy-vline,
    101 int_final-total4 CURRENCY int_bsik-waers,
    117 sy-vline,
    118 int_final-total5 CURRENCY int_bsik-waers,
    134 sy-vline,
    135 int_final-total6 CURRENCY int_bsik-waers,
    151 sy-vline,
    152 int_final-total CURRENCY int_bsik-waers,
    168 sy-vline.
    ENDIF.
    FORMAT COLOR OFF.
    HIDE int_final.
    CLEAR int_final.
    v_flag = 0.
    ENDIF.
    AT LAST.
    WRITE : /1(168) sy-uline.
    FORMAT COLOR 3 INTENSIFIED.
    WRITE : /1 sy-vline, 2(47) 'GRAND TOTAL'(022) CENTERED,
    49 sy-vline, 50 v_gtotal1 CURRENCY int_bsik-waers,
    66 sy-vline, 67 v_gtotal2 CURRENCY int_bsik-waers,
    83 sy-vline, 84 v_gtotal3 CURRENCY int_bsik-waers,
    100 sy-vline,101 v_gtotal4 CURRENCY int_bsik-waers,
    117 sy-vline,118 v_gtotal5 CURRENCY int_bsik-waers,
    134 sy-vline,135 v_gtotal6 CURRENCY int_bsik-waers,
    151 sy-vline,152 v_gtotal CURRENCY int_bsik-waers,
    168 sy-vline.
    HIDE : v_gtotal1,
    v_gtotal2,
    v_gtotal3,
    v_gtotal4,
    v_gtotal5,
    v_gtotal6,
    v_gtotal.
    ENDAT.
    FORMAT COLOR OFF.
    ENDLOOP.
    WRITE : /1(168) sy-uline.
    ENDFORM. " basic_list
    *& Form line_selection
    When double clicked on the line display the seconday list
    FORM line_selection .
    NEW-PAGE LINE-SIZE 206.
    Sy-lsind = 1.
    DATA : v_rem,v_cnt LIKE sy-tabix.
    v_cnt = 0.
    SORT int_bsik BY belnr zfbdt.
    LOOP AT int_bsik WHERE lifnr EQ int_final-lifnr.
    v_rem = v_cnt MOD 2.
    CLEAR v_date.
    IF int_bsik-zbd3t <> ' '.
    v_date = int_bsik-zfbdt + int_bsik-zbd3t.
    ELSE.
    IF int_bsik-zbd2t <> ' '.
    v_date = int_bsik-zfbdt + int_bsik-zbd2t.
    ELSE.
    v_date = int_bsik-zfbdt + int_bsik-zbd1t.
    ENDIF.
    ENDIF.
    IF int_bsik-zbd1t = ' '.
    v_date = int_bsik-zfbdt.
    ENDIF.
    IF v_rem NE 0.
    format color 2 intensified.
    WRITE :/1 sy-vline, 2 int_bsik-belnr,
    12 sy-vline,13 int_bsik-lifnr,
    23 sy-vline,24 int_bsik-name1,
    59 sy-vline,60 int_bsik-xblnr,
    76 sy-vline,77 int_bsik-zfbdt,
    87 sy-vline.
    WRITE : 104 sy-vline,121 sy-vline,
    138 sy-vline,155 sy-vline,
    172 sy-vline, 189 sy-vline,
    190 int_bsik-dmbtr CURRENCY int_bsik-waers,
    206 sy-vline.
    IF v_date IN r_date1.
    v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
    WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEIF v_date IN r_date2.
    v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
    WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEIF v_date IN r_date3.
    v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
    WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEIF v_date IN r_date4.
    v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
    WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEif v_date > r_date4-high.
    v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
    WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEif v_date < p_allgst.
    v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
    WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ENDIF.
    format color off.
    ELSE.
    WRITE :/1 sy-vline, 2 int_bsik-belnr,
    12 sy-vline,13 int_bsik-lifnr,
    23 sy-vline,24 int_bsik-name1,
    59 sy-vline,60 int_bsik-xblnr,
    76 sy-vline,77 int_bsik-zfbdt,
    87 sy-vline.
    WRITE : 104 sy-vline,121 sy-vline,
    138 sy-vline,155 sy-vline,
    172 sy-vline,189 sy-vline,
    190 int_bsik-dmbtr CURRENCY int_bsik-waers,
    206 sy-vline.
    IF v_date IN r_date1.
    v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
    WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEIF v_date IN r_date2.
    v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
    WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEIF v_date IN r_date3.
    v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
    WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEIF v_date IN r_date4.
    v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
    WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEif v_date > r_date4-high.
    v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
    WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ELSEif v_date < p_allgst.
    v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
    WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
    ENDIF.
    ENDIF.
    FORMAT COLOR OFF.
    v_cnt = v_cnt + 1.
    ENDLOOP.
    WRITE : /1(206) sy-uline.
    v_subtotal = v_subtotal1 + v_subtotal2 + v_subtotal3
    + v_subtotal4 + v_subtotal5 + v_subtotal6.
    FORMAT COLOR 3 INTENSIFIED.
    WRITE : /1 sy-vline,
    2(85) 'Total'(017) CENTERED CURRENCY int_bsik-waers ,
    87 sy-vline,
    88 v_subtotal1 CURRENCY int_bsik-waers,
    104 sy-vline,
    105 v_subtotal2 CURRENCY int_bsik-waers,
    121 sy-vline,
    122 v_subtotal3 CURRENCY int_bsik-waers,
    138 sy-vline,
    139 v_subtotal4 CURRENCY int_bsik-waers,
    155 sy-vline,
    156 v_subtotal5 CURRENCY int_bsik-waers,
    172 sy-vline,
    173 v_subtotal6 CURRENCY int_bsik-waers,
    189 sy-vline,
    190 v_subtotal CURRENCY int_bsik-waers,
    206 sy-vline.
    FORMAT COLOR OFF.
    WRITE : /1(206) sy-uline.
    CLEAR : v_subtotal,v_subtotal1,v_subtotal2,v_subtotal3,
    v_subtotal4,v_subtotal5,v_gtotal1,v_gtotal2,v_gtotal3,
    v_gtotal4, v_gtotal5,v_gtotal,v_subtotal6,v_gtotal6.
    ENDFORM. " line_selection
    *& Form header1
    Secondary List Header
    FORM header1 .
    Standard header
    clear: v_date1, v_str, v_str1, v_tage.
    write p_allgst to v_date1.
    Move p_tage4 to v_tage.
    concatenate '>' v_tage text-025 into v_str1.
    concatenate
    'Details of Ageing Analysis for Vendor Open Invoices as on'(024)
    v_date1 into v_str separated by space.
    CALL FUNCTION 'Z_STANDARD_HEADER'
    EXPORTING
    title1 = 'Saudi International Petrochemical Company'(012)
    title2 = v_str.
    FORMAT COLOR 1 intensified.
    WRITE :/1(206) sy-uline.
    WRITE :/1 sy-vline,12 sy-vline ,
    23 sy-vline,59 sy-vline,76 sy-vline,87 sy-vline,
    88(101) 'Invoices Due For(In Days)'(014) CENTERED,
    189 sy-vline,206 sy-vline.
    WRITE : /1 sy-vline, 2(10) 'Doc Number'(021) CENTERED,
    12 sy-vline, 13(10) 'Vendor#'(015) CENTERED,
    23 sy-vline, 24(35) 'Vendor Name'(016) CENTERED,
    59 sy-vline, 60(16) 'Ref invoice#'(019) CENTERED,
    76 sy-vline, 77(10) 'Inv dt'(020) CENTERED,
    87 sy-vline, 88(101) sy-uline,
    189 sy-vline,190(16) 'Total'(017) CENTERED,
    206 sy-vline.
    WRITE : /1 sy-vline, 12 sy-vline,
    23 sy-vline,59 sy-vline,
    76 sy-vline,87 sy-vline,
    88(16) v_fir CENTERED, 104 sy-vline,
    105(16) v_sec CENTERED, 121 sy-vline,
    122(16) v_thir CENTERED, 138 sy-vline,
    139(16) v_four CENTERED, 155 sy-vline,
    156(16) v_str1 CENTERED,
    172 sy-vline,
    173(16) 'Already Overdue'(018) CENTERED,
    189 sy-vline,
    206 sy-vline.
    format color off.
    WRITE : /1(206) sy-uline.
    ENDFORM. " header1
    <b>The below link will give Tables & Relations.</b>
    http://www.erpgenie.com/abap/tables.htm
    http://goldenink.com/abap/files_in_sap.html
    http://abap4.tripod.com/SAP_Tables.html
    http://www.geocities.com/sapcircle/Relations.pdf
    Regards,
    Sree

  • Opening & closing balances for Vendor

    Hi Experts,
    I am doing a report where in i need to get the opening & closing balances for Vendor(s). I am using BSIK & BSAK tables. Are there any more tables involved and how do i carry out the calculations?
    Please help.
    Thanks
    Dany

    Hi,
    There are various t. code to check line items for vendor like: S_ALR_87012103 but Any table is not helping to check opening/closeing balance for vendor.
    Table BSIK and BSAK are having are records for open items and close items for vendor and system calculate the balance by using these tables.
    Regards,
    Vinod

  • Opening balance for vendor in debit

    Hi
                                  When I post the opening balances for vendors it is showing the vendor balance as debit.(+) Is this correct or it should show vendor balance in credit and customer balance as debit ?
    Regards
    Sekar

    Hi,
                              This was the JE:
                                                                                    VENDOR                         1000 (Debit)
                                                              OP BAL(Asset)               1000(Credit)
    Remarks: BPartners  Opening Balance       
    Thanks and Regards,
    Sekar
    Edited by: S. Gamaliel Sekar on May 17, 2011 11:38 AM
    Edited by: S. Gamaliel Sekar on May 17, 2011 11:39 AM

  • Automatic account postings (for Intercompany Purchase order and Sales order

    Hi all,
    I need some help related to the automatic account postings (for Intercompany Purchase order and Sales order)which i can set for the follwoing scenarios. I have looked on the forms and searched alot but not able to a single solution to solve both the pupose. if one scenario works the other doesnt. Please advise.
    I have created the master data
    Customer receiving--G001
    Sales Org.--GXIN
    Distr. Channel- 01
    Division - 00 
    Company code receiving - G1
    customer supplying- V001
    company code for supplying- V1
    2 different scenarios
    1- Intercompany Purchase order in which a Customer receiving- G001, gets stock replenishment NB purchase order from supplying company V1- GI  and GR of stock is done. Biling document for customer receiving G001 is created. But now I need a way to do the opposite side posting at the supplying customer -V001-- this I do using an Idoc which creates a Invoice receipt for creditor(supplying customer) V001.
    2. Sales order-- A customer X001 of company code G1 buys stock from the company code V1. the customer G001 of company code G1 bills the customer X001, but the intercompany billing doc/ invoice is created for the customer G001 by company code V1.  then now i want an automatic account posting to be created at the supplying customer V001 via idoc.
    Can this be achivable via Idoc with automatic account postings.   
    Please let me know if it doesnt make sense. thanks to all in advance
    cheers
    Jasmeet

    Hi all,
    For the Sales order and automatic posting we have created an output type ZR4N- this is creating a batch input session which can be triggered to be processed autmatically.
    For the intercompany Purchase order -from Invoice we are creating a different output RD04 (sap standard) which creates invoice receipt at the vendor side.
    Rest of the settings are defined using SAP standard functionality within transaction OBCA, OBCB, OBCC, OBCD,OBCE
    thanks for viwing the post
    Cheers
    Jasmeet

  • Re: change account group for vendor

    hi expert,
    i done the same which you mention in earlier form. i manage to change the account group for vendor master.
    now there is an another thing came out that is for normal vendor i able to change the account group but there is another vendor which is one time vendor means for vendor i am going to from normal vendor account group to one time account selected account group so in this case when i am changing the group in xk07 the system is saying a following message.
    new account group xxx is one-time group: change not permitted.
    message no.F2692
    so if anybody face the same problem give me your inputs.
    thanks in advance,
    kk.

    Hi KK,
    For normal vendors, you cannot change the account group to 'One time vendor' group. The one time vendor group will have most of its felds suppressed in the master data. You have to enter the Name, address etc. only at the time of invoice posting.
    But your normal vendor will have the name and address details in the master data itself. So, there will be inconsistency in the field status of the normal vendor account and the one time vendor account.
    Hence, the system may not allow you to change the vendor group.
    Regards,
    Mike

  • GL account balance for Non Leading Ledger

    Hi,
    I am trying to get GL account balance for Non leading ledger.
    I am able to get Balance sheet GL account balance  for leading ledger using 'BAPI_GL_GETGLACCPERIODBALANCES', but I am unable to do so.
    For P&L GLs, requirement is to get internal order wise account balance. I am able to get GL balance for leading ledger using documents in BSEG.
    Any idea on how we get GL balance for non leading ledger?
    Thanks in Advance.
    Tejas

    Hello,
    I am not sure if I understand quesition correct.
    1. Internal order per ledger - this link might give you some information.
    FB50L FI-posting to an internal order
    You can report internal orders per cost element (acutal and plan)
    Use reports in: SAP Menue/ Information Systems/Accounting/Controlling/Reports for Internal Orders/Summarization Reports or/and More Reports
    as an instance: S_ALR_87013010
    direct output to Excel and drill down functionality for details.
    2. GL balances per ledger: use F.08 and select ledger, then you have report per ledger
    Let me know if this is what you have expected.
    all the best Erwin

  • How do I check my account balance for an itunes gift card I redeemed on my iphone 4?

    How do I check my account balance for an itunes gift card I redeemed on my iphone 4?

    Welcome to Apple Communities
    Go to App Store or iTunes and you can see it at the bottom of the app

  • I have creatd smartform for vendor return invoice and i m using std zprog o

    i have creatd smartform for vendor return invoice and i m using std zprog of other client and corresponding prog.. when i run this program using  .....after creating transc in se93. is it not workin ..
    where should i check for error and i am not getting selection screen in se38 program which i am using with this smartform..
    can u tel me step wise....what is the procedure so i can run and execute and see my output..
    please
    regards.

    Hi,
    when you run program from SE38 are you able to see the selection screen and able to exucute with out error....
    And when you run the t-code which you created for your Z-prog whats the message its giving...
    Regards,
    Shankar.

  • Printing confirmation of balance for vendors and customer-urgent

    Hi,
    Thanx Vamsi for the reply.
    I have got 1 more doubt.we are using CUSTOMISED correspondence types.The annexure we give has only the open items.But the users want a list of cleared items to appear in the list.
    Will the confirmation have only open items ???? or can it take even the cleared items along with it.Can the print program be modified to take even the cleared items along with it.
    Kindly advise.
    Thanks in advance
    Regards
    Karpagam

    Hi,
    We are using print program SAPF130K and SAPF130D for vendor and customer respectively.
    My query is can we bring even the cleared items alongwith the open items in the same print program???
    Now we have line items of open line items only?? As per our exploration into the program... we get only open items..
    Also we are using SAP10 and SAP11 as the correspondence type.Kindly advise as to correspondence type should be changed so that it can print both the open and cleared items?
    Please reply ASAP as it is very urgent.
    Thanks in advance.
    Regards
    Karpagam

  • Account assignment for Movt type 101 and 501

    All SAP Gurus,
    We want to do the account assignment for movt types 101, 102, 122, 123, 201, 202, 261, 262 accourding to the movement types.
    We are aware that the Transaction Key is 'GBB'.
    But how to know that which 'General Modification' is used for which movement types.
    (in short where we can find this link between movement types and Transaction Key and 'General Modification')
    Regards,

    To know this first you have to know what does the different general modifications means for GBB:
    AUA: for order settlement
    AUF: for goods receipts for orders (without account assignment)
    and for order settlement if AUA is not maintained
    AUI: Subsequent adjustment of actual price from cost center directly
    to material (with account assignment)
    BSA: for initial entry of stock balances
    INV: for expenditure/income from inventory differences
    VAX: for goods issues for sales orders without
    account assignment object (the account is not a cost element)
    VAY: for goods issues for sales orders with
    account assignment object (account is a cost element)
    VBO: for consumption from stock of material provided to vendor
    VBR: for internal goods issues (for example, for cost center)
    VKA: for sales order account assignment
    (for example, for individual purchase order)
    VKP: for project account assignment (for example, for individual PO)
    VNG: for scrapping/destruction
    VQP: for sample withdrawals without account assignment
    VQY: for sample withdrawals with account assignment
    ZOB: for goods receipts without purchase orders (mvt type 501)
    ZOF: for goods receipts without production orders
    (mvt types 521 and 531)
    You can also define your own account groupings. If you intend to post goods issues for cost centers (mvt type 201) and goods issues for orders (mvt type 261) to separate consumption accounts, you can assign the account grouping ZZZ to movement type 201 and account grouping YYY to movement type 261
    Then go and check OMWN.
    Regards,
    Indranil

  • Recon with G/L account balance with vendor Balance

    Hi,
    There is difference in vendor balance with G/L account balance. How to do Reconcilation,
    let me know the steps/precess.
    Thanks in Advance

    Start of by comparing all the documents in the gl recon account to the documents from the ap list (for the same period).
    They should match. Put them in a spreadsheet and do look ups. Lots of fun ahead.
    pts appreciated.

Maybe you are looking for

  • Photoshop WONT OPEN. PHOTOSHOP CC 2014 PLEASE HELP!!

    So, I downloaded and installed creative cloud, and i installed photoshop, but when i click it, absolutely nothing happends, and i have tried many suggestions but nothing happends at all. So please help!

  • Select Statement issue

    HI All,     I have 10 records in a internal table. I have 20 records in a database table. i want those records from the database table which does not exists in internal table.Which is the better select statement for this situation with performance. R

  • X6-00 Best way to format and reload everything

    What's the best way to erase absolutely everything from the phone, inlcuding firmware? I would plug it into Nokia Suite once that's done, and download the latest version of the handset's firmware.  After having tinkered with it for a couple of years

  • CS2 Error Opening Illustrator

    "Could not complete your Request because there is not enough memory (RAM)" Cannot "place" pictures in the illustrator program. Students need to be able to scan drawings and place them into illustrator to digitize. Any solutions on how to fix this?

  • How to query a list of open Incoming Payment with its Payment Means

    Dear Experts, As subjected, can anyone throw some light onto writing a query which list Open Incoming Payment and its total and payment means. Much Thanks! Warmest Regards, Chinho