Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Link BSAD items

Former Member
0 Likes
397

Hi.

I'm trying to create a report in FI/AR which shows me cleared amounts and the invoices which are cleared.

Layout something like this :

Clearing document 10 , Customer A , amount 1500 Euro is cleared for these invoices :

Clearing document 10 , document 1 amount of 500 E

Clearing document 10 , document 2 amount of 500 E

Clearing document 10 , document 3 amount of 500 E

Clearing document 10 , Customer A, amount 1000 is cleared for these invoices :

Clearing document 10 , document 4 amount of 500

Clearing document 10 , document 5 amount of 500

The problem which I'm facing now is how to link the invoices to the correct cleared amount.

Is there link avaibable from document 1 to the amount of 1500 ??

Can anyone help ??

1 REPLY 1
Read only

andreas_mann3
Active Contributor
0 Likes
279

Yes, the connection is the field augbl (Document Number of the Clearing Document).

e.g:

PARAMETERS:belnr LIKE bsad-augbl,
           bukrs LIKE bsad-bukrs,
           gjahr LIKE bsad-gjahr,
           buzei LIKE bsad-buzei.

DATA itab LIKE bseg.
DATA inv  LIKE bsad OCCURS 0 WITH HEADER LINE.

SELECT SINGLE * FROM  bseg CLIENT SPECIFIED INTO itab
       WHERE  mandt  = sy-mandt
       AND    bukrs  = bukrs
       AND    belnr  = belnr
       AND    gjahr  = gjahr
       AND    buzei  = buzei.

SELECT        * FROM  bsad INTO TABLE inv
       WHERE  bukrs  = itab-bukrs
       AND    kunnr  = itab-kunnr
       AND    augdt  = itab-augdt
       AND    augbl  = itab-augbl.
       AND    belnr  <> itab-augbl.

regards Andreas