Professional Documents
Culture Documents
data(lo_timer) = cl_abap_runtime=>create_hr_timer( ).
data(t1) = lo_timer->get_runtime( ).
*3. Check the total open amount of invoice which is due in a common currency
*Invoice header table SNWD_SO_INV_HEAD to find open invoice PAYMENT_STATUS = ‘’
select * from snwd_so_inv_item as items inner join snwd_so_inv_head as inv_head on
items~parent_key = inv_head~node_key
inner join snwd_bpa as bpa on
inv_head~buyer_guid = bpa~node_key
into @data(ls_amt)
WHERE inv_head~payment_status = ''.
ls_amount-currency_code = ls_customizing-currency_code.
*Perform currency conversion to bring amount in common currency and total
ENDSELECT.
*4. Classify the customers based on their ability to pay pending bills. Comparing
with a threshold limit.
loop at lt_amount into ls_amount.
if sy-subrc = 0.
ENDIF.
endloop.
data(t2) = lo_timer->get_runtime( ).
data(t3) = ( t2 - t1 ) / 1000.
*&---------------------------------------------------------------------*
*& Report zaug_oia_aggregate
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zaug_oia_aggregate.
data(lo_timer) = cl_abap_runtime=>create_hr_timer( ).
data(t1) = lo_timer->get_runtime( ).
*3. Check the total open amount of invoice which is due in a common currency
*Invoice header table SNWD_SO_INV_HEAD to find open invoice PAYMENT_STATUS = ‘’
select bpa~bp_id, sum( items~gross_amount ) as gross_amount,
items~currency_code
from snwd_so_inv_item as items inner join snwd_so_inv_head as inv_head on
items~parent_key = inv_head~node_key
inner join snwd_bpa as bpa on
inv_head~buyer_guid = bpa~node_key
into @data(ls_amt)
WHERE inv_head~payment_status = '' group by bpa~bp_id, items~currency_code.
ls_amount-currency_code = ls_customizing-currency_code.
*Perform currency conversion to bring amount in common currency and total
ENDSELECT.
*4. Classify the customers based on their ability to pay pending bills. Comparing
with a threshold limit.
loop at lt_amount into ls_amount.
if sy-subrc = 0.
append wa to itab.
ENDIF.
endloop.
data(t2) = lo_timer->get_runtime( ).
data(t3) = ( t2 - t1 ) / 1000.
cl_demo_output=>display(
EXPORTING
data = itab
name = |Time takes was { t3 } ms|
* exclude =
* include =
).
*cl_demo_output=>display(
* EXPORTING
* data = itab
** name =
** exclude =
** include =
*).