Professional Documents
Culture Documents
Alv Ida
Alv Ida
sqlViewName: 'ZCDSIDEOPEN'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'open invocies'
define view zcds_ide_open_inv as select from snwd_so_inv_item as item
association [1] to snwd_so_inv_head as _Header
on item.parent_key = _Header.node_key {
//item
node_key as ItemId,
parent_key as SOId,
quantity as Qty,
quantity_unit as QUnit,
gross_amount as GrossAmount,
currency_code as CurrencyCode,
product_guid as ProductId,
_Header.buyer_guid as BuyerId
} where _Header.payment_status = ''
@AbapCatalog.sqlViewName: 'ZCDSIDACOINV'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Join with Master tables'
define view ZCDS_IDA_CO_MASTER as select from zcds_ide_open_inv as invoices
association [1] to ZAUG_I_BUPA as _BusinessPartner
on invoices.BuyerId = _BusinessPartner.node_key {
//invoices
key ItemId,
key SOId,
_BusinessPartner.company_name,
_BusinessPartner.bp_id as BPNo,
Qty,
QUnit,
GrossAmount,
CurrencyCode,
ProductId,
BuyerId
/* Associations */
//ZAUG_I_BUPA
*&---------------------------------------------------------------------*
*& Report zconsume_cds_via_ida_alv
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
report zconsume_cds_via_ida_alv.
tables: snwd_bp.
*select-options : s_bupa for snwd_bp-bp_id.
data(lo_alv) = cl_salv_gui_table_ida=>create_for_cds_view(
exporting
iv_cds_view_name = 'ZCDS_IDA_CO_MASTER'
).
*Killer features
lo_alv->display_options( )->set_title( iv_title = 'Anubhav demo on ALV with IDA' ).
lo_alv->display_options( )->enable_alternating_row_pattern( ).
perform set_event_handler.
lo_alv->add_authorization_for_object(
exporting
iv_authorization_object = 'ZBUPA_ID'
it_activities = value #( ( auth_field = 'ACTVT' value = '03' )
)
it_field_mapping = value #( ( auth_field = 'BUPA_ID' VIEW_FIELD =
'BPNO' ) )
).
* catch cx_salv_function_not_supported. "
lo_alv->fullscreen( )->display( ).
endclass.
class lcl_event_handler implementation.
method toolbar_selected.
data: ls_row type ZCDS_IDA_CO_MASTER.
case ev_fcode.
when 'DETAIL_SCREEN'.
if lo_alv->selection( )->is_row_selected( ) = abap_true.
lo_alv->selection( )->get_selected_row(
importing
es_row = ls_row
).
cl_salv_ida_show_data_row=>display(
exporting
* iv_text =
is_data = ls_row
).
endif.
endcase.
endmethod.
endclass.
form set_event_handler.