Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ABAP CDS Views. As of ABAP 7.40 sp5 we can create and use CDS view in ABAP. From ADT you can create a CDS view via menu New -> Other Repository Object -> Dictionary -> CDS View. See these blogs for some futher info: http://scn.sap.com/community/abap/eclipse/blog/2014/02/04/new-data-modeling-features-in-abap-for-hana (sp5) http://scn.sap.com/comm…
@AbapCatalog.sqlViewName: 'ZPURITEMS'
define view PurchaseOrderItem
as select from ekko inner join ekpo on ekko.ebeln = ekpo.ebeln {
key ekko.ebeln as id,
key ebelp as item_no,
lifnr as vendor,
ernam as created_by,
ekko.aedat as created_on,
txz01 as text,
@Semantics.currencyCode waers as currency_code,
@Semantics.amount.currencyCode: 'currency_code' netpr as price
}
where ekko.bstyp = 'F'
report y_test_cds_view.
start-of-selection.
data po_items type standard table of zpuritems with empty key.
select * from zpuritems into table po_items order by id descending item_no ascending.
cl_demo_output=>display_data( value = po_items ).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.