on 2025 Mar 14 10:51 AM
Hi everyone,
I am developing a Fiori Elements application using RESTful Application Programming (RAP). I have added a custom button (e.g., "KURBUTON"), but it appears inactive (disabled). However, I want this button to be always active, regardless of whether any selections are made.
Here is the code I used for the button:
projection;
//strict ( 2 );
define behavior for ZC_ZBA_P_01 //alias <alias_name>
{
// use create;
// use update;
// use delete;
use action KURBUTON ;
// use function kurbuton;
}
-----------------------------------------------------------------------------------------
managed implementation in class zbp_i_zba_m_001 unique;
//strict ( 2 );
define behavior for ZI_ZBA_M_001 //alias <alias_name>
persistent table I_ExchangeRateRawData
lock master
authorization master ( instance )
//etag master <field_name>
{
// create;
// update;
// delete;
// field ( readonly ) ExchangeRateType, SourceCurrency, TargetCurrency, ValidityStartDate;
action ( features: instance) KURBUTON result[1]$self;
//function kurbuton result [0..*] $self;
}
Request clarification before answering.
Hi @bettulaksu,
As per what I can see from the details you shared, you've created an instance action.
Ideally an instance action means that you want to perform some action on an instance of record, e.g., if there are 10 employees in the report - you've to select one record and then the button will be enabled.
If your requirement is to process the selected record, ask the end user to select the record and then the button will be enabled automatically.
There is one more type of action available in RAP known as Static Action.
If the action does not depend on the record selection, define the action in your behaviour definition as Static action.
Syntactically you're just supposed add a keyword static in your current behaviour definition.
Refer this documentation to know more - https://help.sap.com/docs/abap-cloud/abap-rap/action-definition#action-types
Please accept the answer if it resolves your query.
Regards,
LinkedIn - ClearQueries
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
11 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.