Skip to Content

here is a very simple example of getting data from two table in a report.

*&———————————————————————*

*& Report  ZFIRAPJPSLEDGER2                                            *

*&                                                                     *

*&———————————————————————*

*&                                                                     *

*&                                                                     *

*&———————————————————————*

REPORT  ZFIRAPJPSLEDGER2

line-size 99 line-count 39(4)

no standard page heading                                .

*tables used in the program.

tables : bsid ,kna1 .

***********************************************************************

*  Selection-options

***********************************************************************

data : begin of itab occurs 0 ,

       KUNNR LIKE BSID-KUNNR ,

       DMBTR LIKE BSID-DMBTR ,

       name1 like kna1-name1 ,

       ort01 like kna1-ort01 ,

       end of itab .

* select option for program selection.

select-options : custmer for bsid-kunnr .

Initialization .

custmer-low = ‘1’ .

custmer-high = ‘5000’ .

append custmer .

*start of selection event.,

start-of-selection .

select bi~kunnr bi~dmbtr ka~name1 ka~ort01 into corresponding fields of table itab from  bsid as bi left outer join kna1 as ka on bi~kunnr = ka~kunnr

where ( bi~kunnr in custmer ) .

loop at itab .

write :/ itab-kunnr under ‘Custmer’ ,14 sy-vline ,

         itab-dmbtr under ‘Closing Amount’ ,34 sy-vline ,

         itab-name1 under ‘Name’ ,64 sy-vline ,

         itab-ort01 under ‘City’ .

         endloop .

end-of-selection.

*    top of page event.

top-of-page .

write :/20 ‘Custmer closing amount details’ color 2 .

uline .

write :/  ‘Custmer’ ,14 sy-vline ,

      15  ‘Closing Amount’,34 sy-vline ,

      35  ‘Name’ ,64 sy-vline  ,

      65  ‘City’  ,sy-uline .

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply