Vous êtes sur la page 1sur 5

/* 3 level interactive report */

*&---------------------------------------------------------------------*
*& report ztej_intab1 *
*&
*
*&---------------------------------------------------------------------*
*&
*
*&
*
*&---------------------------------------------------------------------*

report ztej_intab1 line-size 103 line-count 35(5) no standard page


heading.

*tables declaration

tables : kna1, vbak, vbap.

*select options

select-options: cust_no for kna1-kunnr.

*initialization

initialization.

cust_no-low = '01'.
cust_no-high = '5000'.
cust_no-sign = 'i'.
cust_no-option = 'bt'.
append cust_no.

*selection screen validation

at selection-screen on cust_no.

loop at screen.
if cust_no-low < 1 or cust_no-high > 5000.
message e001(ztj1).
endif.
endloop.

*basic list selection

start-of-selection.

select kunnr name1 ort01 land1 into


(kna1-kunnr, kna1-name1,kna1-ort01,kna1-land1)
from kna1
where kunnr in cust_no.

write:/1 sy-vline,
kna1-kunnr under 'customer no.' hotspot on,
16 sy-vline,
kna1-name1 under 'name',
61 sy-vline,
kna1-ort01 under 'city',
86 sy-vline,
kna1-land1 under 'country',
103 sy-vline.

hide: kna1-kunnr.

endselect.

uline.

*secondary list access

at line-selection.

if sy-lsind = 1.
perform sales_ord.
endif.
if sy-lsind = 2.
perform item_det.
endif.

*top of page

top-of-page.

format color 1.

write : 'customer details'.

format color 1 off.

uline.

format color 3.

write : 1 sy-vline,
3 'customer no.',
16 sy-vline,
18 'name',
61 sy-vline,
63 'city',
86 sy-vline,
88 'country',
103 sy-vline.

uline.

format color 3 off.

*top of page for secondary lists

top-of-page during line-selection.


*top of page for 1st secondary list

if sy-lsind = 1.

uline.

format color 1.

write : 'sales order details'.


uline.
format color 1 off.

format color 3.

write : 1 sy-vline,
3 'customer no.',
16 sy-vline,
18 'sales order no.',
40 sy-vline,
42 'date',
60 sy-vline,
62 'creator',
85 sy-vline,
87 'doc date',
103 sy-vline.
uline.

endif.

format color 3 off.

*top of page for 2nd secondary list

if sy-lsind = 2.

uline.

format color 1.

write : 'item details'.

uline.

format color 1 off.

format color 3.

write : 1 sy-vline,
3 'sales order no.',
40 sy-vline,
42 'sales item no.',
60 sy-vline,
62 'order quantity',
103 sy-vline.
uline.
endif.

format color 3 off.

*end of page

end-of-page.

uline.
write :'user :',sy-uname,/,'date :', sy-datum, 85 'end of page:',
sy-pagno.
skip.

*&---------------------------------------------------------------------*
*& form sales_ord
*&
*& first secondary list form
*&---------------------------------------------------------------------*

form sales_ord .

select kunnr vbeln erdat ernam audat into


(vbak-kunnr, vbak-vbeln, vbak-erdat, vbak-ernam, vbak-audat)
from vbak
where kunnr = kna1-kunnr.

write:/1 sy-vline,
vbak-kunnr under 'customer no.' hotspot on,
16 sy-vline,
vbak-vbeln under 'sales order no.' hotspot on,
40 sy-vline,
vbak-erdat under 'date',
60 sy-vline,
vbak-ernam under 'creator',
85 sy-vline,
vbak-audat under 'doc date',
103 sy-vline.
hide : vbak-vbeln.
endselect.

uline.

endform. " sales_ord

*&---------------------------------------------------------------------*
*& form item_det
*&
*& second secondary list form
*&---------------------------------------------------------------------*
form item_det .

select vbeln posnr kwmeng into


(vbap-vbeln, vbap-posnr, vbap-kwmeng)
from vbap
where vbeln = vbak-vbeln.
write : /1 sy-vline,
vbap-vbeln under 'sales order no.',
40 sy-vline,
vbap-posnr under 'sales item no.',
60 sy-vline,
vbap-kwmeng under 'order quantity',
103 sy-vline.

endselect.

uline.
endform. " item_det

Vous aimerez peut-être aussi