‎2019 Dec 29 9:47 PM
Hi all,
I just newly installed the AS ABAP 752 SP04 developer edition and started up trying to create a CDS view by making the tutorial offered here:
Unfortunately when trying to activate the CDS view I get the following error message.
DDLS ZDEMO_CDS_SALESORDERITEM was not activated
also there is a second error I did not have in my first try:
DDL source ZDEMO_CDS_SALESORDERITEM contains errors
Does anyone know what's the problem? I am confusred because I copied and pasted the source code 1 by 1.
------------------------------------------------------------------------------------------------------------------------------------------------------
Source Code:
@AbapCatalog.sqlViewName: 'ZDEMO_SOI_001'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'List Reporting for Sales Order Item'
@OData.publish: true
define view ZDEMO_CDS_SalesOrderItem as select from SEPM_I_SalesOrderItem_E as Item {
key Item.SalesOrder as SalesOrderID,
key Item.SalesOrderItem as ItemPosition,
Item._SalesOrder._Customer.CompanyName as CompanyName,
Item.Product as Product,
@Semantics.currencyCode: true
Item.TransactionCurrency as CurrencyCode,
@Semantics.amount.currencyCode: 'CurrencyCode'
Item.GrossAmountInTransacCurrency as GrossAmount,
@Semantics.amount.currencyCode: 'CurrencyCode'
Item.NetAmountInTransactionCurrency as NetAmount,
@Semantics.amount.currencyCode: 'CurrencyCode'
Item.TaxAmountInTransactionCurrency as TaxAmount,
Item.ProductAvailabilityStatus as ProductAvailabilityStatus
Thanks a lot in advance!
Best regards.
‎2019 Dec 29 11:17 PM
1. Try changing your code from: @AbapCatalog.sqlViewName: 'ZDEMO_SOI_001'
to: @AbapCatalog.sqlViewName: 'ZDEMO_SOI'
*
because:
Your code says: @AbapCatalog.sqlViewName: 'ZDEMO_SOI_001'
But Sample Code says: @AbapCatalog.sqlViewName: 'ZDEMO_SOI'
2. You have 2 extra statements (not in sample code).
Have you tried removing your 2 extra lines (which are not in sample code)?
@AbapCatalog.preserveKey: true
*
*
@OData.publish: true
3. Have you tried putting this statement on 2 lines as in sample code (instead of on 1 line as in your code):
define view ZDEMO_CDS_SalesOrderItem
as select from SEPM_I_SalesOrderItem_E as Item
4. After your code, Insert closing bracket which is at end of sample code on its own brand new line:
}
5. Also I'd suggest making your spacing look exactly like spacing in sample code
6. Should you create a view called: view ZDEMO_CDS_SalesOrderItem
7. activate; make sure your code activates successfully, no errors/informational messages
‎2019 Dec 29 11:17 PM
1. Try changing your code from: @AbapCatalog.sqlViewName: 'ZDEMO_SOI_001'
to: @AbapCatalog.sqlViewName: 'ZDEMO_SOI'
*
because:
Your code says: @AbapCatalog.sqlViewName: 'ZDEMO_SOI_001'
But Sample Code says: @AbapCatalog.sqlViewName: 'ZDEMO_SOI'
2. You have 2 extra statements (not in sample code).
Have you tried removing your 2 extra lines (which are not in sample code)?
@AbapCatalog.preserveKey: true
*
*
@OData.publish: true
3. Have you tried putting this statement on 2 lines as in sample code (instead of on 1 line as in your code):
define view ZDEMO_CDS_SalesOrderItem
as select from SEPM_I_SalesOrderItem_E as Item
4. After your code, Insert closing bracket which is at end of sample code on its own brand new line:
}
5. Also I'd suggest making your spacing look exactly like spacing in sample code
6. Should you create a view called: view ZDEMO_CDS_SalesOrderItem
7. activate; make sure your code activates successfully, no errors/informational messages
‎2019 Dec 30 4:52 AM
‎2019 Dec 30 10:39 AM
Hi Joanna,
thanks a lot for your quick reply. It was helpful
Anyhow I could not enter 'ZDEMO_SOI' because this did already exist in the system, so I was getting the error message "ZDEMO_SOI is already defined as structure or table"
But just renaming it to ZDEMO_SOI2 did help.
Your other points were helpful. The bug has been fixed. Anyhow one error is still remaining, which I am trying to fix:
No access control for entity ZDEMO_CDS_SALESORDERITEM. Create DCL or use annot. AccessControl [Access Control Management]
The source code:
@AbapCatalog.sqlViewName: 'ZDEMO_SOI2'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'List Reporting for Sales Order Item'
define view ZDEMO_CDS_SalesOrderItem
as select from SEPM_I_SalesOrderItem_E as Item {
key Item.SalesOrder as SalesOrderID,
key Item.SalesOrderItem as ItemPosition,
Item._SalesOrder._Customer.CompanyName as CompanyName,
Item.Product as Product,
@Semantics.currencyCode: true
Item.TransactionCurrency as CurrencyCode,
@Semantics.amount.currencyCode: 'CurrencyCode'
Item.GrossAmountInTransacCurrency as GrossAmount,
@Semantics.amount.currencyCode: 'CurrencyCode'
Item.NetAmountInTransactionCurrency as NetAmount,
@Semantics.amount.currencyCode: 'CurrencyCode'
Item.TaxAmountInTransactionCurrency as TaxAmount,
Item.ProductAvailabilityStatus as ProductAvailabilityStatus
}
‎2019 Dec 30 11:01 AM
‎2019 Dec 30 10:45 AM
data-definition-zdemo-cds-salesorderitem-npl.jpg
@ Mahesh Kumar Palavalli: Here is the screenshot!
‎2019 Dec 30 8:24 PM