SE93 t-code’undan WDYID t-code’unu girerek çalıştırın:
Application parametresine APPL_SOAP_MANAGEMENT
Start Mode parametresine ise BROWSER girerek raporu yürütün.
call function 'DAYS_BETWEEN_TWO_DATES' exporting i_datum_bis = s_date-high i_datum_von = s_date-low i_stgmeth = 2 importing e_tage = lv_i exceptions days_method_not_defined = 1 others = 2. " i_stgmeth parametresi ay/yıl içindeki gün sayısını belirtmektedir: " 1 360 gün üzerinden " 2 gerçek gün sayısı
data : lv_count type i, lv_max type i, lv_min type i, ranges: rng_vbelv for vbfa-vbelv. ranges: lrng_vbelv for vbfa-vbelv. "local range. clear: lv_count, lv_max. lv_min = 0. describe table rng_vbelv lines lv_count. while lv_max lt lv_count. lv_max = lv_min + 1000. if lv_max gt lv_count. lv_max = lv_count. endif. refresh lrng_vbelv. loop at rng_vbelv from lv_min to lv_max. append rng_vbelv to lrng_vbelv. endloop. lv_min = lv_max. select b~vbeln a~vbelv b~wadat_ist b~kunnr b~ernam b~erzet b~erdat appending table lt_itab from vbfa as a inner join likp as b on a~vbeln eq b~vbeln where a~vbelv in lrng_vbelv order by b~vbeln. endwhile.
ranges: rng_vbelv for vbfa-vbelv. *&---------------------------------------------------------------------* *& Form OPTIMIZE_RANGE *&---------------------------------------------------------------------* form optimize_range. data: lv_lvbelv like vbfa-vbelv, "önceki lv_nvbelv like vbfa-vbelv, "yenisi lv_vbelv like vbfa-vbelv, "yenisi lv_aralik(1), "aralık lv_ltabix like sy-tabix, lv_ntabix like sy-tabix. sort rng_vbelv. clear: lv_lvbelv, lv_nvbelv, lv_aralik. loop at rng_vbelv. lv_ntabix = sy-tabix. lv_nvbelv = rng_vbelv-low. lv_vbelv = lv_nvbelv - 1. * condense lv_vbelv. call function 'CONVERSION_EXIT_ALPHA_INPUT' exporting input = lv_vbelv importing output = lv_vbelv. if lv_lvbelv is not initial and lv_lvbelv eq lv_vbelv. lv_ltabix = lv_ntabix - 1. read table rng_vbelv index lv_ltabix. rng_vbelv-option = 'BT'. rng_vbelv-high = lv_nvbelv. modify rng_vbelv index lv_ltabix. delete rng_vbelv index lv_ntabix. lv_lvbelv = lv_nvbelv. continue. endif. lv_lvbelv = lv_nvbelv. endloop. describe table rng_vbelv lines sy-index. endform. " OPTIMIZE_RANGE
types: begin of typ_lfa1, lifnr type lfa1-lifnr, name1 type lfa1-name1, end of typ_lfa1. data: gt_lfa1 type sorted table of typ_lfa1 with unique key lifnr with header line. *&---------------------------------------------------------------------* *& Form READ_LFA1 *&---------------------------------------------------------------------* form read_lfa1 using piv_parnr type ihpa-parnr changing pcs_lfa1 type typ_lfa1. clear pcs_lfa1. read table gt_lfa1 into pcs_lfa1 with table key lifnr = piv_parnr. if sy-subrc ne 0. select single * into corresponding fields of pcs_lfa1 from lfa1 where lifnr eq piv_parnr. check sy-subrc eq 0. insert pcs_lfa1 into table gt_lfa1. endif. endform. " READ_LFA1