Created
October 13, 2014 01:39
-
-
Save js1972/5af45936d2c38dd95131 to your computer and use it in GitHub Desktop.
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…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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