Ap open items

Hi please help me
My object is to fetch AP open items(vendor)
These are my output fields
       bukrs    TYPE lfb1-bukrs,                      "Company Code
       lifnr    TYPE lfa1-lifnr,                          "Vendor Account
       blart    TYPE bsik-blart,                        "Document Type
       name1    TYPE lfa1-name1,                   "Vendor Name
       ktokk    TYPE lfa1-ktokk,                       "Account Group
       belnr    TYPE bsik-belnr,                        "Invoice
       ebeln    TYPE bsik-ebeln,                        "Purchasing Order
       bldat    TYPE bsik-bldat,                        "Document Date
       wrbtr1   TYPE bsik-wrbtr,                       " amount
and there are some other fields from bsik. and bsega.
My selection screen has bukrs    bukrs(Company Code), lifnr (Vendor Account)
and ketdate(sy-date).
I am using bapi BAPI_AP_ACC_GETOPENITEMS
CALL FUNCTION 'BAPI_AP_ACC_GETOPENITEMS'
      EXPORTING
        companycode = st_vendor-bukrs
        vendor      = st_vendor-lifnr
        keydate     = p_astid
      TABLES
        lineitems   = gt_lineitem.
Which gives me all the fields .
except   ebeln   ( "Purchasing Order) .
Please help me how to get this.

Hi,
If you are not familiar with BAPI
why can't you write a select statement for BSIK and BSAK table to fetch and display.
see the sample code:
REPORT  zfi_vendor_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: 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.
  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.
  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
reward points if useful
regards
Anji

Similar Messages

  • Open Item and Line Items are not matching

    Hi Gurus,
    I ran the EFT for vendor #1600109 for payment on 10/18/07.  If I run the vendor open items report (ZFI019) for today, it shows the balance net of the EFT that is $203,466 ( $263869 - EFT Value is $60,403). 
    When I ran the vendor line items display (FBL1N), it shows all the invoices including the invoices paid on the Oct 18 EFT $263,869 which is (2034,66+60,403). 
    User wants the open item report should tally the line item display.
    I will assign good points.
    Thanks for your help
    Prashanth

    Hi Gurus,
    EFT is working fine. But the Vendor Open item Report (Custom Report) and Vendor line item report (FBL1N) is different.
    We are looking a balance for a vendor as on 15th where the balances are not matching between the reports but if i run FBL1N on 18th the balances are matching.
    Clearning date is 18th
    Posting Date is 15th.
    Thanks
    Prashanth

  • Vendor's same open item selected for payment twice through APP run F110

    Hi,
    In F110 run, specified vendor  number and payment method(Bank Transfer), executed payment run.
    After, say 5 minutes interval again executed F110 for all vendors and except for the above mentioned payment method.
    In the first case, payment document generated, posted and cleared the Vendor open items. Here, the Payment method is B.
    In the second time also, the same open items are selected in the payment run and the payment method D(Cheque payment).
    Payment document generated and is not posted but cheque is generated for the same amount.
    How could it happened?

    Hi,
    In F110 run, specified vendor  number and payment method(Bank Transfer), executed payment run.
    After, say 5 minutes interval again executed F110 for all vendors and except for the above mentioned payment method.
    In the first case, payment document generated, posted and cleared the Vendor open items. Here, the Payment method is B.
    In the second time also, the same open items are selected in the payment run and the payment method D(Cheque payment).
    Payment document generated and is not posted but cheque is generated for the same amount.
    How could it happened?

  • Unable to Clear Vendor open items in F.13

    Hi All,
    We have few vendor codes, where all are having some normal open items as well as Spl GL open items and net balance is 0.
    When we do clearing with F-44, No issues at all
    But when we try to clear them through F.13, system is grouping normal open items and Spl GL transactions separately.
    If i choose  Shortlist (Statistics) in selection screen, then only atleast i will be able to see normal line items in one group and spl gl items in another group.
    If i choose, Detailed List with Error Log, i am not able to see anything related to any kind of line items.
    So then, i red the documentation of the program SAPF124, in that it says Down payments can only be cleared if down payment clearing for the same amount has been posted.
    As we all know that, each spl GL transaction can be cleared against one normal transaction in F-54. But in our case, we never do that practice, and always want to clear spl GL transactions along with normal transactions.
    My question is that, Is it mandatory to clear them in F-54 before doing F.13?
    As i know, there is an check box option for selecting spl GL transactions in F.13....in this case why should i clear prior to F.13?
    Please advise...
    Regards,
    Srinu

    Hi Gaurav,
    Thanks for your inputs.
    I agree with you, but my intention is to know, whether any possibility (change of internal selection criterion for recon account)
    to clear them automatically in F.13 without doing F-54 only.
    Anyhow i have found two other alternative solutions for the same.
    1) Batch input recording for F-44 in LSMW.
    2) Using worklist instead of vendor code in F-44 to clear all items at one go.
    As our business won't follow clearing with F-54, so this requirement may come often. 
    But only my concern is, they need to identify these cases separately and spend more time to add each vendor code to that worklist, since they are not able to add a range of vendor codes directly. As it allows only single values.
    So, is there any other way, which we can suggest them to add 10000+ vendor codes to the same worklist, since we can add 12 codes at one go and repeating the same will take time
    Regards,
    Srinu

  • Possible to clear vendor open item against already posted payment document?

    Hi
    Can you advise if it is possible to clear an open item against already posted payment/clearing doc? Here is the background to the scenario:
    An invoice was posted with transaction FB60. This was subsequently picked up in the payment run F110 and cleared by payment document number 200005678. The item went to the bank on the paymnet file and was paid out to the vendor. The transaction reference, which appeared on the incoming bank statemnet was the payment document number 200005678.
    Subsequently it was discovered that the original invoice should have been posted with reference to a PO using MIRO. The requirement now is to reverse the paymnet documnet 200005678 in SAP, then reverse the document that was posted using FB60. After this the invoice will be posted using MIRO. This will create an open item on the vendor account.
    This item will not be piad out again. Therefore the requirement is to try clear that open item against the previously posted payment document 200005678.
    Is there any way to clear this vendor open item against the originally posted payment document 200005678?? Or any other advice on how this scenario can be handled in SAP?
    Thank for your help.
    Mike

    Hi,
    I tried that option in our test system. I ran FBRA and entered Paymnet Documnet Number (+Clearing Doc Number), Company Code, Fiscal Year.
    Then chose menu option Clearing -> Reset Cleared Items.
    The system pops up a window asking for a reversal reason and reversal date.  I use 01 and posting date of today.
    The system now posts another cleared document. That document places the invoice as an open item on the vendor account. It does not place the Payment Document as an open item on the account.
    When I go to F-44 only the open vendor invoice is showing there. There is no open paymnet document.
    Is there perhaps some configuration setting that stops the placement of the paymnet document as an open item when reset?
    Thanks for your help again.

  • URGENT---Automatic payment run-Vendor open item clearing

    When I run the payment program, it ran without any error, however, the vendor account was not cleared. The balance in GL and Vendor account remains the original amounts. And the Vendor line items which were supposed to be cleared thru F110, are now showing as Open items.
    please give me the TCODES to look in.
    Please help.
    Thanks in advance
    Sharath

    Dear Sharath,
    To check whether your payment run has actually generated any payment document or not, please follow the following steps:-
    (1) Go to transaction SE16/ SE16N and table REGUH, give the "payment run ID", "run date" and "Proposal Indicator as blank".
         It should show the payment document.
    (2) If (1) above show payment document, then go to table REGUP and check the invoices paid.
       If invoices are there in REGUP, then there might be some issue in the payment document updation in the system which you can check via transaction SM12. (For this just check in table REGUV, whether payment documents created and posted are equal or not for the payment run.)
    (3) if (1) do not show any payment document, that means payment run has not made any payment.
        In this case, you create a new payment run and in the parameters select the error logs display also and in free selection give the document number you are expecting to be paid off by the payment run. This might help you to know the reason of non payment by cheking the proposal log/ payment run log.
    I hope that this should assist you
    Regards,
    Gaurav

  • Vendor Open items Authorisation

    Hi Peers!
    Is there any report were i can authorise the payments to which vendor and which invoice i can pay today like that.
    Ex: Say my higher authority wants to select the open items vendor wise to pay the due. so that i will check that invoices and pay through outgoing payment.
    Pls reply soon, Its urgent
    Thanks
    Murali

    Hi
    There are so many age wise analysis reports are there for analysing the customers or vendors open items. out of those, F.41 for vendor open items there you can find all the relevant data including business area level also satisfied because in some cases higher management wants the particular business area wise required for analysis. similarly f.21 for customers.
    I hope it will be suffice your requirement.
    Regads
    madhav

  • Reset Cleared Documents and Vendor Open Items Report FBL1N

    Hi all,
    I have following scenario:
    - In last month, we had 2 documents (invoice and payment) cleared against each other. We created open items report as well as open items correspondence sent to Vendor. Obviously, the docs were not included in report.
    - In this month, we have reset and reverse clearing document of the documents. We create report again with the open key date as in last month. It should not include the 2 docs but it did with whichever key date we chose.
    Is there any setting that open item report doesn't include cleared item at the key date when we run report for previous month?
    Thanks and Regards,
    Dau

    Hi Dau,
    If i understand you correctly then you posted and paid invoice in Jan 2012 and generated the open line item report for Jan which correctly did not include this cleared invoice.
    Now in Feb 2012 you reset and reversed this payment document.
    The issue is when you execute the report FBL1N again then you get the open line item for this invoice correct. Please confirm what is the open item key date that you are using here for generating this report
    If you keep it 31.01.2012 then definetly this invoice should not appear in the report but if you keep that 29.12.2012 then this line item would for sure appear.
    The importance of key date is to limit the report to certain date. The system selects all items posted up to and including the specified key date and open for this period.
    so I think your issue is with the key date.
    Hope this helps you.
    Regards,
    Prasad

  • Vendor open items wise ALV Grid Display (FBL1N) report to Excel Sheet

    Hi All,
    I need vendor wise open items and cleared items in ALV Grid format in excel sheet.
    I'm Trying that in T Code FBL1N, After the execution. I had select ALV Grid format like this From the menu bar->Settings-> Switch list.
    After that i get ALV  Grid format, Then i'm doing export the data to excel sheet. like this From the Menu bar->List->Export->Spread sheet.
    That time i'm getting Error Message no. 0K064, Filter criteria, sorting, totals and subtotals are not taken into account.
    I want vendor wise sorting totals and subtotals,
    How can i over come this Error please let me now.
    Thanks,
    Amar

    Hi Amar,
    Please check the KBA 2083705.
    https://websmp230.sap-ag.de/sap(bD1odSZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3230383337303526
    Regards,
    Monika

  • Deleted Items Appearing on the FBL3n Report for Open Items

    Hi All
    We just went live and I am facing a huge issue;
    I deleted many migration entries from loads of GL Accounts for multiple Co Codes, but on the FBL3n report, whenI execute with the option of 'Open Items' only, I  still see the deleted items with a green check sitting there.
    How can i get those from being visible?
    Thanks for the support
    RS

    Hi:
                This is standard behavior. Your GL accounts are managed on line item basis hence despite of the fact you reversed the entries they will continue to be shown in open item selection criteria which in fact are not open items. It makes no sense to see a GL account in FBL3N on open item date since this account has been configured on the basis on line item management and i will continue to be shown as line item with green sign . Execute report FBL3N with open item or with all item (with date you give in open item) you will see the same figures and same line items. However you can exclude the reversed entries by fetching reversed with (BKPF-STBLG) field from menu ..settings...special fields and hence excluding the entries having this filed update.
    I hope this will solve your issue.
    Regards

  • Open Item Report

    Hi SAP Gurus!!
    I have something in mind, i need your help guys.   I want to make a report of all open items ( vendor ).  I would like to customize a report for this. I want to:
    1. Display all open items net of payments. Line item should display remaining balances only.
    2.  I would like also to display all MIGO transactions that have no Invoice receipt yet.
    Requirements:  I want to do this in a query, what are the sap tables should i use to make this report.
    I already checked FBL1N and chose INVOICENET layout, but still i am not satisfied with that kind of report.
    Please help me guys. I will assign maximum points to useful answers.
    Thanks in advance.

    Hi,
    Check this SAP Standard report RFKEPL00 .Go to T.code se38 and enter the standard report RFKEPL00 ( Vendor open items) and execute.Check whether it meets your requirement or not.
    To see the tables used in this report, Enter the program name and click on display.and click on INCLUDE fkepl00_top.It will show yo the tables used in the report.
    In FBL1N changelayout (Ctrl + F8) , Select purchase document or other fields to meet your requirement.
    Please let me know if you need more information.
    Pelase let me know if you need more information.
    Assign points if useful.
    Regards
    Sridhar M

  • Open items in FBL3N

    Hello,
    I have a problem in displaying the open items and cleared items for a GL A/C in reports (FBL3N, FAGLL03).
    Message obtained : No items selected.
    In FS00, the following are checked :
    Open item management
    Line item display
    Is there any other configuration required?
    Thanks in advance for your help.
    Diana.

    Hello,
    Though you have maintained your account as open item and cleared item, none of the line must have been cleared so far.
    You need to clear the items through F-03 for this account. To clear the items debit and credit total must have been tallied. You one select those line items you want to clear. Then the amount will come to blue colour and non-clearing line items will come to black colour. Make sure the difference between these is ZERO.
    Now, you can see in FBL3N, all items (select check box Normal items)
    Regards,
    Ravi

  • Restriction on amount on Open items query (FI-CA)

    Hello,
    we are trying to implement the queries 0FC_C07_Q0001 and 0FC_C07_Q0002 for reporting on open and cleared items from FI-CA to BW.
    From the open items report on FI-CA (transaction FPO4) it is possible to select based on the amount, and also to relate this balance at BP, CA... level.
    From BW team they say it is not possible to do the same with the open items queries in BW. They say the amount is not even available as a parameter. Is it like this? Can't we select only the open items for CA with more than a specific amount?
    Many thanks in advance,
    Montserrat

    Hi,
    It is possible if you are using conditions, like if the reqt is to show amounts greater than X (entered by user), then a Condition can be created on the amount key figure and use the condition type Greater Than and supply a variable which will be used by the user during run time. See here for full details:
    http://help.sap.com/saphelp_nw04/helpdata/en/73/702e39074dc93de10000000a114084/content.htm
    Hope this helps...

  • What happens to the open item in bsid table when it is cleared

    hi experts,
                   i have a doubt about open and cleared items of accounting documents. as we know open items of customers are stored in bsid and cleared ones in bsad. For suupose, an open item is closed ina particular period then what happened to the entry in bsid and bsad table. an entry regarding is stored in bsad (cleared),and what happens to the entry in bsid, still it will be there or removed from it.

    Hi,
    When ever we clear the document(Complete payment) that document will be moved to BSAD table. Other wise it will remain in BSID.
    If u are making partial payment then all the partial payment documents along with original document will be stored in BSID till u made the complete payment for that invoice.
    Assumption is u have to give all partial payment documents made for particular invoice item while u are making complete payment in F-28 transaction. So that these partail payment documents will also be cleared while making complete payment and moved to BSAD table.
    This trasaction can be used for both partial and complete payments.
    Irrespective of complete or partial payments made all the documents will remain stored in BKPF and BSEG tables.
    BSID and BSAD are index tables to address performance issues with BKPF and BSEG tables.
    So all open and cleared documents will be there in BKPF and BSEG tables.
    All cleared documents will be there in BSAD table.
    Alll open documents will be there in BSID table.
    Hope it is clear.
    Thanks,
    Vinod.

  • How to ensure that an accrual (FBS1) that was cleared and reversed/reset (FBRA) does not affect the books while being in open items (FAGLB03)?

    At first the user created an accrual using FBS1 for reversal on 5/1/2015.
    This created a clearing document.
    Then it was mistakenly reversed by the user for 5/1/2015 by using F.81
    This also created a clearing document.
    Based on advice in the following thread: Delete reverse accrual/defferal documents | SCN ,
    the user used FBRA to reset and reverse the document. We are unsure if the reset and reverse command was used or just the reset choice.
    Now the accrual value is in the respective accounts with an open status (i.e. red button). Does this mean that the entry has already been discarded and it won't affect the accounts? Or does one then use FB50 to reverse the effects of the accrual in the current and next month?

    Hi
    I guess that the user has not reverse the transaction as its still shows as open item in 30 /4 .. so I belive that you need to use fb50 or simply use FBR2 and enter the original entry no and the choose (generate reversal posting option )..
    regards
    mahmoud el nady

  • Difference between cleared items,open items and all postings (FI).

    Hi experts,
    Can anybody tell me the difference between cleared items,open items and all postings for an account.
    While running corresponding bapis and transaction FAGLL03 (for GL) or FBL1N (for accounts payable) i found that in some cases all postings is less than cleared items or open items for a time period. How could it happen.According to my knowledge all postings should contain cleared items and open items.
    Please correct me..
    Thanks and Regards
    Arjun

    Hi Arjun,
    For every Billing Documnet created(VBRK/VBRP-VBELN) there will be an accounting document created in BSID/BSAD tables.
    OPEN ITEMS means the Billed/Invoice Amounts that are pending from Customers, i.e which we have to receive from Customers.
    CLOSED ITEMS means the AMOUNTS received from that customer.
    OPEN ITEMS : fetch data from BSID table Only
    CLOSED ITEMS : fetch data from BSAD only.
    ALL POSTINGS : fetch data from both BSID and BSAD.
    Hope this will help.
    Regards,
    Nitin.

Maybe you are looking for