Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Trouble creating a open items report (BSID and BSAD tables)

Hi guys,

im creating a report that must display open items for an especific date, and i do it very well with a query from BSID table.

The problem comes when u use a date on the past, example last week.

if u do that, the items are now closed and are no longer stored in BSID table, so i think that they must be now in BSAD table, but i dont know how to relate wich ones are recently closed...

i also tried to do a query from BSAD with augdt >= last week date, and i almost get the items that i needed(this items plus the ones from BSID), but is not exactly because u can close an item with a date in the past..

is there any way to relate that 2 tables, or what exactly happens when an items change from bsid to bsad??

any ideas?

Former Member
Former Member replied


I think the best way to recive the necessary information is using logical data base DDF. You can use report RFITEMAR to see how use the logical data base.

Some months ago I've read the data in my report in following way:

1. make Z-copy of report RFITEMAR

2. in Z-copy after end-of-selection insert

export it_pos to memory id 'POS_TABLE'.

3. In your report write a form similar to my form below:

*&      Form  submit_zrfitemar
FORM submit_zrfitemar  tables    rkunnr  type trgr_kunnr
                                 it_pos  type it_rfposxext
                       using     ibukrs  type bukrs
                                 idatsd  type sy-datum.

   data: rspar    type table of rsparams,
         l_rspar  type rsparams,
         l_pos    type rfposxext,
         akunnr  type kunnr.

   l_rspar-selname = 'DD_KUNNR'.
   l_rspar-kind    = 'S'.
   loop at rkunnr.
       move-corresponding rkunnr to l_rspar.
       if l_rspar-high = ''.
           l_rspar-option  = 'EQ'.
           l_rspar-option  = 'BT'.
       append l_rspar to rspar.

    clear: l_rspar.
    l_rspar-selname = 'DD_BUKRS'.
    l_rspar-kind    = 'S'.
    l_rspar-sign    = 'I'.
    l_rspar-option  = 'BT'.
    l_rspar-low  = ibukrs.
    append l_rspar to rspar.

    clear: l_rspar.
    l_rspar-selname = 'PA_STIDA'.
    l_rspar-kind    = 'S'.
    l_rspar-sign    = 'I'.
    l_rspar-option  = 'BT'.
    l_rspar-low  = idatsd.
    append l_rspar to rspar.

    clear: it_pos[].

  submit ZRFITEMAR
  with selection-table rspar
  and return.

  import it_pos from memory id 'POS_TABLE'.

ENDFORM.                    " submit_zrfitemar

You find the necessary data in table IT_POS.


Edited by: John Smith on Oct 9, 2008 5:42 PM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question