Hey Simon,
thanks for your reply.
The where used query is a good hint, but f. e. I_Material is not displayed for mara...
Regards
Simon
Hey Simon,
thanks for your reply.
The where used query is a good hint, but f. e. I_Material is not displayed for mara...
Regards
Simon
Hi Simon,
interesting I_Material was the first hit for mara in my system..
Best Regards,
Simon
Hello All,
I'm trying to have a try on the new feature of publish the CDS view into OData Service with annotation @OData.publish:true. But after I define the view and activate it in ADT. It always hint me like below:
Description | Resource | Path | Location | Type |
No access control for entity ZTEST_REF_OVP. Create DCL or use annot. AccessControl [Access Control Management] | ZTEST_REF_OVP (ABAP DDL Source) | [S4H] ZTEST_REF_OVP | Unknown | ABAP Syntax Check Problem |
The service ZTEST_REF_OVP_CDS does not exist [OData Exposure] | ZTEST_REF_OVP (ABAP DDL Source) | [S4H] ZTEST_REF_OVP | line 6 | ABAP Syntax Check Problem |
Could anybody help me on this? Thanks a lot!
Below please see my code to define the CDS view:
@AbapCatalog.sqlViewName: 'ZTest_REF_forOVP'
@ClientDependent: true
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'CDS view for po amount greater than 10000'
@OData.publish:true
define view ZTEST_REF_OVP as select from snwd_po as po
inner join snwd_bpa as bpa
on po.partner_guid = bpa.node_key
{ key bpa.bp_id as BusinessPartner,
bpa.company_name,
sum( po.gross_amount ) as Total_Gross_Amount,
po.currency_code
}
group by
bpa.bp_id,
bpa.company_name,
po.currency_code
having sum(po.gross_amount) > 10000
Best regards,
Zhuoyi
Hi Zhuoyi,
you defined @AccessControl.authorizationCheck: #CHECK in your DDLS.
Did you also created the DCL document? If not please set @AccessControl.authorizationCheck: #NOT_REQUIRED and try again to generate the OData service.
best regards,
Ingo
Hi Experts,
I want to know the use of $projection keyword. when should we use this keyword.
I want to know the difference of below two statements
business_partners[ bp_role ='01'].company_name as customer_name --
I know this statement is used to display the customer name whose Bp_role value is equal to 01
But I didn't understand the below statement
mard[1: matnr ='0000000010'].lgort
Can you also please tell me about use of associations. Since we can use inner joins in which business scenario we can use associations.
Thanks
Pawan Akella
Hello Ingo,
I tried to follow your advice, this issue still exist but the authorizationCheck warning message disappear, now it only said that
Description | Resource | Path | Location | Type |
The service ZTEST_REF_OVP_CDS does not exist [OData Exposure] | ZTEST_REF_OVP (ABAP DDL Source) | [S4H] ZTEST_REF_OVP | line 6 | ABAP Syntax Check Problem |
Any other ideas?
Thanks and best regards,
Zhuoyi
Hi Pawin,
$projection is used, when you want to refer to a name defined as alias in the projection list e.g. in an on-condition of an assocation.
The 1: when using a filter for an association tells the compiler, that the association gets a to 0..1 cardinality when the filter is applied. Otherwise you would get a warning that the cardinality of your view might change by following the assocation.
Associations can be used within CDS, from OpenSQL or by exposing then via OData.
Regards, Thomas
Hi Zhuoyi,
@OData.publish: true registers the service but does not activate it autimatically. This is an additional customizing step does via transaction /IWFND/MAINT_SERVICE.
See Activate and Maintain Services - SAP Gateway Foundation (SAP_GWFND) - SAP Library
Regards, Thomas
Hello Thomas,
Thanks for your kindly support. I have created one CDS view that automatically published with CDS view before. It first should generate a OData service and then I could go to /iwfnd/maint_service to specify the system alias and activate it. But it was failed to generate the OData service with the warning message. And an error message will only show a moment hints like the Globe type XXX is already exist and disappear and the warning message like blow showing in the problems view:
Do you have any idea on this?
Thanks in advance!
Best regards,
Zhuoyi
Hi Joachim,
you have to declare all objects you use inside your AMDP procedure via the USING addition. Please see the ABAP help for AMDP. There are also articles in SCN where you can see "USING" in action:
http://scn.sap.com/docs/DOC-51612
If the objects are in another schema, not managed by the ABAP, then they don't have to be declared. There really is an excellent ABAP help, so no need to ask these questions here ... Just search for "USING" and click on "METHOD ... USING ...".
Best regards,
Kilian.
Hi Kilian,
sorry but as you can see in my snippet i only call another non-amdp-procedure!
METHOD set_rdl_table BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT.
call "CVPM_CFM::SET_CF_RDL" ( it_wl_key => :it_wl_key,
rt_out => :lt_out ,
rt_key_fig => :lt_key_fig,
rt_key => :lt_key,
rt_error => :lt_error );
ENDMETHOD.
***
If the objects are in another schema, not managed by the ABAP, then they don't have to be declared. There really is an excellent ABAP help, so no need to ask these questions here ... Just search for "USING" and click on "METHOD ... USING ...".
***
So to take your answer, there is nothing to be declared. So no need to cite the old RTFM.
Let me cite the ABAP Help:
Addition 4
... USING db_entities
Effect
Declares the database objects managed by ABAP accessed in the AMDP procedure or function. The following must be specified after USING:
Neither is valid in my snippet. So the question is both valid and not answered.
Kind regards;
Joachim
HI,
triggered by Kilians answer i investigated in the help in deep and tried something:
create a procedure with name and without any package: "/1BCAMDP/ZCVPM_SET_RDL" as there is a hint of this namespace in the ABAP Help.
With the exception of the namespace /1BCAMDP/, database objects from the current database schema can be accessed in a database procedure or database function managed by AMDP only if they are managed by ABAP and specified after USING.
et voila: No error messages any more.
The error messages are totally misleading. Only procedures with the mentioned namespace are allowed.
Kind regards;
Joachim
Hi Joachim,
this principally has nothing to do with the namespace. This namespace is just some hack for rare uses (mostly SAP internal). You normally have to put the procedure in a different schema (with the exception of the above mentioned hack).
The ABAP believes all objects in the SAPSID schema as being managed by ABAP.
If all objects in the ABAP schema could also be unmanaged, then the check would not make any sense at all. Then we wouldn't need any USING clause at all. But the namespace is a valid option, too.
But, as I said, everything mentioned in the ABAP help :-).
Best regards,
Kilian.
Hi Joachim,
your orginal problem is that the procedure is defined in the HANA repository (the Content folder),
but from AMDP you can only refer to Catalog entities.
Your repository procedure gets deployed into the _SYS_BIC schema. You should be able to call this as _SYS_BIC."CVPM_CFM::SET_CF_RDL"
Regards, Thomas
Dear experts,
I am preparing custom SAP code for HANA and found the following:
1. Not only pool and cluster tables are affected, but also transparent ones (We have a customer on HANA who reported such cases).
2. SCI Code Inspector cannot find such code in all cases:
Currently there is a check: "Search problematic statements for result of SELECT/OPEN CURSOR without ORDER BY",
but! It works only if you perform specific operations after "SELECT .. INTO TABLE", for example:
* READ TABLE itab ... BINARY SEARCH
* DELETE ADJECENT DUPLICATES FROM itab
and etc. (they are all mentioned in the description of SCI Inspector check).
So if you just have a select into table without order by, but no specific operations mentioned in description if SCI check,
you code is not optimized for HANA and you are not aware of it. This select will not appear in Code Inspector result list.
For example, if we show documents list using just a select from table and immediately sending results to ALV, then user will see unsorted documents list.
Please advise how could such situations be found
I think you mix up functional correctness and hana optimizations.
The order by is necessary for following operations that rely on the sorting.
When you do not need the ordering, then it is surely faster if you do not add an ORDER BY.
- Thomas
Hi Thomas,
I think I did not explain the situation correctly.
For sure you do not need "ORDER BY" always.
But "ORDER BY" is needed not only if you perform operations that rely on sort after the select.
For example, you prepare a list of documents to show to the user. In the code, you just have a statement "Select * from <some header table". No more operations are performed.
Before HANA results were retrieved with sorting on table key fields.
But now in HANA user will see unsorted documents list. This is a known issue from one of the customers with HANA.
So in order to find such situations, I enhanced the SCI check. This does not mean I will add "ORDER BY" or "SORT" to all cases found by SCI, but check each case individually.
I wonder if there is any other option to handle this in a better way
I hope I explained it better this time
Hi,
Please tell me the best online training for SAP HANA ABAP. And also tell me the best online training tutorial.
Thanks,
Syed Abbas.