2021 Apr 05 11:09 AM
Hi all ,
just got an error while try to determine default value for cds parameter
i was try also , and it's not working
could someone let me know how to solve this ?
2021 Apr 05 12:36 PM
Hi Thorsten ,
i just followed https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abencds_f1_parameter_annotations.htm
looks like the error still persist
2021 Apr 05 12:05 PM
Hi,
you can determine the language with the session variable $session.system_language.
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/de-de/abencds_f1_session_variable.htm
The Default value for a parameter can be set with the consumption annotation
@Consumption.defaultValue
The report DEMO_CDS_SYSTEM_FIELDS is mentioned in the sap help:
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abencds_f1_parameter_annotations.htm
Best Regards
Thorsten
2021 Apr 05 12:36 PM
Hi Thorsten ,
i just followed https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abencds_f1_parameter_annotations.htm
looks like the error still persist
2021 Apr 05 4:29 PM
This is the code from the demo CDS View demo_cds_system_fields.
Are you using version 7.5x?
@AbapCatalog.sqlViewName: 'DEMO_CDS_SYST'
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view demo_cds_system_fields
with parameters
@Environment.systemField : #CLIENT
p_mandt : syst_mandt,
@Environment.systemField : #SYSTEM_DATE
p_datum : syst_datum,
@Environment.systemField : #SYSTEM_TIME
p_uzeit : syst_uzeit,
p_langu : syst_langu @<Environment.systemField : #SYSTEM_LANGUAGE,
p_uname : syst_uname @<Environment.systemField : #USER
as select from
demo_expressions
{
:p_mandt as client,
:p_datum as datum,
:p_uzeit as uzeit,
:p_langu as langu,
:p_uname as uname
}
where
id = '1';
ABAP Code
REPORT demo_cds_system_fields.
CLASS demo DEFINITION.
PUBLIC SECTION.
CLASS-METHODS main.
ENDCLASS.
CLASS demo IMPLEMENTATION.
METHOD main.
DELETE FROM demo_expressions.
INSERT demo_expressions FROM @( VALUE #( id = '1' ) ).
SELECT *
FROM demo_cds_system_fields( p_datum = @sy-datum,
p_uzeit = @sy-uzeit,
p_langu = @sy-langu,
p_uname = @sy-uname )
INTO TABLE @DATA(result).
SELECT *
FROM demo_cds_system_fields( )
APPENDING TABLE @result.
cl_demo_output=>display( result ).
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
demo=>main( ).