Sunteți pe pagina 1din 21

ABAP Development for SAP HANA

https://open.sap.com/courses/a4h1

Source Code of Week 4

Version 1 - 15.10.2014
Only Demo content
Without any warranty

Contents
CDS DDL Sources ........................................................................................................................................ 3
ZDDLS_CDS_40_ANNOTATION .................................................................................................................. 3
ABAP Classes .............................................................................................................................................. 3
ZCL_AMDP_SIMPLE_00 .............................................................................................................................. 3
ZCL_A4H1_AMDP_BADI .............................................................................................................................. 4
ZCL_A4H1_BADI_IMPL_01 .......................................................................................................................... 5
ZCL_A4H1_BADI_IMPL_02 .......................................................................................................................... 6
ZCL_A4H1_CALL_AMDP_BADI ................................................................................................................... 7
ZCL_A4H1_E2E_CUST_OPEN_INVOICE ................................................................................................... 8
ZCL_ZA4H1_E2E_CUST_INF_DPC_EXT.................................................................................................. 12
ABAP Programs ......................................................................................................................................... 15
ZR_ADBC_PROC_CALL............................................................................................................................. 15
ZR_ADBC_SIMPLE ..................................................................................................................................... 17
ZR_AMDP_01_SIMPLE_CALL ................................................................................................................... 18
ZR_AMDP_BADI_CALL .............................................................................................................................. 19
ZR_AMDP_CALL ......................................................................................................................................... 19
ABAP Interfaces ......................................................................................................................................... 19
ZIF_A4H1_AMDP_BADI.............................................................................................................................. 19

CDS DDL SOURCES


ZDDLS_CDS_40_ANNOTATION

@AbapCatalog.sqlViewName: 'ZDDLS_CDS_40'
@ClientDependent: true
@AbapCatalog.Buffering.status: #SWITCHED_OFF
define view zcdsv_annotation_simple as select from snwd_so
{
key so_id as customer_id,
@Semantics.currencyCode: true
currency_code,
@Semantics.amount.currencyCode: 'currency_code'
gross_amount
}
ABAP CLASSES
ZCL_AMDP_SIMPLE_00

CLASS zcl_amdp_simple_00 DEFINITION


PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES: if_amdp_marker_hdb.
TYPES:
BEGIN OF ty_customer_info,
customer_id
TYPE snwd_bpa-bp_id,
customer_name
TYPE snwd_bpa-company_name,
currency_code
TYPE snwd_so-currency_code,
total_gross_amount TYPE snwd_so-gross_amount,
undefined
TYPE i,
END OF ty_customer_info ,
tt_customer_info TYPE STANDARD TABLE OF
ty_customer_info.
METHODS get_customer_infos
EXPORTING
VALUE(et_customer_info) TYPE tt_customer_info
RAISING cx_amdp_error.
ENDCLASS.

CLASS ZCL_AMDP_SIMPLE_00 IMPLEMENTATION.

METHOD get_customer_infos
by DATABASE PROCEDURE
FOR HDB
LANGUAGE SQLSCRIPT
options read-ONLY
using snwd_bpa snwd_so.
declare lv_zero integer;
lv_zero := 0;
et_customer_info =
SELECT BP_ID as customer_id,
COMPANY_NAME as customer_name,
SO.CURRENCY_CODE,
SUM( SO.GROSS_AMOUNT )
as TOTAL_GROSS_AMOUNT
,
( 1 / :lv_zero ) as undefined
FROM SNWD_BPA AS BPA
INNER JOIN SNWD_SO AS SO
ON SO.BUYER_GUID = BPA.NODE_KEY
GROUP BY BP_ID, COMPANY_NAME, SO.CURRENCY_CODE
ORDER BY BP_ID;

ENDMETHOD.
ENDCLASS.
ZCL_A4H1_AMDP_BADI

CLASS zcl_a4h1_amdp_badi DEFINITION


PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_amdp_marker_hdb.
4

INTERFACES if_badi_interface .
INTERFACES zif_a4h1_amdp_badi .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.

CLASS ZCL_A4H1_AMDP_BADI IMPLEMENTATION.

METHOD zif_a4h1_amdp_badi~get_customer_infos
BY DATABASE PROCEDURE
FOR HDB
LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY
USING snwd_so snwd_bpa.
et_customer_info =
SELECT BP_ID as customer_id,
COMPANY_NAME as customer_name,
SO.CURRENCY_CODE,
SUM( SO.GROSS_AMOUNT )
as TOTAL_GROSS_AMOUNT
FROM SNWD_BPA AS BPA
INNER JOIN SNWD_SO AS SO
ON SO.BUYER_GUID = BPA.NODE_KEY
GROUP BY BP_ID, COMPANY_NAME, SO.CURRENCY_CODE
ORDER BY BP_ID;
ENDMETHOD.
ENDCLASS.
ZCL_A4H1_BADI_IMPL_01

CLASS zcl_a4h1_badi_impl_01 DEFINITION


PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_amdp_marker_hdb.
INTERFACES if_badi_interface .
INTERFACES zif_a4h1_amdp_badi .
PROTECTED SECTION.
5

PRIVATE SECTION.
ENDCLASS.

CLASS zcl_a4h1_badi_impl_01 IMPLEMENTATION.


METHOD zif_a4h1_amdp_badi~get_customer_infos
BY DATABASE PROCEDURE
FOR HDB
LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY
USING snwd_so snwd_bpa.
et_customer_info =
SELECT BP_ID as customer_id,
COMPANY_NAME as customer_name,
SO.CURRENCY_CODE,
SUM( SO.GROSS_AMOUNT )
as TOTAL_GROSS_AMOUNT
FROM SNWD_BPA AS BPA
INNER JOIN SNWD_SO AS SO
ON SO.BUYER_GUID = BPA.NODE_KEY
GROUP BY BP_ID, COMPANY_NAME, SO.CURRENCY_CODE
ORDER BY BP_ID;
ENDMETHOD.
ENDCLASS.
ZCL_A4H1_BADI_IMPL_02

CLASS zcl_a4h1_badi_impl_02 DEFINITION


PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_amdp_marker_hdb.
INTERFACES if_badi_interface .
INTERFACES zif_a4h1_amdp_badi .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.

CLASS zcl_a4h1_badi_impl_02 IMPLEMENTATION.

METHOD zif_a4h1_amdp_badi~get_customer_infos
BY DATABASE PROCEDURE
FOR HDB
LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY
USING snwd_so snwd_bpa.
et_customer_info =
SELECT BP_ID as customer_id,
COMPANY_NAME as customer_name,
SO.CURRENCY_CODE,
SUM( SO.GROSS_AMOUNT )
as TOTAL_GROSS_AMOUNT
FROM SNWD_BPA AS BPA
INNER JOIN SNWD_SO AS SO
ON SO.BUYER_GUID = BPA.NODE_KEY
GROUP BY BP_ID, COMPANY_NAME, SO.CURRENCY_CODE
HAVING SUM( SO.GROSS_AMOUNT ) > 10000000
ORDER BY BP_ID;
ENDMETHOD.
ENDCLASS.
ZCL_A4H1_CALL_AMDP_BADI

CLASS zcl_a4h1_call_amdp_badi DEFINITION


PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES: if_amdp_marker_hdb.
class-METHODS:
call_badi
EXPORTING value(et_customer_info) type
zif_a4h1_amdp_badi=>tt_customer_info.
PROTECTED SECTION.
PRIVATE SECTION.
7

ENDCLASS.

CLASS ZCL_A4H1_CALL_AMDP_BADI IMPLEMENTATION.

METHOD call_badi
by DATABASE PROCEDURE
FOR HDB
LANGUAGE SQLSCRIPT
options read-only
using ZA4H1_AMDP_BADI=>get_customer_infos.
call "ZA4H1_AMDP_BADI=>GET_CUSTOMER_INFOS"(
et_customer_info => et_customer_info );
ENDMETHOD.
ENDCLASS.
ZCL_A4H1_E2E_CUST_OPEN_INVOICE

CLASS zcl_a4h1_e2e_cust_open_invoice DEFINITION


PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES: if_amdp_marker_hdb.
TYPES:
tt_cust_info TYPE STANDARD TABLE OF
za4h1_e2e_customer_info WITH KEY customer_id,
tt_inv_info TYPE STANDARD TABLE OF
za4h1_e2e_invoice_info WITH KEY customer_id.
METHODS:
get_customer_info
IMPORTING
VALUE(iv_client) TYPE symandt
VALUE(iv_bupaid)
TYPE za4h1_e2e_customer_info-customer_id
EXPORTING
VALUE(et_bpinfo) TYPE tt_cust_info,
get_invoice_info
IMPORTING

VALUE(iv_client) TYPE symandt


VALUE(iv_bupaid)
TYPE za4h1_e2e_customer_info-customer_id
EXPORTING
VALUE(et_invinfo) TYPE tt_inv_info.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_rel_items,
client
TYPE snwd_so_inv_item-client,
inv_i_guid
TYPE snwd_so_inv_item-node_key,
inv_guid
TYPE snwd_so_inv_head-node_key,
buyer_guid
TYPE snwd_bpa-node_key,
customer_id
TYPE snwd_bpa-bp_id,
invoice_date
TYPE snwd_so_inv_head-created_at,
gross_amount
TYPE snwd_so_inv_item-gross_amount,
currency_code_conv
TYPE snwd_so_inv_item-currency_code,
END OF ty_rel_items,
tt_rel_items TYPE
STANDARD TABLE OF ty_rel_items.
METHODS:
get_curr_conv_relevant_items
IMPORTING
VALUE(iv_client)
TYPE symandt
VALUE(iv_bupaid)
TYPE za4h1_e2e_customer_info-customer_id
EXPORTING
VALUE(et_conv_items) TYPE tt_rel_items.
ENDCLASS.

CLASS zcl_a4h1_e2e_cust_open_invoice IMPLEMENTATION.


METHOD get_curr_conv_relevant_items BY DATABASE PROCEDURE
FOR HDB

LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY
USING snwd_bpa snwd_so_inv_head snwd_so_inv_item.
-- declare a local variable
declare lv_today date;
-- get current date for conversion
select current_date into lv_today from dummy;
-- select relevant invoice items
lt_relevant_items =
select
i.client as client,
i.node_key as inv_i_guid,
h.node_key as inv_guid,
bpa.node_key as buyer_guid,
bpa.bp_id as customer_id,
h.created_at as invoice_date,
i.gross_amount,
i.currency_code
from snwd_so_inv_item as i
join snwd_so_inv_head as h
on i.client = h.client
and i.parent_key = h.node_key
join snwd_bpa as bpa
on h.client = bpa.client
and h.buyer_guid = bpa.node_key
where h.client = :iv_client
and bpa.bp_id = :iv_bupaid
and h.payment_status = '';
--convert gross amount of items to currency 'USD'
et_conv_items = ce_conversion( :lt_relevant_items,
[ family = 'currency',
method = 'ERP',
steps =
'shift,convert,shift_back',
source_unit_column =
"CURRENCY_CODE" ,
output_unit_column =
"CURRENCY_CODE_CONV",
target_unit = 'USD',

10

reference_date =
:lv_today,
client = :iv_client ],
[gross_amount] ) ;
ENDMETHOD.

METHOD get_invoice_info BY DATABASE PROCEDURE


FOR HDB
LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY
USING snwd_so snwd_so_inv_head
zcl_a4h1_e2e_cust_open_invoice=>get_curr_conv_relevant_items.

call
"ZCL_A4H1_E2E_CUST_OPEN_INVOICE=>GET_CURR_CONV_RELEVANT_ITEMS"
(
iv_client => :iv_client,
iv_bupaid => :iv_bupaid,
et_conv_items => :lt_converted_items );
--aggregated gross amounts per sales order invoice
et_invinfo =
select
customer_id,
so_id as order_id,
invoice_date,
currency_code_conv as currency_code,
sum( conv_items.gross_amount ) as sum_gross_amount
from :lt_converted_items as conv_items
join snwd_so_inv_head as h
on h.client = conv_items.client
and h.node_key = conv_items.inv_guid
join snwd_so as so
on so.client = h.client
and so.node_key = h.so_guid
group by customer_id, so_id, invoice_date,
currency_code_conv
order by so_id asc;
ENDMETHOD.

11

METHOD get_customer_info BY DATABASE PROCEDURE


FOR HDB
LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY
USING snwd_bpa snwd_ad
zcl_a4h1_e2e_cust_open_invoice=>get_curr_conv_relevant_items.
call
"ZCL_A4H1_E2E_CUST_OPEN_INVOICE=>GET_CURR_CONV_RELEVANT_ITEMS"
(
iv_client => :iv_client,
iv_bupaid => :iv_bupaid,
et_conv_items => :lt_converted_items );
--aggregated gross amounts per customer
et_bpinfo =
select
customer_id,
bpa.company_name as customer_name,
ad.city,
ad.street,
ad.postal_code,
ad.country,
conv_items.currency_code_conv as currency_code,
sum( conv_items.gross_amount ) as sum_gross_amount
from :lt_converted_items as conv_items
join snwd_bpa as bpa
on conv_items.client = bpa.client
and buyer_guid = bpa.node_key
join snwd_ad as ad
on bpa.client = ad.client
and bpa.address_guid = ad.node_key
group by customer_id, company_name, city, street,
postal_code, country, currency_code_conv;
ENDMETHOD.

ENDCLASS.
ZCL_ZA4H1_E2E_CUST_INF_DPC_EXT

CLASS zcl_za4h1_e2e_cust_inf_dpc_ext DEFINITION


PUBLIC
12

INHERITING FROM zcl_za4h1_e2e_cust_inf_dpc


CREATE PUBLIC .
PUBLIC SECTION.
PROTECTED SECTION.
METHODS invoiceinfos_get_entityset REDEFINITION.
METHODS customerinfos_get_entity REDEFINITION.
PRIVATE SECTION.
ENDCLASS.

CLASS zcl_za4h1_e2e_cust_inf_dpc_ext IMPLEMENTATION.


METHOD invoiceinfos_get_entityset.
DATA ls_cust_classification TYPE
zcl_za4h1_e2e_cust_inf_mpc=>ts_customerclassification.
"Entity can only be accessed via the navigation property
ToInvoiceInfo
"of entity type CustomerClassification and if the key
CustomerId is provided
IF iv_source_name <>
zcl_za4h1_e2e_cust_inf_mpc=>gc_customerclassification.
RAISE EXCEPTION TYPE /iwbep/cx_mgw_tech_exception.
ENDIF.
io_tech_request_context->get_converted_source_keys(
IMPORTING
es_key_values = ls_cust_classification ).
"create an instance of class zcl_customer_open_invoices
DATA(lo_cust_info) = NEW zcl_a4h1_e2e_cust_open_invoice(
).
"call the ABAP managed DB procedure respectively the
"ABAP class method get_invoice_info
lo_cust_info->get_invoice_info(
EXPORTING
iv_client = sy-mandt
iv_bupaid = ls_cust_classification-customer_id
IMPORTING

13

et_invinfo = DATA(lt_entityset)
).
"provide the resultset of the AMDP to the tabular
"tabular output parameter
et_entityset = lt_entityset.
ENDMETHOD.
METHOD customerinfos_get_entity.
DATA ls_cust_classification TYPE
zcl_za4h1_e2e_cust_inf_mpc=>ts_customerclassification.
"Entity can only be accessed via the navigation property
ToCustomerInfo
"of entity type CustomerClassification and if the key
CustomerId is provided
IF iv_source_name <>
zcl_za4h1_e2e_cust_inf_mpc=>gc_customerclassification.
RAISE EXCEPTION TYPE /iwbep/cx_mgw_tech_exception.
ENDIF.
io_tech_request_context->get_converted_source_keys(
IMPORTING
es_key_values = ls_cust_classification ).

"create an instance of class zcl_customer_open_invoices


DATA(lo_cust_info) = NEW zcl_a4h1_e2e_cust_open_invoice(
).
"call the ABAP managed DB procedure respectively the
"ABAP class method get_customer_info
lo_cust_info->get_customer_info(
EXPORTING
iv_client = sy-mandt
iv_bupaid = ls_cust_classification-customer_id
IMPORTING
et_bpinfo = DATA(lt_entity)
).
"only one line is expected to be retrieved
IF lines( lt_entity ) <> 1.

14

RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception


EXPORTING
message_unlimited = | Problem in Customer Info; {
lines( lt_entity ) } <> 1 |
textid
=
/iwbep/cx_mgw_busi_exception=>business_error_unlimited.
ENDIF.
"map the first row of lt_entity to the output
er_entity = lt_entity[ 1 ].
ENDMETHOD.
ENDCLASS.
ABAP PROGRAMS
ZR_ADBC_PROC_CALL

REPORT zr_adbc_proc_call.
"lot of type definitions
TYPES:
BEGIN OF ty_overview,
value TYPE string,
table TYPE string,
END OF ty_overview,
BEGIN OF ty_invoice_header,
invoice_guid TYPE snwd_so_inv_head-node_key,
created_at
TYPE snwd_so_inv_head-created_at,
paid_at
TYPE snwd_so_inv_head-changed_at,
buyer_guid
TYPE snwd_so_inv_head-buyer_guid,
END OF ty_invoice_header .
TYPES:
BEGIN OF ty_invoice_item,
item_guid
TYPE snwd_so_inv_item-node_key,
invoice_guid TYPE snwd_so_inv_head-node_key,
product_guid TYPE snwd_so_inv_item-product_guid,
gross_amount TYPE snwd_so_inv_item-gross_amount,
currency_code TYPE snwd_so_inv_item-currency_code,
END OF ty_invoice_item .
TYPES:
BEGIN OF ty_customer_info,
customer_guid TYPE snwd_bpa-node_key,
customer_id
TYPE snwd_bpa-bp_id,
customer_name TYPE snwd_bpa-company_name,

15

country
TYPE snwd_ad-country,
postal_code
TYPE snwd_ad-postal_code,
city
TYPE snwd_ad-city,
END OF ty_customer_info .
TYPES:
tt_invoice_header TYPE STANDARD TABLE OF ty_invoice_header
WITH KEY invoice_guid .
TYPES:
tt_invoice_item TYPE STANDARD TABLE OF ty_invoice_item .
TYPES:
tt_customer_info TYPE STANDARD TABLE OF ty_customer_info .
DATA
DATA
DATA
DATA
DATA
DATA
DATA

lv_stmt TYPE string.


lo_stmt TYPE REF TO cl_sql_statement.
lo_res TYPE REF TO cl_sql_result_set.
lt_overview TYPE STANDARD TABLE OF ty_overview.
lt_inv_head TYPE tt_invoice_header.
lt_inv_item TYPE tt_invoice_item.
lt_cust_info TYPE tt_customer_info.

lv_stmt = | CALL
"SAPHANAABAP"."ZCL_DEMO_PAID_ON_DATE_AMDP=>PAID_ON_DATE" | &&
|
( '20140912', NULL, NULL, NULL
) WITH OVERVIEW |.
TRY.
lo_stmt = NEW cl_sql_statement( ).
lo_res = lo_stmt->execute_query( lv_stmt ).
"get a reference of the overview table and prepare the
result set
lo_res->set_param_table( REF #( lt_overview ) ).
"retrieve the overview table
lo_res->next_package( ).
LOOP AT lt_overview INTO DATA(ls_overview).
"select from the corresponding DB table listed in the
overview table
DATA(lo_res_tab) = lo_stmt->execute_query( | select *
from { ls_overview-table }| ).
IF ls_overview-value CS 'ET_INVOICE_ITEM'.
"prepare the result set

16

lo_res_tab->set_param_table( REF #( lt_inv_item ) ).


ELSEIF ls_overview-value CS 'ET_INVOICE_HEAD'.
"prepare the result set
lo_res_tab->set_param_table( REF #( lt_inv_head ) ).
ELSEIF ls_overview-value CS 'ET_CUSTOMER_INFO'.
"prepare the result set
lo_res_tab->set_param_table( REF #( lt_cust_info ) ).
ENDIF.
"fetch the content of the database tables into the
internal tables
lo_res_tab->next_package( ).
ENDLOOP.
lo_res->close( ).
CATCH cx_sql_exception INTO DATA(lx).
"do some meaningful error handling
WRITE: lx->sql_message.
ENDTRY.
cl_demo_output=>display_data( name = 'Customer Info'
lt_cust_info ).

value =

ZR_ADBC_SIMPLE

REPORT zr_adbc_simple.
TYPES:
BEGIN OF ty_res,
bp_id
company_name
currency_code
total_gross_amount
END OF ty_res.
DATA
DATA
DATA
DATA

lv_stmt
lo_stmt
lo_res
lt_result

TYPE
TYPE
TYPE
TYPE

TYPE
TYPE
TYPE
TYPE

snwd_bpa-bp_id,
snwd_bpa-company_name,
snwd_so-currency_code,
snwd_so-gross_amount,

string.
REF TO cl_sql_statement.
REF TO cl_sql_result_set.
STANDARD TABLE OF ty_res WITH EMPTY KEY.

lv_stmt = |SELECT BP_ID, COMPANY_NAME, SO.CURRENCY_CODE,


| &&
|
SUM( SO.GROSS_AMOUNT ) as TOTAL_GROSS_AMOUNT
| &&
| FROM SNWD_BPA AS BPA
| &&
17

| INNER JOIN SNWD_SO AS SO


| &&
|

ON SO.BUYER_GUID = BPA.NODE_KEY

| &&
| GROUP BY BP_ID, COMPANY_NAME, SO.CURRENCY_CODE
|.
TRY.
"1. create statement object
lo_stmt = NEW cl_sql_statement( ).
"2. execute the query
lo_res = lo_stmt->execute_query( lv_stmt ).
"3. set the output parameter
lo_res->set_param_table( REF #( lt_result ) ).
"4. fetch the result
lo_res->next_package( ).
"5. release the resources
lo_res->close( ).
CATCH cx_sql_exception INTO DATA(lx).
"do some meaningful error handling
WRITE: lx->sql_message.
ENDTRY.
cl_demo_output=>display_data( lt_result ).
ZR_AMDP_01_SIMPLE_CALL

REPORT zr_amdp_01_simple_call.
DATA(lo_amdp) = NEW zcl_amdp_simple_00( ).
TRY.
lo_amdp->get_customer_infos(
IMPORTING
et_customer_info = DATA(lt_result) ).
cl_demo_output=>display_data( lt_result ).
CATCH cx_amdp_execution_failed INTO DATA(lx).
"do some meaningful error handling
WRITE: 'Error occurred during execution of an AMDP - do
something!',
/ 'SQL Error Message:',
18

/ |{ lx->sql_message }|.
ENDTRY.
ZR_AMDP_BADI_CALL

REPORT zr_amdp_badi_call.
data lt_cust_info type zif_a4h1_amdp_badi=>tt_customer_info.
"call the AMDP BAdI
zcl_a4h1_call_amdp_badi=>call_badi( IMPORTING et_customer_info
= lt_cust_info ).

cl_demo_output=>display_data( name = 'Customer Info'


lt_cust_info ).

value =

ZR_AMDP_CALL

REPORT zr_amdp_call.
DATA(lo_info_list) = NEW zcl_demo_paid_on_date_amdp( ).
lo_info_list->paid_on_date(
EXPORTING
iv_payment_date = '20140912'
IMPORTING
et_customer_info = DATA(lt_cust_info_amdp)
et_invoice_header = DATA(lt_inv_head_amdp)
et_invoice_item
= DATA(lt_inv_item_amdp) ).
cl_demo_output=>display_data( name = 'Customer Info'
value = lt_cust_info_amdp ).
ABAP INTERFACES
ZIF_A4H1_AMDP_BADI

INTERFACE zif_a4h1_amdp_badi
PUBLIC .

INTERFACES if_badi_interface .
TYPES:
BEGIN OF ty_customer_info,
customer_id
TYPE snwd_bpa-bp_id,
customer_name
TYPE snwd_bpa-company_name,
currency_code
TYPE snwd_so-currency_code,
total_gross_amount TYPE snwd_so-gross_amount,
END OF ty_customer_info ,

19

tt_customer_info TYPE STANDARD TABLE OF ty_customer_info.


METHODS get_customer_infos
EXPORTING
VALUE(et_customer_info) TYPE tt_customer_info
RAISING
cx_amdp_error .

ENDINTERFACE.

20

www.sap.com

2014 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form
or for any purpose without the express permission of SAP SE or an SAP
affiliate company.
SAP and other SAP products and services mentioned herein as well as their
respective logos are trademarks or registered trademarks of SAP SE (or an
SAP affiliate company) in Germany and other countries. Please see
http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for
additional trademark information and notices. Some software products
marketed by SAP SE and its distributors contain proprietary software
components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for
informational purposes only, without representation or warranty of any kind,
and SAP SE or its affiliated companies shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company products and services are those that are set forth in
the express warranty statements accompanying such products and services,
if any. Nothing herein should be construed as constituting an additional
warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue
any course of business outlined in this document or any related presentation,
or to develop or release any functionality mentioned therein. This document,
or any related presentation, and SAP SEs or its affiliated companies
strategy and possible future developments, products, and/or platform
directions and functionality are all subject to change and may be changed by
SAP SE or its affiliated companies at any time for any reason without notice.
The information in this document is not a commitment, promise, or legal
obligation to deliver any material, code, or functionality. All forward-looking
statements are subject to various risks and uncertainties that could cause
actual results to differ materially from expectations. Readers are cautioned
not to place undue reliance on these forward-looking statements, which
speak only as of their dates, and they should not be relied upon in making
purchasing decisions.

S-ar putea să vă placă și